Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

SQL Server - Creating Index in descending order by specifying "DESC" option

Jul 13 2011 12:42AM by Robert Dennyson   

Suppose, if most of your queries requires a column to be in descendig order, You can create the index with the values of the column in descending order. While creating index, You just need to specify DESC option. By default the index keys will be stored in ascending order.

Create index idx_CustomerIDdesc on Sales.Customer(CustomerID desc)
Read More..   [0 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Robert Dennyson
11 · 14% · 4419
3
 
3
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

1  Comments  

  • If I recall correctly, Itzik Ben-Gan suggested part of the index on the date in DESC order in this article

    http://www.windowsitpro.com/article/departments/Optimizing-TOP-N-Per-Group-Queries.aspx

    Quote from this article:

    Regardless of the solution you use, if you can afford to create optimal indexing, the best approach is to create an index on the partitioning column (e.g., custid, if you need top rows per customer), plus the ordering columns as the keys (orderdate DESC, orderid DESC), and include in the index definition all the other attributes you need to return from the query (e.g., filler). As I mentioned, I’ll use custid as the partitioning column to demonstrate queries with low density and shipperid for high density.

    commented on Jul 12 2011 7:34PM
    Naomi
    33 · 6% · 1774

Your Comment


Sign Up or Login to post a comment.

"SQL Server - Creating Index in descending order by specifying "DESC" option " rated 5 out of 5 by 3 readers
SQL Server - Creating Index in descending order by specifying "DESC" option , 5.0 out of 5 based on 3 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]