I need some help here, I am fetching data dependent upon the conditions
Here I am using like operators, where client may use search with any word thus I have the below logic but here retrieval time is too high (it's taking 4mins) to get the data which is too slow.
I did all indexing to table but still can't optimize the query.
select * from authors where (address like '% Walmart %' OR address like 'Walmart %' OR address like '% Walmart' OR address like '% Walmart.com %' OR address like 'Walmart.com %' OR address like '% Walmart.com' OR address like '% Walmarts %' OR address like 'Walmarts %' OR address like '% Walmarts' OR address like '% Walmarts.com %' OR address like 'Walmarts.com %' OR address like '% Walmarts.com')
-- Result is 1 Rows
if i follow this logic
select * from authors where address like '%Walmart%'
-- Result is 44 rows - it is fetching all rows
But I need to get only that one row