I'm doing a query that is like this:
Code:
SELECT *
FROM A
INNER JOIN B ON (A.Value LIKE CONCAT('%', CONCAT(B.Value, '%')))
Table A has ~25K rows
Table B has ~50K rows.
This query ran for an hour before I killed it. I know the query is inherently slow and won't use indexes, but I need to get better performance. A few minutes is acceptable; over an hour isn't.
Doing an EXPLAIN shows two "all" joins. I know that's bad but I don't see a way around it.
Any ideas?