Results 1 to 4 of 4

Thread: search for a name takes more time

  1. #1
    Join Date
    Dec 2005
    Posts
    29

    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

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    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.

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    Try add full text index on that column, it can speed up the query.

  4. #4
    Join Date
    Dec 2005
    Posts
    29
    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
  •