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 running
SELECT 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?
View Complete Post