Re: FW: Constraint exclusion in partitions

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: FW: Constraint exclusion in partitions
Дата
Msg-id CAKFQuwahY0_9+bX0rVkmE-+qVQD0Qose-CTWprR_AOW19k7=qg@mail.gmail.com
обсуждение исходный текст
Ответ на FW: Constraint exclusion in partitions  (Daniel Begin <jfd553@hotmail.com>)
Список pgsql-general
On Fri, May 22, 2015 at 10:21 AM, Daniel Begin <jfd553@hotmail.com> wrote:

But how constraint exclusion would react with the following queries …

b-      Select * from parent_table where id between 2345 and 6789; -- using a range of ids

​Not sure...

These are constants but I'm not sure how smart the planner is about figuring out inequalities of this form.

I would guess yes but it should be easy enough to confirm this yourself using explain...you already have the tables.

c-       Select * from parent_table where id in(select ids from anothertable); -- using a list of ids from a select

Definitely no...

Constraint exclusion is done by the planner before data is read so there is no possible way for data in a table to be used.​


As for performance the only way to know for sure is to test your usage patterns and data.  Even without constraint exclusion partitioning can provide benefits.

David J.

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

Предыдущее
От: Daniel Begin
Дата:
Сообщение: FW: Constraint exclusion in partitions
Следующее
От: "Stefan Stefanov"
Дата:
Сообщение: Re: About COPY command (and probably file fdw too)