Re: Query optimizer 8.0.1 (and 8.0) - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Query optimizer 8.0.1 (and 8.0)
Date
Msg-id 20050204222327.GK10437@ns.snowman.net
Whole thread Raw
In response to Query optimizer 8.0.1 (and 8.0)  (pgsql@mohawksoft.com)
Responses Re: Query optimizer 8.0.1 (and 8.0)
List pgsql-hackers
* pgsql@mohawksoft.com (pgsql@mohawksoft.com) wrote:
> I have the USA census TIGER database loaded, the WHOLE THING, the whole
> country. It isn't the biggest database, but it is about 40G before
> indexes. Every table is over a few million rows. I can quite honestly say,
> a sequential scan is almost never the right thing to do.

Cool, I've got it loaded here too w/ PostGIS.  It's good stuff. :)  I'm
curious what all you're doing with it and especially if you're using
mapserver on it or have found a way to identify roads at a more
street/city/state/country level, I've had problems doing that.

> I suspect that analyze only samples a very small amount of the database
> and gets the wrong idea about it. Is there a way to force analyze to
> sample more  rows?

Yup:

alter table <blah> alter column <blah> set statistics <blah>

As I recall, the default is 100 for statistics, I'd say increase that
number to like 200 or 300 or more and see if it helps.
Stephen

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query optimizer 8.0.1 (and 8.0)
Next
From: pgsql@mohawksoft.com
Date:
Subject: Re: Query optimizer 8.0.1 (and 8.0)