Why can a "group by" or "order by" clause be expensive to process?

Questions by Beena   answers by Beena

Showing Answers 1 - 3 of 3 Answers

Abhijit Dutta

  • Nov 6th, 2005
 

The site is simply great.

  Was this answer useful?  Yes

Shehzad

  • Aug 22nd, 2006
 

Group by class will have to group all the data returing from the query in our specifed groups... so it is definitly an overhead from execution point of view... imagine that the number of rows returned by the query are in millions and you have to group the data. its pretty much the same as if you are asked to line up the excactly matching cars in a lot of cars in a parking lot n it will definitly take you time to figure out the exactly matching cars and then park them accordingly.

Group by: It clubs all the similar rows and display only the distinct data so here clubing and displaying distinct data is an overhead.

Order by: It sorts the data either in ascending order or in desending order as specified in the query.  Sorting the data is an overhead.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions