>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
You can re-write it as a UNION with 3 different where clauses (each one for each field), but I don't think it would speed it up.
If it's not broken, fix it until it is.
My Blog