Re: Partitioned tables - planner wont use indexes

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Views and functions returning sets of records
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Performance increase with elevator=deadline