Re: Questions regarding distinct operation implementation - Mailing list pgsql-hackers

From David Rowley
Subject Re: Questions regarding distinct operation implementation
Date
Msg-id CAApHDvp0=0jGdbaMMpdE2+LJF1r+qwCQbRhNHJ3okGCi3ESC9Q@mail.gmail.com
Whole thread Raw
In response to Re: Questions regarding distinct operation implementation  (Ankit Kumar Pandey <itsankitkp@gmail.com>)
Responses Re: Questions regarding distinct operation implementation  (Ankit Kumar Pandey <itsankitkp@gmail.com>)
List pgsql-hackers
On Sat, 3 Dec 2022 at 20:36, Ankit Kumar Pandey <itsankitkp@gmail.com> wrote:
> Shouldn't this be an acceptable tradeoff if someone wants to perform
> extra operation in plain old aggregates? Although I am not sure how much
> this extra memory and compute usage is considered as acceptable.

We do our best to ensure that a given executor node never uses more
than work_mem.  Certainly, we still do have nodes that can exceed this
by a long way.  It would be unlikely that we'd accept anything new
that could do this.  Since nodeWindowAgg.c already can use up to
work_mem for the tuplestore, it does not seem unreasonable that if
there is a DISTINCT aggregate that you could use 50% of work_mem for
each,  that is, providing you can code it in such a way that you only
allocate one of these at once, i.e not allocate one per DISTINCT
aggregate all at once.

David



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Replace PROC_QUEUE / SHM_QUEUE with ilist.h
Next
From: Ankit Kumar Pandey
Date:
Subject: Re: Questions regarding distinct operation implementation