sql - Proper field orders for covering index - MySQL -
is there standard order create covering index table in mysql? meaning if have query has clause, order , fields in select statement, in order have fields index create covering index?
a covering index takes list of columns in comma separated list. list traversed/reviewed starting @ left side. if left column not used, index not used. meaning, having column list like:
col_a, col_b, col_c
if query not contain reference col_a
, won't used. if order changed to:
col_c, col_b, col_a
...then col_c
needs referenced in query. continuing use second covering index column example, col_b
or col_a
don't have in in query evaluation moves column column, left right.
column references index use can in following clauses:
- select
- where
- group by
- having
- order by
reference:
Comments
Post a Comment