There are two main types of indexes: clustering and nonclustering.
The clustering index determines the physical order of the rows in the table. Inserting the table into the table (or updating the corresponding field) forces the database engine to reorder the data, so the field with the clustering index on it is sorted correctly. Therefore, in any table there can be only one clustering index.
Nonclustered indexes are copies of columns ordered as they wish. They exist separately, and the physical order of the lines is not related to them. Therefore, there can be as many non-clustering indexes as you want.
Most often, a simple selection in one table returns rows in physical order, so it would not be surprising to get them sorted by clustering index.
However, this is not guaranteed, and you should not rely on it. Always include the ORDER BY clause if the order of the result set is of any concern.
If you order by the clustering index, there is not much work for the database engine, but your intentions are clear.
If you order with a non-clustered index, the database requires a little more work, but (depending on the size of the table and data type) it will be an order of magnitude faster than ordering a completely non-indexed field.
source share