Including IDENTITY columns in nonunique indexes  Using fillfactor, max_rows_per_page, and reservepagegap

Chapter 12: Creating Indexes on Tables

Ascending and descending index-column values

You can use the asc (ascending) and desc (descending) keywords to assign a sort order to each column in an index. By default, sort order is ascending.

Creating indexes so that columns are in the same order specified in the order by clauses of queries eliminates sorting the columns during query processing. The following example creates an index on the Orders table. The index has two columns, the first is customer_ID, in ascending order, the second is date, in descending order, so that the most recent orders are listed first:

create index nonclustered cust_order_date
     on Orders
     (customer_ID asc,
     date desc)




Copyright © 2005. Sybase Inc. All rights reserved. Using fillfactor, max_rows_per_page, and reservepagegap

View this book as PDF