Mysql JOIN with 25million rows Recently I got stucked with a table where its grown to +25million and I have got a query that's doing a JOIN on it. The query take 2.5hours to execute even though I got Good 96GB RAM and RAID10 with BBU config.

TableA has 958090  records
TablesB has 25Million Records.

The query join is simple.

select tableA.col1, tablesA.col2, tablesA.directory, tableB.col1, tableB.col2
from tableA left join tableB ON tableA.col1=tableB.col1 AND tablesA.col2=tableB.col2
where tablesA.col2='123'
OTHER BY tablesA.directory desc;


tablesA.directory is VARCHAR(950);
INDEX ON tablesA.col2
INDEX ON tableB.col1 and tableB.col2


Please help me how to gain performance in this scenario.
Try adding index on combincation of tableB (col2, ,col1) because selection is happening on col2. This should work.