Chinaunix首页 | 论坛 | 博客
  • 博客访问: 59257
  • 博文数量: 16
  • 博客积分: 354
  • 博客等级: 一等列兵
  • 技术积分: 180
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-14 18:00
文章分类

全部博文(16)

文章存档

2012年(1)

2011年(15)

分类: Mysql/postgreSQL

2011-10-20 13:15:12

KEY `date` (`date`,`task_id`,`sub_task_id`)
索引的前缀规则,以下情况可以用到该索引
1. where date=xxx
2. where date=xxx and task_id=xxx
3. where date=xxx and sub_task_id=xxx
4. where date=xxx and task_id=xxx and sub_task_id=xxx
5. where date=xxx and other_col=xxx 
和where条件中的顺序无关
阅读(2333) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~