Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4021036
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:18:08+00:00 2026-05-20T10:18:08+00:00

We have a table form which we would like to select data in both

  • 0

We have a table form which we would like to select data in both accending and decending order.

Do we need to create 2 indices?

How would SQL Server process a request for all rows in decending order if there was only an accending clustered index?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:18:09+00:00Added an answer on May 20, 2026 at 10:18 am

    Short-Answer : No. If this is only for one column, then the same index should be usable in both cases. As for traversing, since indexes are doubly-linked lists, they can be traversed in either order.

    http://msdn.microsoft.com/en-us/library/aa933132%28SQL.80%29.aspx

    Other Details…

    If you have a (say..ascending) index on emp_name, then both the queries below should be able to make use of it without aditional sorting.

    select x,y,z,a,b,c,emp_name from <table_name> 
    order by emp_name desc;
    
    select x,y,z,a,b,c,emp_name from <table_name> 
    order by emp_name asc;
    

    The problem is when the query references more than one column and the order by for these two is in different order.

    select x,y,z,a,b,c,emp_name from <tabble_name
    order by emp_name asc, a desc.
    

    In this case, if you use the desc clause when creating the index, an additional sort can be avoided.

    Check this link. It is spcific to Oracle, but I believe SQL Server works pretty much the same way.

    http://forums.oracle.com/forums/thread.jspa?messageID=4061884

    Another useful link :

    http://www.mssqltips.com/tip.asp?tip=1337

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table of the form CREATE TABLE data { pk INT PRIMARY
I have 2 tables which in simplified form look like this: Products( id: int,
I use a form where i have listed the data from database like title,
I have a table for a contact form and this table contains another table
I have a table with multiple rows. Each row is a form. I want
I have a form that searches all rows in a single table (TServices) that
I have a small form inside a table. POSTing that form creates a new
I have two functions to add and remove table rows that contain a form
I have table with 50 entries (users with such details like Name Surname Location
I have Table1 and Table2 in the form of IEnumerable<DataRow> . Both the tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.