Re: Optimize WindowAgg's use of tuplestores - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: Optimize WindowAgg's use of tuplestores
Date
Msg-id 20240712.144108.1870669448685240589.ishii@postgresql.org
Whole thread Raw
In response to Re: Optimize WindowAgg's use of tuplestores  (Tatsuo Ishii <ishii@postgresql.org>)
List 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



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: speed up a logical replica setup
Next
From: Ashutosh Bapat
Date:
Subject: Re: Optimize WindowAgg's use of tuplestores