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

  • From: Thomas Day <tday6@xxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 8 Jul 2004 10:23:52 -0400

    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@xxxxxxxxxxxxx>                                                       
                      @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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: