Skip to content

Instantly share code, notes, and snippets.

@soyoes
Last active August 29, 2015 14:08
Show Gist options
  • Save soyoes/0958bfc137c746494111 to your computer and use it in GitHub Desktop.
Save soyoes/0958bfc137c746494111 to your computer and use it in GitHub Desktop.
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