特將結果分享如下 :
Sybase :
select O.name,rowcnt(I.doampg) RecCnt from sysobjects O,sysindexes I
where I.id=O.id and I.indid=1 and O.type='U'
MSSQL :
select O.name,I.rowcnt from sysobjects O,sysindexes I
where I.id=O.id and I.indid=1 and O.type='U'
A. Compute statistics collection :
1. use table characterics :
create table with 'monitoring' option. and using PL/SQL
"analyze table [TableName] compute statistics;
2. use dbms_stats packages :
EXECUTE dbms_stats.gather_schema_stats (user);
EXECUTE dbms_stats.gather_table_stats (user,'[TableName]');
B. Get Number of rows from all_tables view.