|
|
|
|
|
by thwarted
4495 days ago
|
|
No query optimizer would look at this and say "1M rows? Let's group and aggregate before filtering." I hope no optimizer would say that. It is well defined that filtering, as expressed in the where clause (if it uses indexes or not) happens before group and aggregate, and that grouping happens on the result of the filtering. If the optimizer could choose one way or the other, you'd have different results. If you want to group and aggregate first, you need to explicitly express that with a subquery. |
|