mysql - Fastest way to exclude characters in a query -
i want union 2 tables, want exclude names start '?'. (in fact contain '?', offendors start '?'.)
select name, age, location tableone name not concat('?%') union select name, age, location tabletwo name not concat('?%') lock in share mode;
this slow. can speed better query, or indexing?
it using concat, code have inherited. expect concat not best choice, thought i'd show code i've received it.
my understanding indexes not in wildcard searches.
thanks!
if there's special entries name begins ?, want have field in database flag them. it's not using name - run problems this, being slow.
Comments
Post a Comment