Re: Improving N-Distinct estimation by ANALYZE
Jim C. Nasby <jnasby@pervasive.com>
From: "Jim C. Nasby" <jnasby@pervasive.com>
To: Greg Stark <gsstark@mit.edu>
Cc: Josh Berkus <josh@agliodbs.com>, tshipley@deru.com, pgsql-hackers@postgresql.org
Date: 2006-01-05T19:58:18Z
Lists: pgsql-hackers
On Thu, Jan 05, 2006 at 10:12:29AM -0500, Greg Stark wrote: > Worse, my recollection from the paper I mentioned earlier was that sampling > small percentages like 3-5% didn't get you an acceptable accuracy. Before you > got anything reliable you found you were sampling very large percentages of > the table. And note that if you have to sample anything over 10-20% you may as > well just read the whole table. Random access reads are that much slower. If I'm reading backend/commands/analyze.c right, the heap is accessed linearly, only reading blocks that get selected but reading them in heap order, which shouldn't be anywhere near as bad as random access. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461