Oracle: 索引 与… where a = xx and b = xx and c = xx

摘自《Troubleshooting Oracle Performance》

对于B-树索引

  如果在a,b,c三列分别建一个索引,则

     … where a = xx and b = xx and c = xx 仍然非常低效

  如果在a,b,c三列上建立联合索引,则

       … where a = xx and b = xx and c = xx 会高效的多

     而… where a = xx and b = xx  也会比较高效,即使c列没有出现在where子句

对于位图索引

  如果在a,b,c三列分别建一个索引,则

     … where a = xx and b = xx and c = xx 已经可以达到高效

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.