Estimating seq_page_fetch and random_page_fetch - Mailing list pgsql-hackers

From Umar Farooq Minhas
Subject Estimating seq_page_fetch and random_page_fetch
Date
Msg-id BAY104-DAV12E7EAE10BFCB1A911A171CD7B0@phx.gbl
Whole thread Raw
Responses Re: Estimating seq_page_fetch and random_page_fetch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,
 
How can we accrately estimate the "seq_page_fetch" and "random_page_fetch" costs from outside the postgres using for example a C routine. Using a very simple program in C, I have two sets of files. I want to access one set randomly i.e. pulling data from random locations within the files. The second set of files is accessed sequentially. The goal here is to approximate the disk I/O cost for a "random page fetch" and a "sequential page fetch" respectively. I am using low-level(unbuffered) C routines i.e. read/write and lseek ( for positioning file pointer), the read/write buffer size is 8k (to match the size of postgres page), and Linux is the host OS. We all know that linux is a heavily cached OS, for that very reason I am using sets of files instead of a single file, in a hope that whenever a new file from a set of files is accessed for the first time, it will NOT be in the OS cache, thus giving accurate results of actually fetching the file pages from the physical disk. And also the host is restarted before running the experiment so as to force a cold-cache start.
 
I am hoping somebody could point me in the right direction.
 
Thanks
 
-Umar

pgsql-hackers by date:

Previous
From: Тимчишин Виталий
Date:
Subject: Re: [JDBC] Plan invalidation vs. unnamed prepared statements
Next
From: "Abrie"
Date:
Subject: