Re: Partitioning and constraint exclusion

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: Partitioning and constraint exclusion
Дата
Msg-id CANu8FizptPVzR8TAeYsje-6jSJyNLucipuQqNTQThsf-pHduyw@mail.gmail.com
обсуждение исходный текст
Ответ на Partitioning and constraint exclusion  (Jayadevan M <maymala.jayadevan@gmail.com>)
Ответы Re: Partitioning and constraint exclusion
Список pgsql-general
First, what is the PostgresSQL version ??????

Next, in postgresql.conf, what is the value of constraint_exclusion ?

On Mon, Sep 7, 2015 at 8:55 AM, Jayadevan M <maymala.jayadevan@gmail.com> wrote:
Hello ,

I have a parent table and 6 child tables (partitions). The child tables have check constraints defined in the form
CHECK (myuid in (123,456,..)).
myuid is bigint, the constraints for the 6 child tables are definitely mutually exclusive. The number of values in the list ranges from 2-10 for 5 of the child tables. For the 6th child table, the list is 2500+ elements. When I try explain/explain analyze for even a simple query like

select * from parent where myuid in (123,456,789) 

the child table with 2500+ elements gets always scanned. I have an index on the column and that does get used. But why doesn't the planner just use constraint exclusion and not go for the index scan? Anyone faced a similar issue?

Thanks,
Jayadevan



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

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

Предыдущее
От: Melvin Davidson
Дата:
Сообщение: Re: table dependencies
Следующее
От: "FarjadFarid\(ChkNet\)"
Дата:
Сообщение: Re: table dependencies