Strategies/Methods for doing text matching

Discussion in 'Databases' started by coglethorpe, Dec 20, 2010.

  1. #1
    I'm trying to look for rows that match a text input in a table like this:

    where description like '%search query here%'

    I know that can be painfully slow - so what strategies can be used to speed that up for wide columns on large data sets?
     
    coglethorpe, Dec 20, 2010 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    You can use FULLTEXT capability of database like in MySQL. you can also consider Sphinx engine if you are doing this on a huge scale.
     
    mwasif, Dec 21, 2010 IP
  3. christyzulueta

    christyzulueta Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can probably create an index. Try to index the field that you are using to search. It will somewhat help in the speed since indexing autosort the records.
     
    christyzulueta, Jan 27, 2011 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    Index is of no use for wildcard searches mentioned above.
     
    mwasif, Jan 28, 2011 IP