Speeding up queries without rewriting them
How to do it…
SET work_mem = '1TB';
EXPLAIN ANALYZE). If
EXPLAIN changes for the query, then it may benefit from more memory. I'm guessing that you don't have access to 1 terabyte (TB) of RAM; the previous setting was only used to prove that the query plan is dependent on available memory....