| От | PFC |
|---|---|
| Тема | Re: Partitioned tables - planner wont use indexes |
| Дата | |
| Msg-id | op.t9fzy1lncigqcu@apollo13.peufeu.com обсуждение исходный текст |
| Ответ на | Partitioned tables - planner wont use indexes (kevin kempter <kevin@kevinkempterllc.com>) |
| Список | pgsql-performance |
> I tried removing the index from the part_master table and got the same
> result
Since all the data is in the partitions, the part_master table is empty,
so the index is not useful for your query.
> myDB=# explain SELECT min(logdate) FROM part_master;
Proposals :
1- Use plpgsql to parse the system catalogs, get the list of partitions,
and issue a min() query against each
2- Since dates tend to be incrementing, I guess the minimum date must not
be changing that often (unless you delete rows) ; therefore if you need
that information often I suggest a trigger that updates a separate table
which keeps the min_date (perhaps global or for each client, you choose).
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера