Re: Seq Scan - Mailing list pgsql-general

From Reece Hart
Subject Re: Seq Scan
Date
Msg-id 1180720246.4821.47.camel@snafu.site
Whole thread Raw
In response to Re: Seq Scan  ("Tyler Durden" <tylersticky@gmail.com>)
List pgsql-general
On Fri, 2007-06-01 at 18:24 +0100, Tyler Durden wrote:
It uses Index Scan for id>200000 and Seq Scan for id>10?!

Based on the statistics pg has for your table, and on the cost of using the index, the cost based optimizer decided that it's more efficient to seq scan all of the rows than to incur the index overhead. These decisions are not always correct, but they're usually quite good.

If you don't believe it, try:
# set enable_seqscan=off;
# explain analyze ...
# set enable_seqscan=on;
# explain analyze ...

-Reece

-- 
Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0

pgsql-general by date:

Previous
From: RW
Date:
Subject: Re: Restoring 8.2 to 8.0
Next
From: Mike Ginsburg
Date:
Subject: Re: Interval Rounding