Re: why my query is not using index??

From: Francisco Reyes <lists(at)natserv(dot)com>
To: John Meinel <john(at)johnmeinel(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: why my query is not using index??
Date: 2004-10-12 04:56:15
Message-ID: 20041012005231.U98867@zoraida.natserv.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Francisco Reyes 2004-10-12 04:59:37 Re: Understanding explains
Previous Message Christopher Browne 2004-10-12 01:34:44 Re: IBM P-series machines (was: Excessive context