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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Difference between count(1) and count(*)

RE: Difference between count(1) and count(*)

From: Thomas Day <tday6_at_csc.com>
Date: Thu, 8 Jul 2004 10:23:52 -0400
Message-ID: <OFD4175376.96BC5972-ON85256ECB.004EB5C7@csc.com>

    230297 rows in every case

Row Count using all columns                     Elapsed: 00:00:02.06
Row Count using a specific numbered column            Elapsed: 00:00:02.06
Row Count using the pseudo-column rownum        Elapsed: 00:00:02.08
Row Count using the ROWID column                Elapsed: 00:00:02.07
Counting a Not-NULL column                      Elapsed: 00:00:02.07
Counting a NULL column                    Elapsed: 00:00:02.06

Doesn't look like a lot of difference to me but maybe the sample is small.

                                                                                                                                       
                      "Peter Miller"                                                                                                   
                      <Peter.Miller            To:      <oracle-l_at_freelists.org>                                                       
                      @cogent-dsn.com>         cc:                                                                                     
                      Sent by:                 Subject: RE: Difference between count(1) and count(*)                                   
                      oracle-l-bounce                                                                                                  
                                                                                                                                       
                                                                                                                                       
                      07/08/2004 09:40                                                                                                 
                      AM                                                                                                               
                      Please respond                                                                                                   
                      to oracle-l                                                                                                      
                                                                                                                                       
                                                                                                                                       




1,749,951 rows returned in every case

count(rowid) - approx 3.2 secs
count(obj#)  - approx 3.5 secs
count(1)     - approx 3.6 secs
count(*)     - approx 3.6 secs
count(rownum)- approx 4.6 secs
count(source)- approx 8.6 secs








----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Thu Jul 08 2004 - 10:16:28 CDT

Original text of this message

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