Advertisement

01.05.2008 at 09:52PM PST, ID: 23061633
[x]
Attachment Details

Searching using LIKE performance review

Asked by dswett2 in SQL Server 2005, Programming for ASP.NET, Visual Studio .NET 2005

Tags: ASP.NET

I have this web app. The search page has 3 text fields that you can search by (Name, Addres, and Contact Name) and a Search button.

I have an SQLDataSource1 with the statement: SELECT [Name], [Address], [City], [State], [ContactName] FROM [Owner] WHERE (([Address] LIKE '%' + @Address + '%') AND ([Name] LIKE '%' + @Name + '%') AND ([ContactName] LIKE '%' + @ContactName + '%')). The three search fields have the wildcard (%) as the default in case nothing is entered.

I have a GridView that uses SQLDataSource1. I have set it to Visible = false.

In the code behind for the button, it sets the Visible property of the GridView to true.

I have 3 records in the database now and it looks and operates EXACTLY how I need it to be when I click the search button.



MY Question:
I've heard this would be very slow. I've heard that I should use full-text indexing, but it seems like overkill for this simple search. I am using SQL Server 2005. Can you guys estimate the seconds it would take to search through the following (completely returning all results, no TOP 10) number of records using LIKE in a varchar(60) address:
1,000 -
10,000 -
100,000 -
1,000,000 -Start Free Trial
[+][-]01.05.2008 at 11:11PM PST, ID: 20593052

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, Programming for ASP.NET, Visual Studio .NET 2005
Tags: ASP.NET
Sign Up Now!
Solution Provided By: aneeshattingal
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.05.2008 at 11:44PM PST, ID: 20593105

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.06.2008 at 05:09AM PST, ID: 20593770

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628