Re: why my query is not using index?? - Mailing list pgsql-performance

From Francisco Reyes
Subject Re: why my query is not using index??
Date
Msg-id 20041012005231.U98867@zoraida.natserv.net
Whole thread Raw
In response to Re: why my query is not using index??  (John Meinel <john@johnmeinel.com>)
Responses Re: why my query is not using index??
List 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.

pgsql-performance by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Normal case or bad query plan?
Next
From: Francisco Reyes
Date:
Subject: Re: Understanding explains