Last active
August 29, 2015 14:08
-
-
Save soyoes/0958bfc137c746494111 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * | |
NOT IN | |
!= //index失効 | |
<> //index失効 | |
is null //index失効, 方法:NOT NULL, default=0, where xxx=0 | |
where OR //index失効失効 | |
改善前: | |
select id from t where num=10 or num=20 | |
改善後: | |
select id from t where num=10 | |
union all | |
select id from t where num=20 | |
左側の計算式 OR function //index失効 | |
例 | |
select id from t where num/2=100 | |
改善案: | |
select id from t where num=100*2 | |
^-------- | |
exists is better then in ??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment