Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Incremental search
Message
From
12/05/2003 05:16:14
 
 
To
29/04/2003 09:52:02
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00782577
Message ID:
00787224
Views:
13
Hi!

I made exactly similar thing in one of my applications - interactive search for SQL Server. I used 2 approaches that helped me to improve performance greatly:

1. Try following query:

cSurNameSearch = "XXXX"
strSQL = "SELECT TOP 10 PK, SurName FROM Person WHERE SurName >= '" + cSurNameSearch + "' AND SurName<'" + cSurNameSearch + "zzzzzzzzzzzzz' ORDER BY SurName"

The above query is pretty optimizable. Instead of "z" you can use also some other character you know for sure it is the last character in character code table from a set of characters that could be used in search.

2. To improve performance by do not making queries roundtrips for each character, make a timeout for query. User types in "Man" - no query fo "M" and "a". After user types "n", and wait 0.5 seconds, query is launched. If it does nto reqturn what is needed, user starts to type further, when stop for a moment query launch again. The delay between last character typing and query is determined usually by the speed of the query - of query is slow, dleay is larger. In general, I would not make it greater than 1.5 seconds.

HTH.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform