Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kkiranvr
Yak Posting Veteran
54 Posts |
Posted - 2010-08-27 : 19:12:14
|
Hi all, I am using the select statement with MAX(id), MIN(id), COUNT(*) of a very big table and it is returning me the value in less than a second. But surprisingly if i am using aggregate function MIN(id) in a seperate select statement it is taking upto 90 Seconds. Here are the 2 statements I am runningSELECT MAX(ID),MIN(ID),COUNT(*) FROM A TABLE-- Time consuming for this: less than a Second. SELECT MIN(ID)FROM A TABLE-- Time consuming for this: Upto 90 Seconds. Please clarify how it work internally when we call the select statement with Aggregate functions? -Thanks N Regards,Chinna. |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-08-27 : 20:05:37
|
is ID indexed? i'll look for blocking 1st |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-08-28 : 01:06:43
|
are both statements fired on same table?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|