pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Francisco Reyes <lists@natserv.com>
To: John Meinel <john@johnmeinel.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: why my query is not using index??
Date: Tue, 12 Oct 2004 00:56:15 -0400 (EDT)
Message-ID: <20041012005231.U98867@zoraida.natserv.net> (raw)
In-Reply-To: <416B217D.9090000@johnmeinel.com>
References: <41639F3C.4050103@siche.net>
	<200410111425.02671.vygen@gmx.de>
	<20041011163756.M97379@zoraida.natserv.net>
	<416B217D.9090000@johnmeinel.com>

On Mon, 11 Oct 2004, John Meinel wrote:

> Postgres believes that it will cost 382 to do a sequential scan, versus 490 
> for an indexed scan. Hence why it prefers to do the sequential scan. Try 
> running explain analyze to see if how accurate it is.

With explain analyze I have with sequential scan on
Sort  (cost=382.01..382.15 rows=56 width=196)
(actual time=64.346..64.469 rows=24 loops=1)


And with seqscan off
Sort  (cost=490.82..490.96 rows=56 width=196)
(actual time=56.668..56.789 rows=24 loops=1)

So I guess that for this particular query I am better off setting the 
seqscan off.



view thread (9+ messages)  latest in thread

Message-ID: <20041012005231.U98867@zoraida.natserv.net>
Permalink:  ../20041012005231.U98867@zoraida.natserv.net/
Also on:    postgresql.org/message-id/20041012005231.U98867@zoraida.natserv.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: lists@natserv.com, john@johnmeinel.com
  Subject: Re: why my query is not using index??
  In-Reply-To: <20041012005231.U98867@zoraida.natserv.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