-
Counting records in a table
How do I count records in a table without doing count(*). This particular table may have in excess of 100 million rows. Is there a quicker way of counting, than count(*)? Thanks.
-
How accurate does your count have to be? If you analyze on a regular basis, you can:
Code:
select num_rows from user_Tables where table_name = 'MYTAB';
Jeff Hunter
-
Assuming you are not using any where criteria for count, If you have analyzed the statitics for the table recently it should show up in the USER_TABLES view as 'NUM_ROWS'
Reddy,Sam
-
Sometime it's forbidden to analyze even with compute statistics
because of tuning raison for exemple.
Or because of your statistics is very old.
So try to use your indexes.
Most of time, if you have a big table there is at least 1
indexe to speed up queries
So query via your index where there is a column with
unique or not null constraint
hope that help you
yt
-
Export the table, see how many rows are being exported. (of course > /dev/null)
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
|