Re: Performance issue after creating partitions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Performance issue after creating partitions
Дата
Msg-id 3757070.1661895637@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Performance issue after creating partitions  (Teja Jakkidi <teja.jakkidi05@gmail.com>)
Ответы Re: Performance issue after creating partitions  (Doug Reynolds <mav@wastegate.net>)
Список pgsql-admin
Teja Jakkidi <teja.jakkidi05@gmail.com> writes:
> Anyone ever encountered the below situation as what I am noticing with partitions?

You haven't shown us your query, so any answer would be blind speculation.

However, in the spirit of blind speculation, I'm wondering if you're
expecting those range constraints to propagate across a join.  They
won't; you'd need to duplicate the conditions for the other table.

That is, if you have WHERE+JOIN/ON conditions amounting to

    WHERE a.a = b.b AND b.b = constant

the planner is able to derive "a.a = constant" on the assumption of
transitivity, and use that to constrain the scan of table a (ie,
use an index, reject partitions at plan time, etc).  But no such
deduction happens for

    WHERE a.a = b.b AND b.b >= constant

If you want a constrained scan of a, you need to write it out:

    WHERE a.a = b.b AND b.b >= constant AND a.a >= constant

            regards, tom lane



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

Предыдущее
От: Teja Jakkidi
Дата:
Сообщение: Re: Performance issue after creating partitions
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Adding more detail to pg_upgrade documentation