I have table T1 where col A is primary key and col B is a foreign key which is a primary key in table T2. I want to create an index in T1, a composite one as (B,A). But MySQL is allowing me to create the index as (A,B) only. Is it because col B is a foreign key ?? Please explain
Share
This works fine for me:
Though
InnoDBdoes include clustered key as a row pointer in the indexes, there is nothing that prevents adding the field explicitly and sometimes it is required to optimize some queries.Please check your syntax.