Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Tatsuo Ishii <ishii(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN
Date: 2024-07-09 06:24:15
Message-ID: CAExHW5vV8Ung7wr1s=NhWHAmNaoSetPOO4tHXQgzUe_p7eL57A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 9, 2024 at 8:20 AM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>
> On Tue, 9 Jul 2024 at 14:44, Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:
> > BTW, it seems these executor nodes (other than Materialize and Window
> > Aggregate node) use tuplestore for their own purpose.
> >
> > CTE Scan
> > Recursive Union
> > Table Function Scan
> >
> > I have already implemented that for CTE Scan. Do you think other two
> > nodes are worth to add the information?
>
> Yes, I think so. I'd keep each as a separate patch so they can be
> considered independently. Doing all of them should hopefully ensure we
> strike the right balance of what code to put in explain.c and what
> code to put in tuplestore.c.
+1

+ if (es->format != EXPLAIN_FORMAT_TEXT)
+ {
+ ExplainPropertyText("Storage", storageType, es);
+ ExplainPropertyInteger("Maximum Storage", "kB", spaceUsedKB, es);
+ }
+ else
+ {
+ ExplainIndentText(es);
+ appendStringInfo(es->str,
+ "Storage: %s Maximum Storage: " INT64_FORMAT "kB\n",
+ storageType,
+ spaceUsedKB);
+ }

It will be good to move this code to a function which will be called
by show_*_info functions(). We might even convert it into a tuplestore
specific implementation hook after David's work.

--
Best Wishes,
Ashutosh Bapat

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey M. Borodin 2024-07-09 06:36:50 Re: Amcheck verification of GiST and GIN
Previous Message Michael Paquier 2024-07-09 06:20:26 Re: MAINTAIN privilege -- what do we need to un-revert it?