SAMPLE BLOCK in select
What is the implication of the SAMPLE BLOCK(1) in the following query?
SELECT COUNT(*) from TABLE_A SAMPLE BLOCK(1)
I assumed that this would return all of the rows in the first block of the TABLE_A data segment, but the number of rows that is being returned is over 100,000 and with a 16K block size I can hardly believe that there are that many rows in one block.
if I rememebr right it tells how more or less how many rows are there, it estimates number of rows per block then multiply by the total number of blocks
this is the definition
The sample_clause lets you instruct Oracle to select from a random sample of rows from the table, rather than from the entire table.
BLOCK instructs Oracle to perform random block sampling instead of random row sampling.
See Also: Oracle8i Concepts for a discussion of the difference
sample_percent is a number specifying the percentage of the total row or block count to be included in the sample. The value must be in the range .000001 to (but not including) 100.
Click Here to Expand Forum to Full Width