Re: Optimize WindowAgg's use of tuplestores

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: dgrowleyml(at)gmail(dot)com
Cc: ashutosh(dot)bapat(dot)oss(at)gmail(dot)com, dgrowley(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Optimize WindowAgg's use of tuplestores
Date: 2024-07-12 05:41:08
Message-ID: 20240712.144108.1870669448685240589.ishii@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> @@ -2684,6 +2726,14 @@ ExecEndWindowAgg(WindowAggState *node)
> PlanState *outerPlan;
> int i;
>
> + if (node->buffer != NULL)
> + {
> + tuplestore_end(node->buffer);
> +
> + /* nullify so that release_partition skips the tuplestore_clear() */
> + node->buffer = NULL;
> + }
> +
>
> Is it possible that node->buffer == NULL in ExecEndWindowAgg()? If
> not, probably making it an Assert() or just removing the if() should
> be fine.

Of course it it possible, for example there's no row in a partition.
Sorry for noise.

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
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 Ashutosh Bapat 2024-07-12 06:29:12 Re: Optimize WindowAgg's use of tuplestores
Previous Message Amit Kapila 2024-07-12 05:40:52 Re: speed up a logical replica setup