I need to search for keywords, which is case insensitive. To do that, I'm using the below queries. Logic wise okay, but performance drastically going down.
Table info
item_tbl: 558991075
keywords: 2000
SELECT itemname from items i
LEFT JOIN keywords k
ON i.id = k.item_id
AND lower(i.itemname) LIKE CONCAT('%', lower(k.value), '%')
WHERE l.item_id is null
Example:
Keywords:
Iphone x
Yellow Mango
Red onion
Item names:
Some Item 1
Red color Iphone X
Big Yellow Mango
The final valid item is Some Item 1
.
Is there a way to improve this query performance?