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

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: jian(dot)universality(at)gmail(dot)com
Cc: dgrowleyml(at)gmail(dot)com, ashutosh(dot)bapat(dot)oss(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN
Date: 2024-09-05 06:10:24
Message-ID: 20240905.151024.1730395991018096027.ishii@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> hi. I can roughly understand it.
>
> I have one minor issue with the comment.
>
> typedef struct RecursiveUnionState
> {
> PlanState ps; /* its first field is NodeTag */
> bool recursing;
> bool intermediate_empty;
> Tuplestorestate *working_table;
> Tuplestorestate *intermediate_table;
> int64 storageSize; /* max storage size Tuplestore */
> char *storageType; /* the storage type above */
> ....
> }
>
> "/* the storage type above */"
> is kind of ambiguous, since there is more than one Tuplestorestate.
>
> i think it roughly means: the storage type of working_table
> while the max storage of working_table.
>
>
>
> typedef struct WindowAggState
> {
> ScanState ss; /* its first field is NodeTag */
>
> /* these fields are filled in by ExecInitExpr: */
> List *funcs; /* all WindowFunc nodes in targetlist */
> int numfuncs; /* total number of window functions */
> int numaggs; /* number that are plain aggregates */
>
> WindowStatePerFunc perfunc; /* per-window-function information */
> WindowStatePerAgg peragg; /* per-plain-aggregate information */
> ExprState *partEqfunction; /* equality funcs for partition columns */
> ExprState *ordEqfunction; /* equality funcs for ordering columns */
> Tuplestorestate *buffer; /* stores rows of current partition */
> int64 storageSize; /* max storage size in buffer */
> char *storageType; /* the storage type above */
> }
>
> " /* the storage type above */"
> I think it roughly means:
> " the storage type of WindowAggState->buffer while the max storage of
> WindowAggState->buffer".

Thank you for looking into my patch. Unfortunately I need to work on
other issue before adjusting the comments because the fields might go
away if I change the tuplestore infrastructure per David's suggestion:
https://www.postgresql.org/message-id/CAApHDvoY8cibGcicLV0fNh%3D9JVx9PANcWvhkdjBnDCc9Quqytg%40mail.gmail.com

After this I will rebase the patches. This commit requires changes.
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=908a968612f9ed61911d8ca0a185b262b82f1269

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2024-09-05 06:19:13 Re: Add parallel columns for seq scan and index scan on pg_stat_all_tables and _indexes
Previous Message Amit Kapila 2024-09-05 05:39:26 Re: Commit Timestamp and LSN Inversion issue