Re: Improving N-Distinct estimation by ANALYZE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, josh(at)agliodbs(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Improving N-Distinct estimation by ANALYZE
Date: 2006-01-06 18:08:00
Message-ID: 25000.1136570880@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> Before we start debating merits of proposals based on random reads, can
> someone confirm that the sampling code actually does read randomly?

Well, it's not so much that it's not "random", as that it's not
sequential --- it skips blocks, and therefore you'd expect that
kernel-level read-ahead would not kick in, or at least not be very
effective.

If there weren't much else going on, you could still assume that
you'd be paying less seek cost than in a genuinely random-order
fetching of the same number of blocks.

Not sure how these effects would add up. I agree that some
investigation would be wise before making any claims about how
expensive the current method actually is.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2006-01-06 18:42:09 Re: [HACKERS] Inconsistent syntax in GRANT
Previous Message Tom Lane 2006-01-06 18:01:37 Re: [HACKERS] Inconsistent syntax in GRANT