Re: Partitioned tables - planner wont use indexes

Поиск
Список
Период
Сортировка
От paul rivers
Тема Re: Partitioned tables - planner wont use indexes
Дата
Msg-id 47F6D0E5.2050005@gmail.com
обсуждение исходный текст
Ответ на Partitioned tables - planner wont use indexes  (kevin kempter <kevin@kevinkempterllc.com>)
Список pgsql-performance
kevin kempter wrote:
> Hi List;
>
> Sorry if this is a dupe, my first post never showed up...
>
> I'm having some performance issues with a partitioned table. We have a
> VERY large table that we've partitioned by day.
>

Unfortunately, that is the defined behavior in this case. From 5.9.6 of
the manual:

"Constraint exclusion only works when the query's WHERE clause contains
constants."

[Where the constants are of course your partitioning column(s)]


The best way around this depends mostly on what you're up to. You can
get the min tablename from the catalogs, or you can keep a table of
active partitions that your script which drops off old partitions and
generates new ones can keep updated on the oldest/newest partition
dates. Or some number of other solutions, whatever you find cleanest for
your purposes.

Paul



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

Предыдущее
От: kevin kempter
Дата:
Сообщение: Partitioned tables - planner wont use indexes
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Partitioned tables - planner wont use indexes