SQL/Oracle: when indexes on multiple columns can be used

后端 未结 3 1923
日久生厌
日久生厌 2021-02-02 13:00

If I create an index on columns (A, B, C), in that order, my understanding is that the database will be able to use it even if I search only on (A), or (A and B), or (A and B an

3条回答
  •  借酒劲吻你
    2021-02-02 13:44

    Up to version Oracle 8 an index will never be used unless the first column is included in the SQL.

    In Oracle 9i the Skip Scan Index Access feature was introduced, which lets the Oracle CBO attempt to use indexes even when the prefix column is not available.

    Good overview of how skip scan works here: http://www.quest-pipelines.com/newsletter-v5/1004_C.htm

提交回复
热议问题