Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Way To Speed Up This Query
Message
From
07/01/2009 09:36:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01371572
Message ID:
01371689
Views:
9
>I have a table called AlertData with 500,000 records in it. This query is taking 11 seconds, which is too long for the client.
>
>
>DECLARE @sSearchVal NVARCHAR(50)
>SET @sSearchVal = '%sun%'
>
>SELECT RowId, ContractNo, SystemId, ItemNumber, Description, Price
>	FROM AlertData
>	WHERE ContractNo LIKE @sSearchVal OR
>		   ItemNumber LIKE  @sSearchVal OR
>		   Description LIKE  @sSearchVal
>
>
>
>There are indexes on all 3 fields.
>
>Thanks
>
>Kevin

Kevin,
It would get faster if you use fulltext indexing on that data. Normal indexes wouldn't help with x in y style searches.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform