Re: enable_incremental_sort changes query behavior

Jaime Casanova <jaime.casanova@2ndquadrant.com>

From: Jaime Casanova <jaime.casanova@2ndquadrant.com>
To: James Coleman <jtc331@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2020-10-03T14:54:36Z
Lists: pgsql-hackers

Attachments

On Sat, 3 Oct 2020 at 08:15, James Coleman <jtc331@gmail.com> wrote:
>
> Jaime: was the backtrace in the original report by any chance record
> from breakpointing in the first call to get_sortgroupref_tle() (and
> one that successfully returned a sort group ref) rather than a call
> that hit the elog error on line 379?
>

I remember the first backtrace a made for this was on the line of the
elog but then a second backtrace was with the function, now that
repeat it with line of the function for the elog (and the original
query) i see again create_incrementalsort_plan() which made me try
with enable_incremental_sort disabled...

sorry for that, attached a better backtrace

-- 
Jaime Casanova                      www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Commits

  1. Disallow SRFs when considering sorts below Gather Merge

  2. Error out when Gather Merge input is not sorted

  3. Fix get_useful_pathkeys_for_relation for volatile expressions

  4. Guard against core dump from uninitialized subplan.