Added in PostgreSQL 17, the MEMORY parameter shows the amount of memory used (and allocated) by the planner in kB. The default is off.

There is no MEMORY parameter for auto_explain.

Here is a simple example:

 
QUERY
-----
explain (analyze, buffers, memory) select * from people; 

QUERY PLAN                             
----------
 Seq Scan on people  (cost=0.00..1638.07 rows=100007 width=23) (actual time=0.291..11.928 rows=100007 loops=1)
   Buffers: shared read=638
 Planning:
   Buffers: shared hit=17 read=6
   Memory: used=6kB  allocated=8kB
 Planning Time: 1.351 ms
 Execution Time: 18.828 ms


For help deciphering query execution plans, check out our product pgMustard.


Last updated: October 2024, PostgreSQL 17

Issue reports and suggestions are welcome, please get in touch.