indexing - MySQL index question -
i've been reading indexes in mysql recently, , of principles quite straightforward 1 concept still bugging me: basically, if in hypothetical table with, let's say, 10 columns, have 2 single-column indexes (for column01 , column02 respectively), plus primary key column (some other column), going used in simple select query 1 or not:
select * table column01 = 'aaa' , column02 = 'bbb'
looking @ it, first instinct telling me first index going retrieve set of rows (or primary keys in innodb, if got idea right) satisfy first condition, , second index set. , final result set intersection of these two. in books i've been going through cannot find particular scenario. of course, particular query 1 index on both columns seems best option, struggling understanding real process behind whole thing if try use 2 indexes described above.
its going use single index. need create composite index of multiple columns if want able index off of each column testing. may want read manual find out how mysql uses each type of index, , how order composite indexes correctly best utilization of it.
Comments
Post a Comment