Re:Use SQL subqueries to count distinct 50x faster
by atwebb on Friday January 24, 2014 @09:40AM
(#7115038)
Am I incorrect in stating that this isn't necessarily true? Just because a statement is earlier in a script doesn't mean it will be optimized first.
[ Parent
| on HN ]
Re:Use SQL subqueries to count distinct 50x faster
by joevandyk on Friday January 24, 2014 @10:20AM
(#7115246)
In Postgres, common table expressions are planned and executed separately.
I think of it as each section builds a temp table.
This can be a good or bad thing, but it's sometimes important to know that it's happening.