pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: Sequence vs. Index Scan
Date: Mon, 7 May 2007 06:58:29 -0400
Message-ID: <20070507105829.GB30076@phlogiston.dyndns.org> (raw)
In-Reply-To: <bf05e51c0705061145s43815026q49394acba8407c1f@mail.gmail.com>
References: <bf05e51c0705051405p29ee139fn30c9979f3772a1d4@mail.gmail.com>
	<29507.1178410970@sss.pgh.pa.us>
	<bf05e51c0705052125h33c1579ch652c978647d530d9@mail.gmail.com>
	<c2d9e70e0705052137i44d56415ud7ec0a8fa9250e23@mail.gmail.com>
	<bf05e51c0705061145s43815026q49394acba8407c1f@mail.gmail.com>

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



view thread (13+ messages)  latest in thread

Message-ID: <20070507105829.GB30076@phlogiston.dyndns.org>
Permalink:  ../20070507105829.GB30076@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20070507105829.GB30076@phlogiston.dyndns.org

 · 

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-sql@postgresql.org
  Cc: ajs@crankycanuck.ca
  Subject: Re: Sequence vs. Index Scan
  In-Reply-To: <20070507105829.GB30076@phlogiston.dyndns.org>

* 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