Re: Remove extra Sort node above a btree-compatible Index Scan - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove extra Sort node above a btree-compatible Index Scan
Date
Msg-id 2681345.1740721397@sss.pgh.pa.us
Whole thread Raw
In response to Remove extra Sort node above a btree-compatible Index Scan  (Alexandra Wang <alexandra.wang.oss@gmail.com>)
List pgsql-hackers
Alexandra Wang <alexandra.wang.oss@gmail.com> writes:
> I’ve attached a patch that removes this unnecessary Sort node for
> B-tree-compatible indexes.

This does not look right at all.  You can't just ignore the opfamily
etc. while deciding whether two pathkeys represent the same sort
ordering, as you did in create_mergejoin_plan().  I don't like
pathkeys_have_same_sortop() either.  The pathkey data structures
were designed to let pointer comparison be sufficient for deciding
whether pathkeys are equivalent: see the "canonical pathkey" stuff
in pathkeys.c.  I think that this patch may be band-aiding over some
breakage of that concept, but you've not provided enough context to
figure out what the underlying problem is.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "R, Rakshit"
Date:
Subject: RE: SIMD optimization for list_sort
Next
From: Bertrand Drouvot
Date:
Subject: Re: Log connection establishment timings