what is index and can non-clustered index be non-unique?

后端 未结 2 1134
广开言路
广开言路 2021-01-11 15:11

Subquestion to my question [1]:

All definitions of (MS SQL Server) index (that I could find) are ambiguous and all explanations, based on it, narrate something us

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-11 16:00

    The definition of an index is the first part of Wikipedia definition "A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of slower writes and increased storage space."

    Then you have unique indexes, as a special kind of index, which ensure that indexed values are unique.

    How it's implemented... depends on the DBMS. But it does not change the definition of index, or unique index.

    As an implementation detail, MS SQL allows non-clustered (the usual kind, which is a tree with pointers to the actual row contents in a separate space, which you numbered 2.), and clustered (where rows are stored in the index, according the indexed value, which you numbered 1.) indexes.

    So an non-unique non-clustered index is just (conceptualy) a tree of values with, for each value, a set of pointers to table rows containing this value.

提交回复
热议问题