Fastest Search Engine

treva26

Registered User.
Local time
Today, 11:14
Joined
Sep 19, 2007
Messages
113
I have a QUOTES table that has a LOT of fields
I have a search engine that compares the input keyword using LIKE to each field and returns any matches
Is this the fastest method? (I am using an SQL Server 2005 backend)

I am wondering if making a query that concatenates multiple fields and then performs one LIKE on that field might be faster?

Or is there another method?
Strangely I cant seem to find much online about it.

Here is what I currently use, with 421 being the keyword:
Any speed tips would be appreciated..

Code:
SELECT [Quote Num], [QuoteDBID] FROM Quotes WHERE 
(([Customer] Like "*421*") OR ([Full Quote Num] Like "*421*") OR ([OE Number] Like "*421*") OR ([Reference] Like "*421*") OR ([Notes] Like "*421*") OR ([Customer Order Number] Like "*421*") OR ([P Number] Like "*421*") OR ([Cust Contact] Like "*421*") OR ([Parent Quote] Like "*421*") OR ([Cust Email] Like "*421*") OR ([Cust Postal Address] Like "*421*") OR ([Cust Street Address] Like "*421*") OR ([Sales Area (Quotes Table)] Like "*421*") OR ([Est Manu Notes] Like "*421*") OR ([Transport Del Point] Like "*421*") OR ([Scope Details] Like "*421*") OR ([SearchMemo] Like "*421*") OR ([Consignment Note Number] Like "*421*") OR ([Delivery Address] Like "*421*") OR ([Dispatch Carrier Name] Like "*421*") OR ([Delivery Address UNIBIS] Like "*421*") OR ([End User] Like "*421*")) 
AND ([SiteCode] = "Bassendean") 
ORDER BY [Quote Arrival Date] DESC;
 
Using LIKE you cannot use any indexes, instead its a slow search.

Simular with concatinated fields, no indes = slow search. Limiting the number of columns to search then removing the LIKE will increase performance....
 
But how can I search a field to see if it contains the keyword somewhere
(ie not an exact match)
without using LIKE?
 
Sandgroper

To repeat what I said you need to fix your Database design by the use of Normalisation methods.

Until you do that you will never solve your problem.
 

Users who are viewing this thread

Back
Top Bottom