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

Home -> Community -> Usenet -> c.d.o.misc -> Can someone please straighten me out on the COUNT function?

Can someone please straighten me out on the COUNT function?

From: <tmcguiga_at_my-dejanews.com>
Date: Tue, 12 Jan 1999 11:19:40 GMT
Message-ID: <77fb4c$jn0$1@nnrp1.dejanews.com>


I've read such conflicting posts such as --

(a) "Count (*) is also quicker because it does not need to query
 the underlying data to determine whether to include the value  or not"

(b) "For better performance, Count(*) should not be used because the
 Oracle must first resolve all column names in the table which is a  step that may not be required if ur just counting rows. Generally  select count(indexed column) and select count(rowid) are faster."

So no wonder I've no solid understanding of it! What I'd like to know is --

  1. What does COUNT(*) do and have Oracle optimised it?
  2. Which is better for counting rows --
  3. COUNT(*)
  4. COUNT(1)
  5. COUNT(rowid) or
  6. COUNT(<indexed column>) ?
  7. What part do NULLable columns play in all this?

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Jan 12 1999 - 05:19:40 CST

Original text of this message

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