Re: Index scan startup time

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Index scan startup time
Date: 2006-03-30 12:23:53
Message-ID: 200603301423.54510.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Am Donnerstag, 30. März 2006 14:02 schrieb Steinar H. Gunderson:
> On Thu, Mar 30, 2006 at 01:59:10PM +0200, Peter Eisentraut wrote:
> > EXPLAIN ANALYZE select activity_id from activity where state in (10000,
> > 10001) order by activity_id limit 100;
> >
> > QUERY PLAN
> >
> > Limit (cost=0.00..622.72 rows=100 width=8) (actual
> > time=207356.054..207356.876 rows=100 loops=1)
> > -> Index Scan using activity_pk on activity (cost=0.00..40717259.91
> > rows=6538650 width=8) (actual time=207356.050..207356.722 rows=100
> > loops=1) Filter: ((state = 10000) OR (state = 10001))
> > Total runtime: 207357.000 ms
> >
> > The table has seen VACUUM FULL and REINDEX before this.
>
> The index scan is by activity_id, not by state. Do you have an index on
> state at all?

There is an index on state as well but the column is not selective enough.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Peter Eisentraut 2006-03-30 12:24:27 Re: Index scan startup time
Previous Message Michael Stone 2006-03-30 12:06:05 Re: Index scan startup time