pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Gerardo Herzig <gherzig@fmed.uba.ar>
Cc: pgsql-sql@postgresql.org
Subject: Re: index not being used. Why?
Date: Fri, 09 Mar 2007 15:59:48 +0000
Message-ID: <45F18474.4000207@archonet.com> (raw)
In-Reply-To: <45F176CA.3050107@fmed.uba.ar>
References: <45F176CA.3050107@fmed.uba.ar>

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



view thread (7+ messages)  latest in thread

Message-ID: <45F18474.4000207@archonet.com>
Permalink:  ../45F18474.4000207@archonet.com/
Also on:    postgresql.org/message-id/45F18474.4000207@archonet.com

 · 

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-sql@postgresql.org
  Cc: dev@archonet.com, gherzig@fmed.uba.ar
  Subject: Re: index not being used. Why?
  In-Reply-To: <45F18474.4000207@archonet.com>

* 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