Performance issue

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

  • -- Removed due to duplicate post

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

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply