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 9236925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:25:00+00:00 2026-06-18T07:25:00+00:00

I can understand how the sort order on a column in an index might

  • 0

I can understand how the sort order on a column in an index might make a difference if there was more than one column, but if there is only one column in the index is ascending just as good as descending?

It seems like it could just start at the end instead of the beginning if the index was sorted the wrong way.

Is there something I’m missing?

  • 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-06-18T07:25:02+00:00Added an answer on June 18, 2026 at 7:25 am

    The sort order of the column in the index should not make a difference. However, there may be cases where there is a subtle difference.

    There are different ways to implement indexes in different databases. However, they are typically tree-based data structures with the leaves containing the ordered values and “addresses” of the records where the value occurs.

    Two indexes that are identical, except for the ordering of their children, will have the same performance. For equality comparisons, the process works by walking down the tree to find the value. Because the indexes are identical, two versions have an equivalent path.

    Non-equality (“<” and “>”) comparisons work essentially the same way, by first finding the threshold value and then scanning the index forward or backward from there.

    So, the question is: would two indexes be created “identically” for ascending and descending values? This is where it gets complicated. For all practical purposes, I believe the indexes would be pretty equivalent. However, there may be some cases with a b-tree, for instance, where the splits would not be identical. This occurs due to asymmetries that arise in the tree.

    For example, on the Wikipedia page describing b-trees, scroll down to the example from Knuth. At the step where “4” is inserted there is an asymmetry. The nodes are (1),(2),(3,4). With the opposite sort order, the nodes would be (4),(3),(1,2).

    In the end, the indexes would probably be functionally equivalent. However, asymmetries could arise that would affect the depth of some of the leaves.

    By the way, when I started thinking about this answer, I thought the correct answer was that the indexes would be identical. After thinking about it, that seems not to be the case.

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

Sidebar

Related Questions

I can understand the difference between a signed char and an unsigned one. But
I'm trying to create small application on Yii framework but can't understand one moment.
I can understand the string.Join( ) var stringies1 =new [] {Blood, is, Thicker, Than,
Can someone please explain with example that I can understand about the difference between
So far I can understand HTML.ActionLink and URL.RouteURL but still trying to absorb where
For reasons that only the developers can understand, Firefox will create and open .url
This might be trivial, but I don't understand why the default implementation of Selection
I can understand binary operation 11 & x , for example if x =
As you can understand from title, i modified Settings.cs file.Added some properties, some code
OK so now I can understand that SO's search system is primarily based around

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.