Re: Report planning memory in EXPLAIN ANALYZE

Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>

From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, David Rowley <dgrowleyml@gmail.com>, Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Date: 2023-08-10T08:34:31Z
Lists: pgsql-hackers
Hi David,

On Wed, Aug 9, 2023 at 8:09 PM Ashutosh Bapat
<ashutosh.bapat.oss@gmail.com> wrote:
>
> I need to just make sure that the Planning Memory is reported with SUMMARY ON.
>
The patch reports planning memory in EXPLAIN without ANALYZE when SUMMARY = ON.

#explain (summary on) select * from a, b where a.c1 = b.c1 and a.c1 < b.c2;
                                  QUERY PLAN
-------------------------------------------------------------------------------
 Append  (cost=55.90..245.70 rows=1360 width=24)
   ->  Hash Join  (cost=55.90..119.45 rows=680 width=24)
         Hash Cond: (a_1.c1 = b_1.c1)
         Join Filter: (a_1.c1 < b_1.c2)
         ->  Seq Scan on a_p1 a_1  (cost=0.00..30.40 rows=2040 width=12)
         ->  Hash  (cost=30.40..30.40 rows=2040 width=12)
               ->  Seq Scan on b_p1 b_1  (cost=0.00..30.40 rows=2040 width=12)
   ->  Hash Join  (cost=55.90..119.45 rows=680 width=24)
         Hash Cond: (a_2.c1 = b_2.c1)
         Join Filter: (a_2.c1 < b_2.c2)
         ->  Seq Scan on a_p2 a_2  (cost=0.00..30.40 rows=2040 width=12)
         ->  Hash  (cost=30.40..30.40 rows=2040 width=12)
               ->  Seq Scan on b_p2 b_2  (cost=0.00..30.40 rows=2040 width=12)
 Planning Time: 2.220 ms
 Planning Memory: 124816 bytes
(15 rows)

We are good there.

-- 
Best Wishes,
Ashutosh Bapat



Commits

  1. Add EXPLAIN (MEMORY) to report planner memory consumption

  2. Fix explain regression test failure.