Re: Crazy looking actual row count from explain analyze

From: Gordon Shannon <gordo169(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Crazy looking actual row count from explain analyze
Date: 2010-05-11 01:07:43
Message-ID: 28518862.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane-2 wrote:
>
> My first suspicion
> is that those are unvacuumed dead rows ... what's your vacuuming policy
> on this database?
>

Ah, I didn't know that number included dead tuples. That probably explains
it. pg_stat_user_tables says the table has 370,269 dead tuples. On this
table, I have autovacuum_vacuum_scale_factor set to 0.02, so I believe the
table will have to have 869K dead tuples before vacuum will kick in.

> I have already fixed this query by adding a better index.

Tom Lane-2 wrote:
>
> I think the new index might have "fixed" things largely by not bothering
> to index already-dead rows.
>

Actually, I put a partial index on status, where != 'V'. That fits our
usage pattern of 99% of the records being 'V', so it's a tiny index and
satisifies this type of query very quickly.

Thanks,

--gordon

--
View this message in context: http://old.nabble.com/Crazy-looking-actual-row-count-from-explain-analyze-tp28517643p28518862.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-05-11 01:09:35 Re: peer-to-peer replication with Postgres
Previous Message Mike Christensen 2010-05-11 01:04:05 Re: peer-to-peer replication with Postgres