Re: Allow ordered partition scans in more cases

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Ronan Dunklau <ronan(dot)dunklau(at)aiven(dot)io>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allow ordered partition scans in more cases
Date: 2023-06-24 12:29:15
Message-ID: CAApHDvqWRkTa14yYTRmVYdELwz7XEdg_kqQSqQy4ZxrVbVygKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 4 Mar 2023 at 00:56, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> What's on my mind now is if turning 1 Sort into N Sorts is a
> particularly good idea from a work_mem standpoint. I see that we don't
> do tuplesort_end() until executor shutdown, so that would mean that we
> could end up using 1 x work_mem per Sort node. I idly wondered if we
> couldn't do tuplesort_end() after spitting out the final tuple when
> EXEC_FLAG_REWIND is not set, but that would still mean we could use N
> work_mems when EXEC_FLAG_REWIND *is* set. We only really have
> visibility of that during execution too, so can't really make a
> decision at plan time based on that.

Because of the above, I'm not planning on pursuing this patch any
further. We can maybe revisit this if we come up with better ways to
manage the number of work_mems a plan can have in the future. As of
now, I'm a little too worried that this patch will end up consuming
too many work_mems by adding a Sort node per partition.

I'll mark this as withdrawn.

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2023-06-24 13:09:44 Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG
Previous Message Tomas Vondra 2023-06-24 11:40:08 Re: Stampede of the JIT compilers