February 22, 2010 at 4:31 pm
Hi folks,
I have a sp:
select top 20 a.employeeid as [ID], a.account, a.displayname as [Name], w.workphonenumber as phone, w.emailaddress as email
from activedirectory a
inner join WhitePage w on w.displayname = a.displayname or w.empnum = '00000' + a.employeeid
where charindex(@query, a.account) > 0
Basically I want to get the top 20 matches, it's working with no problem, but the performance is not that satisfied, there are 31000 records in activedirectory and 48000 in WhitePage, I wouldn't say they are big, but the query result takes
Index has been created on: displayname(both), a.account, w.workphonenumber, w.emailaddress
How can I improve the query's performance?
Thanks lots.
February 23, 2010 at 7:40 am
-- Removed due to duplicate post
February 23, 2010 at 12:30 pm
This is duplicate post #8 for this problem. I provided an answer in another one, but it's not on my clipboard anymore and I'm not going to go searching as another person provided a similar answer in another thread as well.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply