table partitioning and select max(id)

Поиск
Список
Период
Сортировка
От Tobias Brox
Тема table partitioning and select max(id)
Дата
Msg-id AANLkTi=pzBtH4i_WYrbR9JEyq+49vPPVJf-q08z_Bhu=@mail.gmail.com
обсуждение исходный текст
Ответы Re: table partitioning and select max(id)  (Ken Cox <kenstir@gmail.com>)
Re: table partitioning and select max(id)  (Greg Smith <greg@2ndquadrant.com>)
Список pgsql-performance
I implemented table partitioning, and it caused havoc with a "select
max(id)" on the parent table - the query plan has changed from a
lightningly fast backwards index scan to a deadly seq scan.  Both
partitions are set up with primary key index and draws new IDs from
the same sequence ... "select max(id)" on both partitions are fast.
Are there any tricks I can do to speed up this query?  I can't add the
ID to the table constraints, we may still get in "old" data causing
rows with fresh IDs to get into the old table.

(I decided to keep this short rather than include lots of details -
but at least worth mentioning that we're using PG9)

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Slow count(*) again...
Следующее
От: Mark Kirkwood
Дата:
Сообщение: Re: Talking about optimizer, my long dream