Re: v12.0: ERROR: could not find pathkey item to sort

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Rowley <drowley(at)postgresql(dot)org>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: v12.0: ERROR: could not find pathkey item to sort
Date: 2019-11-06 01:31:36
Message-ID: CA+HiwqF9gtjySUWiLqB1ZjxnjLq3zUgtJiyQLmPjr9g1DJUQCg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 6, 2019 at 1:51 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Amit Langote <amitlangote09(at)gmail(dot)com> writes:
> > I have been thinking maybe add_child_rel_equivalences() doesn't need
> > to translate EC members that reference multiple appendrels, because
> > there top_parent_relids is always a singleton set, whereas em_relids
> > of such expressions is not? Those half-translated expressions are
> > useless, only adding to the overhead of scanning ec_members. I'm
> > thinking that we should apply this diff:
> > - if (bms_overlap(cur_em->em_relids, top_parent_relids))
> > + if (bms_is_subset(cur_em->em_relids, top_parent_relids))
>
> Meh, I'm not really convinced. The case where this would be relevant
> is an EC generated from something like "WHERE (a.x + b.y) = c.z"
> where "a" is partitioned. It's possible that we'd never have a use
> for a sort key corresponding to "a_child.x + b.y", but I think that's
> not obvious, and probably short-sighted. Anyway such EC members are
> pretty rare in the first place, so we're not going to win much
> performance by trying to optimize them.

OK.

> Anyway, I've pushed the fix for Justin's problem to v12 and HEAD.
> The problem with poor planning of multiway joins that you mentioned
> in the other thread remains open, but I imagine the patches you
> posted there are going to need rebasing over this commit, so I
> set that CF entry to Waiting On Author.

Thank you. I will send rebased patches on that thread.

Regards,
Amit

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-11-06 02:23:09 Re: cost based vacuum (parallel)
Previous Message Mark Dilger 2019-11-06 01:21:25 Checking return value of SPI_execute