Re: index not being used. Why? - Mailing list pgsql-sql

From Richard Huxton
Subject Re: index not being used. Why?
Date
Msg-id 45F18474.4000207@archonet.com
Whole thread Raw
In response to index not being used. Why?  (Gerardo Herzig <gherzig@fmed.uba.ar>)
List pgsql-sql
Gerardo Herzig wrote:
>         ->  Seq Scan on pages  (cost=0.00..9.08 rows=408 width=55)

> Watch the last row of the explain command. It makes a sequential scan on 
> the pages table, like it is not using the index on the "id" field.

You only have 408 rows in the table - it's probably not worth the 
trouble of using an index and *then* fetching the rows. Especially since  it's going to match most of the pages
anyway.

Try adding a few thousand rows, analyse and see if it decides to use the 
index then.
--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: [Re: PRIMARY KEY]
Next
From: Andrew Sullivan
Date:
Subject: Re: index not being used. Why?