[thelist] constructing a good search string/query
Dan McCullough
dan.mccullough at gmail.com
Tue May 3 07:33:01 CDT 2005
Thanks Peter, there were two fields in the summary table and I needed
both fields so I was using the * on the select.
How do you guys handle mispellings?
On 5/2/05, Pete Freitag <pf at cfdev.com> wrote:
> Dan McCullough wrote:
>
> >Guess what? Its SLOWWWWWWWWWWWWWWWWWWWW!
> >select * from search_string where lower(searchstring) like '%"+searchTerm+"%'
> >
> >
> Some other things you might try to speed it up even more...
>
> - If your DB supports it create a full text index on your table
> - Don't use select *, select only the column names you need. With the *
> the DB also has to look up what columns are in the table, and often
> times you don't need all columns returned.
> - Index other columns that are searched
>
> ______________________________________
> Pete Freitag
> work: http://www.cfdev.com/
> blog: http://www.petefreitag.com/
> shop: http://www.dealazon.com/
>
> Author of the CFMX Developers Cookbook
> http://www.petefreitag.com/bookshelf/
>
>
More information about the thelist
mailing list