Estimating seq_page_fetch and random_page_fetch

From: "Umar Farooq Minhas" <umarfm13(at)hotmail(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Cc: "Umar Farooq Minhas" <umarfm13(at)hotmail(dot)com>
Subject: Estimating seq_page_fetch and random_page_fetch
Date: 2007-03-06 17:06:34
Message-ID: BAY104-DAV12E7EAE10BFCB1A911A171CD7B0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2007-03-06 17:10:17 Re: GIST and TOAST
Previous Message Chris Browne 2007-03-06 17:01:02 Re: Auto creation of Partitions