Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am trying to come up with the most efficient way to search for records in a collection of about 130,000 total records. The long, short of it is we have about 130,000 Active Directory records. I am building a site that looks up users in AD. I would like to implement TypeAhead functionality on a Search box. I could query AD directly in code, but am thinking about dumping the data into SQL Server and querying that instead. TypeAhead does a search as you type characters in the textbox. Is it efficient to search a table of 130,000 records by single characters? I am trying to determine if the searching should be done by the SQL Server engine or on the site? I am thinking SQL Server. If true, is it better to use FREETEXT or CONTAINS full text searches?

Curious what the community thinks about this? Or am I way off?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

I'm not sure I'm understanding your question. FREETEXT evaluates not only on the string, but also the meaning. Whereas CONTAINS is used for precise or fuzzy searching on a string.

share|improve this answer

I'd start with querying AD directly. If the feature was heavily used, slow, or placing a strain on AD servers, I'd consider caching the entire data set in memory. Its a pretty small dataset, does it warrant the effort of setting up a database and the necessary ETL to load regularly?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.