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

It is also called Table Elimination if you want a google-able term.
Because of the foreign key, the query should reduce to "explain select count(*) from Department d;"
The schema only allows one employee per department, so there is no need to look up the employee table.