From: | Gregory Stark <stark(at)enterprisedb(dot)com> |
---|---|
To: | Postgres <pgsql-hackers(at)postgresql(dot)org> |
Subject: | How is random_page_cost=4 ok? |
Date: | 2008-10-10 11:53:00 |
Message-ID: | 87k5cg3bvn.fsf@oxford.xeocode.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I'm kind of curious where the value of 4 for random_page_cost came from.
IIRC, Tom, you mentioned it came from tests you ran -- were those raw i/o
tests or Postgres cost estimates compared to execution times?
Te reason I'm wondering about this is it seems out of line with raw i/o
numbers. Typical values for consumer drives are about a sustained throughput
of 60MB/s ( Ie .2ms per 8k) and seek latency of 4ms. That gives a ratio of 20.
Server-class drives have even a ratio since a 15kRPM drive can have a
sustained bandwidth of 110-170 MB/s (48us-75us) and an average seek latency of
2ms giving a ratio of 27-42. And of course that doesn't include the effects of
a RAID array which magnifies that ratio.
I'm concerned that if we start recommending such large random_page_costs as
these it'll produce plans that are very different from what people have grown
used to. And the value of 4 seems to work well in practice.
I suspect the root of all this is that random_page_cost is encoding within it
the effects of caching. If that's true shouldn't we find a way to model
caching using effective_cache_size instead so that people can set
random_page_cost realistically based on their hardware?
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS support!
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2008-10-10 12:19:08 | Re: Block nested loop join |
Previous Message | Simon Riggs | 2008-10-10 10:47:59 | LWLockAcquire with priority |