Skip to content

Commit c1d9df4

Browse files
committed
Document random page cost is only 4x seqeuntial, and not 40x.
1 parent ef7a7c8 commit c1d9df4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/src/sgml/config.sgml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,6 +2604,26 @@ SET ENABLE_SEQSCAN TO OFF;
26042604
parameters.
26052605
</para>
26062606

2607+
<para>
2608+
Random access to mechanical disk storage is normally much more expensive
2609+
than four-times sequential access. However, a lower default is used
2610+
(4.0) because the majority of random accesses to disk, such as indexed
2611+
reads, are assumed to be in cache. The default value can be thought of
2612+
as modeling random access as 40 times slower than sequential, while
2613+
expecting 90% of random reads to be cached.
2614+
</para>
2615+
2616+
<para>
2617+
If you believe a 90% cache rate is an incorrect assumption
2618+
for your workload, you can increase random_page_cost to better
2619+
reflect the true cost of random storage reads. Correspondingly,
2620+
if your data is likely to be completely in cache, such as when
2621+
the database is smaller than the total server memory, decreasing
2622+
random_page_cost can be appropriate. Storage that has a low random
2623+
read cost relative to sequential, e.g. solid-state drives, might
2624+
also be better modeled with a lower value for random_page_cost.
2625+
</para>
2626+
26072627
<tip>
26082628
<para>
26092629
Although the system will let you set <varname>random_page_cost</> to

0 commit comments

Comments
 (0)