Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Performance speed in searching?????

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-09-09 : 09:04:42
tuancan writes "I'm coding an ASP application which uses SQL Server as back-end. In my SELECT statement, i must use LIKE keyword. But my table has much data (above 1,000,000 rows). I try to use index some field, but it very slow. How to performance speed in searching? Thanks!"

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-09-09 : 11:15:15
If I recall....

Doing this will ALWAYS result in a table scan (not using the indexes)
SELECT * FROM MyTable WHERE myfield LIKE '%blah%'

Doing this will should result in a index scan / seek (assuming you have an index on myfield)
SELECT * FROM MyTable WHERE myfield LIKE 'blah%'

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2002-09-09 : 11:26:00
Try a search on this site using the following keywords:

SOUNDEX
DIFFERENCE

These techniques may provide alternatives.

Go to Top of Page
   

- Advertisement -