pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Steinar H. Gunderson <sgunderson@bigfoot.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index scan startup time
Date: Thu, 30 Mar 2006 14:23:53 +0200
Message-ID: <200603301423.54510.peter_e@gmx.net> (raw)
In-Reply-To: <20060330120206.GA13075@uio.no>
References: <200603301359.11038.peter_e@gmx.net>
	<20060330120206.GA13075@uio.no>

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/



view thread (16+ messages)  latest in thread

Message-ID: <200603301423.54510.peter_e@gmx.net>
Permalink:  ../200603301423.54510.peter_e@gmx.net/
Also on:    postgresql.org/message-id/200603301423.54510.peter_e@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: peter_e@gmx.net, sgunderson@bigfoot.com
  Subject: Re: Index scan startup time
  In-Reply-To: <200603301423.54510.peter_e@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox