How to create B+ tree index Microsoft SQL

Kim, Changjae 26 Reputation points
2021-11-09T08:58:52.117+00:00

Hi,

I am a user of Microsoft SQL and as I conduct my class project, I I got a question about indexing.
Could I use B+tree index in Microsoft SQL server and how can I find the relevant options?
I reviewed manuals and descriptions several times but I could not see anything relevant to my question.
Hope to get corresponding responses soon

Azure SQL Database
Developer technologies Transact-SQL
SQL Server Other
{count} votes

3 answers

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2021-11-09T10:56:00.52+00:00

    SQL Server uses a B+-Tree index not the traditional B-Tree index. There are two major differences between traditiona B-Tree index and B+-Tree index:

    • In a B+-Tree index, all of the data is in the leaf level pages. Only key values and pointers exist in the root and intermediate levels.
    • In a B+-Tree index, there are pointers which point to the next and last page in the level.

    With each page pointing to the page ahead and behind you can do range scans without having to travel up and down the index levels.

    On Wikipedia here, you will find SQL Server is one of many modern database engines using B+, a reference has been cited in the page.

    When you read Microsoft documentation here, you know by the description how indexes work on SQL Server that B+ is used and not the traditional B-tree.


  2. Tom Phillips 17,771 Reputation points
    2021-11-09T12:36:23.247+00:00

    Just to be clear.

    There are no options to change the way SQL Server creates indexes.

    0 comments No comments

  3. Seeya Xi-MSFT 16,586 Reputation points
    2021-11-10T05:37:02.543+00:00

    Hi @Kim, Changjae ,

    I would like to make sure if B-tree index structure the Microsoft documentation means B+-tree index structure actually.

    Agree with them.

    Is clustered index regarded as the option to use sequential file organization?

    Yes. Clustered index force the SQL server to store the underlying table in the order of cluster index key.
    Please see this link which may give your some help.
    https://www.sqlservercentral.com/blogs/sql-server-part-4-explaining-the-non-clustered-index-structure

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.