Re: Really really slow select count(*)

Поиск
Список
Период
Сортировка
От Pierre C
Тема Re: Really really slow select count(*)
Дата
Msg-id op.vqe98ttzeorkce@apollo13
обсуждение исходный текст
Ответ на Re: Really really slow select count(*)  (Shaun Thomas <sthomas@peak6.com>)
Список pgsql-performance
On Fri, 04 Feb 2011 21:37:56 +0100, Shaun Thomas <sthomas@peak6.com> wrote:

> On 02/04/2011 02:14 PM, felix wrote:
>
>> oh and there in the footnotes to django they say "dont' forget to run
>> the delete expired sessions management every once in a while".
>> thanks guys.
>
> Oh Django... :)
>
>> it won't run now because its too big, I can delete them from psql though
>
> You might be better off deleting the inverse. You know, start a
> transaction, select all the sessions that *aren't* expired, truncate the
> table, insert them back into the session table, and commit.

Note that for a session table, that is updated very often, you can use the
postgres' HOT feature which will create a lot less dead rows. Look it up
in the docs.

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

Предыдущее
От: Віталій Тимчишин
Дата:
Сообщение: Re: How to best use 32 15k.7 300GB drives?
Следующее
От: Cédric Villemain
Дата:
Сообщение: Re: Write-heavy pg_stats_collector on mostly idle server