Re: Sequence vs. Index Scan - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: Sequence vs. Index Scan
Date
Msg-id 20070507105829.GB30076@phlogiston.dyndns.org
Whole thread Raw
In response to Re: Sequence vs. Index Scan  ("Aaron Bono" <postgresql@aranya.com>)
Responses Re: Sequence vs. Index Scan  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On Sun, May 06, 2007 at 01:45:54PM -0500, Aaron Bono wrote:
> Then I inserted 150 more records in the slow schema and pow - it started
> working like the fast schema.
> 
> So my conclusion is that the function is being treated as volatile even
> though it is stable because the number of records is small. 

I don't think that's the issue.  If this is dependent on the
number of records, then for some reason the way the data is
structured means that the planner thinks a seqscan's a better bet. 
This is probably due to distribution of the values.  You could try
increasing the stats sample, and see if that helps.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
This work was visionary and imaginative, and goes to show that visionary
and imaginative work need not end up well.     --Dennis Ritchie


pgsql-sql by date:

Previous
From: Phillip Smith
Date:
Subject: Re: syntax error in "createdb"
Next
From: Michael Fuhr
Date:
Subject: Re: How to use function PointN?