刚有个群里发了个WP的代码,里面有段 WHERE post_name IN ('hello-world')
不明白为什么不用 post_name = 'hello-world' 呢?
难道 in 效率大于 = ?
如果是唯一条件,而且正确索引,并且正确使用字段类型 WHERE = '条件' 效率最高,没有之一。