The fastest way to stat the record count of a huge
A Oracle Database,about 1,000,000 records. <BR>How to use the fastest way to stat record count? <BR> <BR>I have use "seclect count(*) from Table_01",but it is very <BR>slow!any way faster? <BR> <BR>Thank you! <BR>
Get it once and put it in a table. Then increment it and decrement it with triggers. On delete decrement, on insert increment. There may be other ways of course...<BR><BR>Hmmm. If its going too slow getting the count I imagine that doing a normal query would be even worse.. 1,000,000 records is alot but I though oracle was supposed to be able to handle that. Maybe it needs an upgrade or its something else. Getting the count is fairly easy for a db even with alot of records.
First off, I wouldn't do select count(*), I would speed things up by doing a select count(<YOUR ID FIELD>) from Table_01. Your ID field should be indexed and that would help greatly in speeding things up.