Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Select count(*) in Oracle and MySQL

Re: Select count(*) in Oracle and MySQL

From: joel garry <joel-garry_at_home.com>
Date: Wed, 19 Sep 2007 17:57:35 -0700
Message-ID: <1190249855.962896.70900@v29g2000prd.googlegroups.com>


On Sep 19, 12:54 pm, Occidental <Occiden..._at_comcast.net> wrote:

>

> I need the count(*) because I want to know how many rows there are in
> the table.
> I am not, as the other contributor to the thread implied, trying to
> compare Oracle to MySQL, I am simply interested in determining whether
> the long runtime of the Oracle query is normal or reflects some error
> in the installation. If MySQL can do it, why not the Oracle? It seems
> rather absurd that a Database Management System does not know at any
> given time how many rows there are in the tables it "manages".

The system does not need to know. You need to know. There may be many "yous," each with a different view of what is current in the table.

The read and transaction consistency others have mentioned refers to the way you ask Oracle to count the rows. For example, lets say you start a session and ask for a count of the rows at exactly 8:00 AM. You aren't the first person in, some other person is in the middle of adding a bunch of rows. That person could have started at 7:59 AM. Do you want to count the rows they added? What if they rollback and never add them?

Actually there is an SCN number, not really the time.

jg

--
@home.com is bogus.
http://www.dailymail.co.uk/pages/live/articles/technology/technology.html?in_article_id=482560&in_page_id=1965
Received on Wed Sep 19 2007 - 19:57:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US