Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select count(*) in Oracle and MySQL
Occidental wrote:
> I have a table with about 250M rows, implemented in both Oracle and
> MySQL.
> Select count(*) in MySQL is effectively instantaneous, presumably
> because it accesses some internal count that is maintained by the
> DBMS. The same query in Oracle takes about 6 minutes, pretty obviously
> becasue it counts rows. The Oracle table should have been set up with
> a primary key, but wasn't. The MySQL table has no primary key either.
> Any comments?
>
Completely different implementations. One keeps a count in some kind of header
for the table, the other doesn't.
It's use raises the issues that were already mentioned and the solution for
them is the same as for any other concurrency issue.
This is nice if you don't know the tables and want to have an idea of them...
Regards.
-- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently...Received on Wed Sep 19 2007 - 16:24:58 CDT