51代码网ORACLEMYSQLSQL SERVER其它数据库java/jspasp/asp.netC/C++/VC++APP应用其它语言服务器应用
您现在的位置: 51代码网 >> oracle >> 文章正文

联合索引和分开建索引有什么区别

更新时间:2012-4-5:  来源:51代码网

A create index idx_owner_name_age on people(name,age); 

B:
create index idx_owner_name on people(name); 
create index idx_owner_age on people(age); 

请问A和B有什么区别?
复合索引的几个字段是否经常同时以AND方式出现在Where子句中?单字段查询是否极少甚至没有?如果是,则可以建立复合索引;否则考虑单字段索引;
 
create index idx_owner_name_age on people(name,age); 如果NAME字段不走索引,AGE字段肯定也不会走索引,如果NAME字段走索引,AGE就会走索引

  • 上一篇文章:
  • 下一篇文章: 没有了
  • 赞助商链接
    推荐文章
  • 此栏目下没有推荐文章
  • {
    设为首页 | 加入收藏 | 友情链接 | 网站地图 | 联系站长 |