Re: [PoC] pgstattuple2: block sampling to reduce physical read

From: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
To: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Cc: Satoshi Nagayasu <snaga(at)uptime(dot)jp>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Greg Smith <greg(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PoC] pgstattuple2: block sampling to reduce physical read
Date: 2013-10-11 05:02:43
Message-ID: 52578673.5010800@catalyst.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/10/13 17:33, Jaime Casanova wrote:
> On Thu, Oct 10, 2013 at 5:32 PM, Mark Kirkwood
> <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz> wrote:
>> Quietly replying to myself - looking at the code the sampler does 3000
>> random page reads...
> FWIW, something that bothers me is that there is 3000 random page
> reads... i mean, why 3000? how do you get that number as absolute for
> good accuracy in every relation? why not a percentage, maybe an
> argument to the function?

Right,

Looking at http://en.wikipedia.org/wiki/Sample_size_determination maybe
it is not such a bad setting - tho 400 or 1000 seem to be good magic
numbers too (if we are gonna punt on single number that is).

Perhaps it should reuse (some of) the code from acquire_sample_rows in
src/commands/analyze.c (we can't use exactly the same logic, as we need
to keep block data together in this case).

Cheers

Mark

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2013-10-11 05:14:04 Re: space reserved for WAL record does not match what was written: panic on windows
Previous Message Amit Kapila 2013-10-11 04:49:38 Re: Patch: FORCE_NULL option for copy COPY in CSV mode