3 ms·
> Note that this SQL query is not very efficient. An experienced developer would rewrite it to use subqueries Anyone care to explain why is that? I thought the
by methyl 5y ago
> Note that this SQL query is not very efficient. An experienced developer would rewrite it to use subqueries
Anyone care to explain why is that? I thought the query plan should be the same for JOINs and subqueries.
- RedCrowbar 5y agoThere is a difference in how large a set `array_agg` would need to process, since `LEFT JOIN` may produce a very sparse relation and NULLs still have to be scanned over.