* 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