Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Query on a very, very large table
If the table has a declared PK constraint then the rdbms can scan the
index rather than the table and return the count fairly quickly. In
the absence of a declared PK, unique and non-unique indexes on not null
columns can also often be used by the rdbms.
Is there a good way of counting the number of rows in a table ? http://www.jlcomp.demon.co.uk/faq/count_rows.html
This might allow the time necessary for a select count fall within reason for your use.
HTH -- Mark D Powell -- Received on Tue Apr 11 2006 - 11:13:18 CDT