|
-
DBA_TABLES reflects the row counts as of the last time the table was analyzed. Issuing a select count(*) from tabxyz will give you the exact number of rows in the table. For example:
SQL> create table xyz (x char(10), y char(10), z char(10));
Table created.
SQL> insert into xyz values ('x','y','z');
1 row created.
SQL> insert into xyz values ('x','y','z');
1 row created.
SQL> insert into xyz values ('x','y','z');
1 row created.
SQL> insert into xyz values ('x','y','z');
1 row created.
SQL> analyze table xyz compute statistics;
Table analyzed.
SQL> select table_name, num_rows from user_tables;
TABLE_NAME NUM_ROWS
------------------------------ ----------
XYZ 4
SQL> insert into xyz values ('x','y','z');
1 row created.
SQL> insert into xyz values ('x','y','z');
1 row created.
SQL> insert into xyz values ('x','y','z');
1 row created.
SQL> insert into xyz values ('x','y','z');
1 row created.
SQL> commit;
Commit complete.
SQL> select count(*) from xyz;
COUNT(*)
----------
8
SQL> select table_name, num_rows from user_tables;
TABLE_NAME NUM_ROWS
------------------------------ ----------
XYZ 4
SQL> analyze table xyz compute statistics;
Table analyzed.
SQL> select table_name, num_rows from user_tables;
TABLE_NAME NUM_ROWS
------------------------------ ----------
XYZ 8
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|