Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Index on sort column

I have Int type Sort column where I enter numbers to set records sort order. Do I need to index such columns for better performance?

like image 427
Tomas Avatar asked Feb 24 '23 05:02

Tomas


1 Answers

If you want to use this column in your SELECT statement, especially in WHERE, ORDER BY, GROUP BY, TOP and DISTINCT clause - you need to index this field. Please read this article http://www.sql-server-performance.com/2007/optimizing-indexes-general/ to read more about indexes and perfromance.

like image 103
Alex_L Avatar answered Mar 29 '23 11:03

Alex_L