Re: indexes are farked

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Dr NoName <spamacct11(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: indexes are farked
Date: 2005-08-02 18:10:38
Message-ID: 1123006237.21793.25.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2005-08-02 at 13:05, Dr NoName wrote:
> siam_production=> explain analyze select * from render
> where person_id = 432;
>
> QUERY PLAN
> --------------------------------------------------------------------------------------------------------------
> Seq Scan on render (cost=0.00..39014.72 rows=27833
> width=1493) (actual time=7.11..743.55 rows=5261
> loops=1)
> Filter: (person_id = 432)
> Total runtime: 747.42 msec
> (3 rows)

Notice the disparity here? The query planner thinks that there's gonna
be 27833 rows returned, but there's only really 5261 being returned.

When's the last time you analyzed this table? And have you considered
running the pg_autovacuum daemon, which will vacuum and analyze for you
in the back ground?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar Hafstað 2005-08-02 18:14:10 Re: indexes are fucked
Previous Message Havasvölgyi Ottó 2005-08-02 18:10:12 Re: feeding big script to psql