Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> analyze vs dbms_stats
I'm trying to get our shop to convert from analyze to dbms_stats.
I'm running into some "strange" results though and wanted to see if I'm
missing something or you have some advice.
analyze command:
ESTIMATE STATISTICS SAMPLE 30
PERCENT
FOR TABLE FOR ALL INDEXES FOR ALL INDEXED COLUMNS SIZE 254
dbms_stats code I'm running:
exec DBMS_STATS.GATHER_TABLE_STATS ( -
ownname => 'STATION_TEST', - tabname => 'MEMBERS', - partname => NULL, -
degree => 0, - granularity => 'DEFAULT', - cascade => TRUE, - stattab => NULL, - statid => NULL, - statown => NULL, -
sample of stats info from analyze:
Table STATION_TEST.MEMBERS
- Number of rows : 14284780 - Number of blocks : 1623961 - Average row length : 192
Column RESTRICTION_CODE
Column DAY_PHONE
Column EVE_PHONE
Column ISP_ID
sample of dbms stats generated statistics: Table STATION_TEST.MEMBERS
- Number of rows : 14283597 - Number of blocks : 1623961 - Average row length : 193
Column RESTRICTION_CODE
Column DAY_PHONE
Column EVE_PHONE
Column ISP_ID
Column USER_ID (NOT NULL)
As it turns out analyze in this test is far more accurate. For instance
eve_phone actually has 66 distinct values.
Any ideas on the disparity? I am going to try compute, but apples to
apples reflect a big diff...
Thanks
- David
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Fri Jun 25 2004 - 11:33:53 CDT
![]() |
![]() |