Can Multiple Indexes Work Together?

前端 未结 9 1364
情书的邮戳
情书的邮戳 2021-02-19 07:13

Suppose I have a database table with two fields, \"foo\" and \"bar\". Neither of them are unique, but each of them are indexed. However, rather than being indexed together, th

9条回答
  •  一个人的身影
    2021-02-19 07:46

    It's better than that.

    Index Seeks are always quicker than full table scans. So behind the scenes Oracle (and SQL server for that matter) will first locate the range of rows on both indices. It will then look at which range is shorter (seeing that it's an inner join), and it will iterate the shorter range to find the matches with the larger of the two.

提交回复
热议问题