Re: ANALYZE sampling is too good - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ANALYZE sampling is too good
Date
Msg-id 24417.1386614836@sss.pgh.pa.us
Whole thread Raw
In response to Re: ANALYZE sampling is too good  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
Josh Berkus <josh@agliodbs.com> writes:
> Reading 5% of a 200GB table is going to be considerably faster than
> reading the whole thing, if that 5% is being scanned in a way that the
> FS understands.

Really?  See the upthread point that reading one sector from each track
has just as much seek overhead as reading the whole thing.  I will grant
that if you think that reading a *contiguous* 5% of the table is good
enough, you can make it faster --- but I don't believe offhand that
you can make this better without seriously compromising the randomness
of your sample.  Too many tables are loaded roughly in time order, or
in other ways that make contiguous subsets nonrandom.

> You do seem kind of hostile to the idea of full-page-sampling, going
> pretty far beyond the "I'd need to see the math".  Why?

I'm detecting a lot of hostility to assertions unsupported by any math.
For good reason.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: ANALYZE sampling is too good
Next
From: Robert Haas
Date:
Subject: Re: Extra functionality to createuser