home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 618 of 2,288   
   Frank to Daniel Roy   
   Re: count (1) and count (*)   
   31 Oct 03 09:30:03   
   
   From: fvanbortel@netscape.net   
      
   Daniel Roy wrote:   
   > I read somewhere (asktom?) that "select count(1) from table" is   
   > internally rewritten as "select count(*) from (select 1 from table)",   
   > and therefore just adds some overhead.   
   >   
   > Daniel   
   >   
   > gelangov@hotmail.com (Geetha) wrote in message news:<4b40e20a.   
   310290724.13e86079@posting.google.com>...   
   >   
   >>I searched in the Oracle documents what count (1) meant and I could   
   >>not find an answer.  Can some one explain what Oracle does internally   
   >>when use count (1) VS count (*).  Thank you very much in advance! We   
   >>use Oracle 9i.   
      
   NO!   
   Actually Tom wrote:   
   "Prove it, give me that test case.  You are wrong.   
   COUNT(*) and COUNT(1) are the *same* -- the same -- the same -- no   
   different, the same.   
   count(1) is internally optimized to count(*) "   
      
   And he posted the explain plans for count(*) and count(1).   
      
   --   
   Regards, Frank van Bortel   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca