Open Question
Which one is faster count(*) or count(1) ?
  (Time Left: 0 days 0 hours)
  asked by: fatjp  on: Apr 14, 2009  
Answers ( 4 )

I've always believed count(1) was faster as it doesn't have to return all columns just the row identity. But logically speaking the optimiser should take care of that so they should translate into the same underlying code

  12kissmi   answered on:Apr 16, 2009  0 comments


count (1) is faster than count(*) because count(*) returns all the rows as given in the select stmt including duplicate and null values while count(1) or count(expr) will return all non-null values in column 1.

  d4rkne5s   answered on:Apr 17, 2009  0 comments


count(1) will be faster than count(*) because it counts the first column values with not null

  b0n3less   answered on:Apr 18, 2009  0 comments


count(1) is faster than count(*)

  jasa   answered on:Apr 19, 2009  0 comments

 
Answer this Question:  Maximum Lenght of Answer:10000

 

Hot Questions

Contact Us - IT-Interview