Re: table partitioning and select max(id)

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: table partitioning and select max(id)
Дата
Msg-id 4D4D0F14.7020500@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: table partitioning and select max(id)  (Tobias Brox <tobixen@gmail.com>)
Список pgsql-performance
Tobias Brox wrote:
> I did test "select id from table order by id desc limit 1" on my parent table
> yesterday, it would still do the seq-scan.  Even adding a
> where-restriction to make sure only one partition was queried I still
> got the seq-scan.
>

Right; you actually have to direct the query toward the specific
partition by name, nothing run against the parent table will work.  The
new logic for 9.1 essentially splits the query into this alternate form,
runs it against every partition individually, then combines the
results.  If you can afford to wait for 9.1, that is certainly the easy
path here.  It just works out of the box in that version.

--
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: [HACKERS] Slow count(*) again...
Следующее
От: Greg Smith
Дата:
Сообщение: Re: [HACKERS] Slow count(*) again...