Y
Hacker News
new
|
ask
|
show
|
jobs
by
michael1999
1429 days ago
How would that work? Your schema allows an employee to be assigned to multiple departments, and the query must count them.
3 comments
atwebb
1429 days ago
It is also called Table Elimination if you want a google-able term.
link
jmalicki
1429 days ago
Because of the foreign key, the query should reduce to "explain select count(*) from Department d;"
link
doctor_eval
1429 days ago
The schema only allows one employee per department, so there is no need to look up the employee table.
link