Thread: Determining random_page_cost value
I talked with neilc in #postgresql about a tool that may help in determining a suitable rpc value. If rpc is just ratio of random cost vs. sequential cost, then I can write such a tool. So I did. The tool takes a directory and do sequential read on all the files there, followed by exhaustive (each block is read) random read on each file. There is also an option to clear up buffers between runs. I then ran it on various database size on a software 2 7200RPM IDE RAID-1 volume. I found out that if the dbase size (as from du <dbase_dir>) is less than about 500M, I got a ratio of 4.5:1. On a larger dbase, 3GB, the ratio increases to 10:1. This tells me that the ratio needs to be qualified further: access over what size of dbase? access over the disk volume instead? what other hidden variables? The full code is at http://rafb.net/paste/results/peLyIX45.html Thanks, Gnome.
Yohanes Santoso wrote: >I then ran it on various database size on a software 2 7200RPM IDE >RAID-1 volume. I found out that if the dbase size (as from du ><dbase_dir>) is less than about 500M, I got a ratio of 4.5:1. On a >larger dbase, 3GB, the ratio increases to 10:1. > > > Surely this is going to be a function of table size, not database size, isn't it? Did you scale up the size of tables to get your 3Gb database? cheers andrew