---
title: "Why can a \"group by\" or \"order by\" clause be expensive to process"  
description: "Why can a \"group by\" or \"order by\" clause be expensive to process"  
author: "Pushpendra Singh"  
published: 2010-10-25  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/94/why-can-a-group-by-or-order-by-clause-be-expensive-to-process  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# Why can a "group by" or "order by" clause be expensive to process

Processing of "group by" or "order by" clause often requires creation of Temporary tables to process the results of the query. Which depending of the result set can be very expensive.

## Answers

### Answer by Pushpendra Singh

Processing of "group by" or "order by" clause often requires creation of Temporary tables to process the results of the query. Which depending of the result set can be very expensive.


---

Original Source: https://www.mindstick.com/interview/94/why-can-a-group-by-or-order-by-clause-be-expensive-to-process

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
