I have a LEFT JOIN select statement that retrieves values from 2 tables: tableA and tableB. The syntax is as follows:
SELECT tableA.first, tableA.middle, tableA.last, tableB.full FROM tableA LEFT JOIN
tableB ON tableB.full LIKE concat('%',tableA.middle,'%');
What is the best type of index to have for this statment? I’ve tried one on tableB.full but according to my EXPLAIN statement, it is not being used.
Note: though it’s probably obvious, I am a newbie to join statements.
thx.
The condition
cannot be optimized with index. You should avoid such conditions.