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. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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


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.