Re: Column correlation drifts, index ignored again

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: siracusa(at)mindspring(dot)com, Postgres Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Column correlation drifts, index ignored again
Date: 2004-02-23 00:17:27
Message-ID: 200402221617.27658.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

John,

> I think the key is to get the planner to correctly ballpark the number of
> rows in the date range. If it does, I can't imagine it ever deciding to
> read 1,000,000 rows instead of 1,000 with any sane "cost" setting. I'm
> assuming the defaults are sane :)

The default for random_page_cost is sane, but very conservative; it's pretty
much assuming tables that are bigger than RAM and a single IDE disk. If
your setup is better than that, you can lower it.

For example, in the ideal case (database fits in RAM, fast RAM, CPU, and
random seek on the disk), you can lower it to 1.5. For less ideal
situations, 1.8 to 2.5 is reasonable on high-end hardware.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Sean Shanny 2004-02-23 02:48:54 Re: General performance questions about postgres on Apple
Previous Message John Siracusa 2004-02-23 00:09:07 Re: Column correlation drifts, index ignored again