Re: [sqlsmith] Failed assertion during partition pruning

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: [sqlsmith] Failed assertion during partition pruning
Дата
Msg-id CAApHDvrXM7xdgFy9NvqfA+xhtDeHyxGY-c5x5fC1zc270Mbj1Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [sqlsmith] Failed assertion during partition pruning  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [sqlsmith] Failed assertion during partition pruning
Список pgsql-hackers
On Mon, 1 Feb 2021 at 18:57, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> I wrote:
> > David Rowley <dgrowleyml@gmail.com> writes:
> >> Parent RT indexes are guaranteed to be lower than their children RT
> >> indexes,
>
> > I was intentionally avoiding that assumption ;-).  Maybe it buys enough
> > to be worth the loss of generality, but ...
>
> Oh, it's too late at night.  I now remember that the real problem
> I had with that representation was that it cannot work for joinrels.
> Currently we only apply this logic to partitioned baserels, but
> don't you think it might someday be called on to optimize
> partitionwise joins?

I've not looked in detail, but I think the code would need a pretty
big overhaul before that could happen. For example, ever since we
allowed ATTACH PARTITION to work without taking an AEL we now have a
PartitionedRelPruneInfo.relid_map field that stores Oids for the
executor to look at to see if it can figure out if a partition has
been added since the plan was generated.  Not sure how that can work
with non-base rels as we have no Oid for join rels.  Perhaps I'm just
not thinking hard enough, but either way, it does seem like it would
take a pretty big hit with a hammer to make it work. My current
thinking is that being unable to represent join rels in a set of
Relids is fairly insignificant compared to what would be required to
get the feature to work correctly.

David



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Single transaction in the tablesync worker?
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Is Recovery actually paused?