Skip site navigation (1) Skip section navigation (2)

Re: Odd explain estimate

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Odd explain estimate
Date: 2003-07-31 20:59:21
Message-ID: 20030731205921.GF16230@libertyrms.info (view raw or flat)
Thread:
Lists: pgsql-performance
On Thu, Jul 31, 2003 at 02:51:45PM -0500, Jim C. Nasby wrote:
> Why is pgsql estimating a cost of 100000000 for retire_today in this
> query? I analyzed it, and there's nothing very odd about it, other than
> it's a temp table.
> 
> BTW, I had to set enable_seqscan=false to get this, otherwise it wants

That's why.  When you do that, it just automatically adds 100000000
to the cost of a seqscan.  It can't really disable it, because there
might be no other way to pull the result.

If you really needed to set enable_seqscan=false (did you really? 
Are you sure that's not the cheapest way?), you might want to
investigate expainding the statistics on the indexed column,
increasing the correlation through clustering, and other such tricks.

A

-- 
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info>                              M2P 2A8
                                         +1 416 646 3304 x110


In response to

Responses

pgsql-performance by date

Next:From: Joe ConwayDate: 2003-07-31 21:03:05
Subject: Re: EXTERNAL storage and substring on long strings
Previous:From: Tom LaneDate: 2003-07-31 20:58:11
Subject: Re: EXTERNAL storage and substring on long strings

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group