Re: Script to compute random page cost

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Script to compute random page cost
Date: 2002-09-10 10:47:53
Message-ID: 1031654873.25060.508.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2002-09-09 at 07:13, Bruce Momjian wrote:
>
> OK, turns out that the loop for sequential scan ran fewer times and was
> skewing the numbers. I have a new version at:
>
> ftp://candle.pha.pa.us/pub/postgresql/randcost

Latest version:

olly(at)linda$
random test: 14
sequential test: 11
null timing test: 9
random_page_cost = 2.500000

olly(at)linda$ for a in 1 2 3 4 5
> do
> ~/randcost
> done
Collecting sizing information ...
random test: 11
sequential test: 11
null timing test: 9
random_page_cost = 1.000000

random test: 11
sequential test: 10
null timing test: 9
random_page_cost = 2.000000

random test: 11
sequential test: 11
null timing test: 9
random_page_cost = 1.000000

random test: 11
sequential test: 10
null timing test: 9
random_page_cost = 2.000000

random test: 10
sequential test: 10
null timing test: 10
Sequential time equals null time. Increase TESTCYCLES and rerun.

Available memory (512M) exceeds the total database size, so sequential
and random are almost the same for the second and subsequent runs.

Since, in production, I would hope to have all active tables permanently
in RAM, would there be a case for my using a page cost of 1 on the
assumption that no disk reads would be needed?

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Draw near to God and he will draw near to you.
Cleanse your hands, you sinners; and purify your
hearts, you double minded." James 4:8

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Elphick 2002-09-10 11:18:36 Re:
Previous Message Mark Kirkwood 2002-09-10 10:33:19 Re: Script to compute random page cost