-
search for a name takes more time
i have a table which contains a text field
and basically i have to check if a text or phrase exist in that text
select count(*) from MYtable where TxtField like '%MYPHRASE%'
there are 700,000 records in that table and whenever i query it takes 9 seconds to give me the recordcount.
what i am doing wrong
-
Any query with LIKE operator takes longer than equality query as the SQL query engine can't use index and has to go for table scan.
-
Try add full text index on that column, it can speed up the query.
-
Thanks mates for the reply
I will Try that
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|