---
title: "Discussion on \"How to get rid of Sort Cost ?\" | Hashnode"
description: "Discussion on \"How to get rid of Sort Cost ?\". Place the name of the column you use with order by at the end of the index.\n\nQuery :\nselect ExceptionMessage, CreateDate from TableName\nwhere MethodName = 'ERROR'\norder by TerminalNo\n\nFirst index :\nCREATE NONCLUSTERED INDEX [IX_TableName_MethodName] ..."
url: "https://hashnode.com/posts/how-to-get-rid-of-sort-cost/63526f27552f4a9fc3fad082"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to get rid of Sort Cost ?](https://karatas.dev/how-to-get-rid-of-sort-cost?utm_source=hashnode&utm_medium=feed)

Place the name of the column you use with order by at the end of the index. Query : select ExceptionMessage, CreateDate from TableName where MethodName = 'ERROR' order by TerminalNo First index : CREATE NONCLUSTERED INDEX \[IX\_TableName\_MethodName\] ...

Oct 21, 2022 · 1 min read · karatas.dev  
Updated Apr 15, 2024  
Read the article

-   [#query-tuning](https://hashnode.com/tag/query-tuning)
-   [#sql](https://hashnode.com/tag/sql)

## Written by

[Ferhat Karataş](https://hashnode.com/@karatas)

@karatas · Turkey

  
[View profile](https://hashnode.com/@karatas)

Software Developer

Performance freak

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
