Re: Really really slow select count(*) - Mailing list pgsql-performance

From Pierre C
Subject Re: Really really slow select count(*)
Date
Msg-id op.vqe98ttzeorkce@apollo13
Whole thread Raw
In response to Re: Really really slow select count(*)  (Shaun Thomas <sthomas@peak6.com>)
List 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 by date:

Previous
From: Віталій Тимчишин
Date:
Subject: Re: How to best use 32 15k.7 300GB drives?
Next
From: Cédric Villemain
Date:
Subject: Re: Write-heavy pg_stats_collector on mostly idle server