Re: Clustering factor smaller than table blocks.

  • From: "Alberto Dell'Era" <alberto.dellera@xxxxxxxxx>
  • To: jonathan@xxxxxxxxxxxxxxxxxx
  • Date: Wed, 27 Sep 2006 13:09:02 +0200

On 9/27/06, Jonathan Lewis <jonathan@xxxxxxxxxxxxxxxxxx> wrote:

The rather more surprising thing about your example
is that you have done a compute, so the results should
be accurate, but you have  36,364 rows in the table
and only 36,112 entries in what we guess is the primary
key index.  Do you have a corrupt index perhaps ?

There could be a simpler explanation - if the statistics are computed while the table is being modified, the table and index stats could be not consistent, even when using cascade in the same dbms_stats statement.


dellera@ORACLE10> create table t (pk  constraint t_pk primary key) as
 2  select rownum from dual connect by level <= 1000000;

Table created.

dellera@ORACLE10> insert into t(pk) values (-1);

1 row created.

dellera@ORACLE10> commit;

Commit complete.

Immediately before the insert, I started the stats collection,
that ended some minutes after:

dellera@ORACLE10> exec dbms_stats.gather_table_stats (user, 't',
cascade=>true, estimate_percent=>100);

PL/SQL procedure successfully completed.


dellera@ORACLE10> select table_name, num_rows from user_tables where
table_name = 'T';

-------------------- ----------
T                       1000000

dellera@ORACLE10> select index_name, num_rows from user_indexes  where
table_name = 'T';

-------------------- ----------
T_PK                    1000001


Alberto Dell'Era
"Per aspera ad astra"

Other related posts: