Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Portable DBA: Oracle
If you trace that further with a 10046 level 8 trace you'll find that
while "sample (51.0)" looks like it does a 50% sample, that means 50% of
the rows are sampled which means that practically 100% of the blocks are
read, which is generally what you really are interested in from a
performance point of view - which is why you chose estimate_percent=>50
over NULL in the first place. You didn't really save anything. Probably
on the contrary because with a full compute Oracle can just do a full
table scan which is more efficient than a 50% sample which ends up
reading 100% of the blocks.
It gets even worse. Practically, any estimate_percent over ~ 1% is
likely going to read almost 100% of the blocks. I guess the actual
threshold would be somewhere around 100*(1/rows_per_block)%
Of course as always it depends. Here on the # of rows per block. If you
have only 1 row/block then a row sample is effectively the same as a
block sample. But I haven't tested what the actual effect on number of
blocks read is.
Niall Litchfield wrote:
> On Thu, 9 Dec 2004 09:44:25 -0600, Jesse, Rich
> <Rich.Jesse_at_quadtechworld.com> wrote:
>
>>Without looking, doesn't estimate_percent >50 cause a compute? I remember it did on ANALYZE, but I don't remember with DBMS_STATS...
-- Regards Wolfgang Breitling Centrex Consulting Corporation www.centrexcc.com -- http://www.freelists.org/webpage/oracle-lReceived on Thu Dec 09 2004 - 11:28:36 CST
![]() |
![]() |