Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: count(*) - sample block
Andy Hassall wrote:
> On 8 Dec 2006 13:43:33 -0800, "prateek" <hkprateek_at_gmail.com> wrote:
>
>> I am curious to know why this query: >> >> "select count(*) from far_employee sample block (1);" >> >> returns zero at times and some other times returns a non zero number. >> Table: far_employee is populated with more than 400K records.
You may be correct ... but it seems unlikely. If sampling is a percentage ... then 1% should sample 1% of the blocks. I have a table I ran some tests on with 1056 blocks created with CREATE TABLE AS ... and SAMPLE BLOCK(1) consistently returns zero. Seems unlikely with a CTAS just as it seems unlikely that 10 blocks (1%) are unpopulated. I could get in their with DBMS_ROWID and find out for sure but it is Friday ... and I'm heading for a glass of scotch.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Fri Dec 08 2006 - 16:58:28 CST