Re: Index scan startup time - Mailing list pgsql-performance

From Steinar H. Gunderson
Subject Re: Index scan startup time
Date
Msg-id 20060330120206.GA13075@uio.no
Whole thread Raw
In response to Index scan startup time  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Index scan startup time
List pgsql-performance
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?

/* Steinar */
--
Homepage: http://www.sesse.net/

pgsql-performance by date:

Previous
From: Peter Eisentraut
Date:
Subject: Index scan startup time
Next
From: Michael Stone
Date:
Subject: Re: Index scan startup time