42

一个值只有0和1的字段,到底要不要建索引? - xuanbg

 5 years ago
source link: https://www.cnblogs.com/xuanbg/p/9473049.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
关于数据库索引的所有文章,都会告诉你不要对这种字段建索引。 但这些文章不会告诉你的一个事实是: 如果表里面这个字段的值分布极度不均匀的情况下,而且你需要查询分布较少的记录的话,索引就非常有用了 举个例

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK