講師回答 / sqlercn
可以適當的在排序字段上加索引,這樣在order by 語句時也有可能可以利用上索引。這里說可能是因為對于order by 上的列是否用索引還有其它的一些限制
2015-07-10
最贊回答 / GeorgeHao
安裝過程:[root@localhost-centos6 ~]# wget percona.com/get/pt-query-digest[root@localhost-centos6 ~]# chmod u+x pt-query-digest[root@localhost-centos6 ~]# mv /root/pt-query-digest /usr/bin/
2015-03-18
已采納回答 / lin_j
因為 當?release_year不是 2006時 ,release_year='2006' 結果false 不是 NULL,Count在 值是NULL是 不統計數, 至于加上or NULL , 很像其他編程里的or運算符,第一個表達式是true就是不執行or后面的表達式,第一個表達式是false 執行or后面的表達式 。當release_year不為2006時release_year = '2006' or NULL 的結果是NULL,Count才不會統計上這條記錄數
2015-01-28