PostgreSQL operations that you can't EXPLAIN

1 · Felix Geisendörfer · May 23, 2017, 2:25 p.m.
I am currently dabbling in PostgreSQL internals in my spare time, including trying to understand the query planner and executor. It's a deeply humbling experience, but occasionally I'm delighted to be able to answer simple questions I'm researching. One of these questions is how PostgreSQL is executing ORDER BY clauses inside of aggregate expressions. Consider a simple table that holds 3 rows of an int column ranging from 1 to 3: # CREATE TABLE foo AS SELECT * FROM generate_series(1, 3) i; SELEC...