Title: RE: count(*)

Hmmm ... everyone is throwing their ideas around ... so here is mine ...

Hopefully on this large table you have a PK.

1. First time when you do the count(*) (I hope it will be > 10 minutes), do it as follows ...

select count(*), max(pk_column)
from my ludicrously_large_table
/

Somehow, remember the max(pk_column) value.

Next time onwards do ...
select count(*), max(pk_column)
from my ludicrously_large_table
where pk_column > previously_saved_max_pk_column_value
/

Then add this count(*) plus last count(*) to get the total number.

How is that ??

Raj
______________________________________________________
Rajendra Jamadagni              MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.
QOTD: Any clod can have facts, but having an opinion is an art!

*********************************************************************This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*********************************************************************1


Reply via email to