????????????

??????????????????????а??????????е???Σ?????????β??????InnoDB???????????С????????????????????????????????????Σ?InnoDB?????μ???????μ???????β??

??????????????

???????????

CREATE TABLE t (
  a char(32) not null primary key??
  b char(32) not null??
  KEY idx1 (a??b)??
  KEY idx2 (b??a)
) Engine=InnoDB;

????idx1??idx2?????????????С???????????????

???????????

CREATE TABLE t (
  a char(32) not null??
  b char(32) not null??
  c char(32) not null??
  d char(32) not null??
  PRIMARY KEY (a??b)
  KEY idx1 (c??a)??
  KEY idx2 (d??b)
) Engine=InnoDB;

?????????InnoDB???????????????idx1?????????洢?(c??a??b)??idx2?????????洢?(d??b??a)

????????????????????Ρ?Server??????????????? MySQL ?????????????????ε???????????????????????

   SELECT * FROM t WHERE d=x1 AND b=x2 ORDER BY a;

???????????洢??idx2(d??b??a)??????????????????????????????? Server ?????????????MySQL????????????idx2(d??b)?????????????a??λ????????PK??????????

??????????????????????????KEY idx2(d??b??a)?????MySQL???(d??b??a)????????????ж??У?????InnoDB?????????????????а????????е???????Σ???????????????????????洢???

??????????????

???????????????????е?MySQL DBA??????????????????????????κ??油????????Ρ???????κ?????????????????????????????