Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: count(*) - sample block
prateek wrote:
> Hi,
> 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.
>
> Thanks,
> Prateek
A bug comes to mind rather quickly after running some tests in the lab. I especially like this result (10.2.0.2):
SQL> SELECT COUNT(*)
2 FROM airplanes
3 SAMPLE BLOCK (100);
SAMPLE BLOCK (100)
*
Apparently 100 <> 100. <g>
SQL> SELECT COUNT(*)
2 FROM airplanes
3 SAMPLE BLOCK (99.999999);
COUNT(*)
250000
But it does get it right if you hedge.
-- 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:50:25 CST