--单列索引
--创建单例索引
create index idx_accout_name on account(account_name);
--单列索引触发规则,条件必须是索引列中的原始值。
--单行函数,模糊查询,都会影响索引的触发。
select * from account where account_name ='马云'
--复合索引
--创建复合索引
create index idx_account_name_money on account(account_name,account_money);
--复合索引中第一列为优先检索列
--如果要触发复合索引,必须包含有优先检索列的原始值。
select * from account where account_name='马云' and account_money='3333';--触发复合索引
select * from account where account_name='马云' or account_money='3333';--不触发索引
select * from account where account_name='马云'--触发单例索引