I am trying to perform the following query against a table in our database that has 8.7 million rows. It seems to run forever (never comes back). I can run this same query against a smaller version of the same table (100,000 rows) and it runs fine. FYI - column2 is a blob data type.
select column1, column2, column3 from table where (column1\column2 like '"pf chang"' or column1\column2 like 'p.f.chang' or column1\column2 like '"p.f. chang"' or column1\column2 like '"pf changs"' or column1\column2 like 'p.f.changs' or column1\column2 like '"p.f. changs"' or column1\column2 like '"pf chang''s"' or column1\column2 like 'p.f.chang''s' or column1\column2 like '"p.f. chang''s"') and columndate > '-30 days'
Is there anything I can do to speed up the performance of complex queries like the one in my example?
thx.
select column1, column2, column3 from table where (column1\column2 like '"pf chang"' or column1\column2 like 'p.f.chang' or column1\column2 like '"p.f. chang"' or column1\column2 like '"pf changs"' or column1\column2 like 'p.f.changs' or column1\column2 like '"p.f. changs"' or column1\column2 like '"pf chang''s"' or column1\column2 like 'p.f.chang''s' or column1\column2 like '"p.f. chang''s"') and columndate > '-30 days'
Is there anything I can do to speed up the performance of complex queries like the one in my example?
thx.