none
Restricted search of global address list is slow with large address books RRS feed

  • Question

  • I inherited some code that's doing a restricted search of the GAL based on a user's display name. The code has the following comment:

    // Set a restriction so that we only find close matches.
    // do not use RES_CONTENT & PR_DISPLAY_NAME search as it is 
    // very slow on large address books with multiple Domain Controllers

    So instead of using RES_CONTENT and doing an exact match, the code gets back a set of names then searches for the exact one.

    Do anyone know if this "slowness" is real?

    Tuesday, May 29, 2012 8:16 PM

Answers

All replies

  • Hi Chuck,

    Thanks for posting in the MSDN Forum.

    Would you please tell me which program language you will use to approach your goal? And which type of project you will create? Is it an add-in? Please tell me your Outlook version for further research.

    Havea good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us


    Wednesday, May 30, 2012 5:08 AM
    Moderator
  • Thanks for your reply. The code (C++) that was added to fix this "slowness" was done in august of 2006. It looks like outlook 2000 and possible 2003 were having this problem. The exchange environment was reported as:

    - Exchange is running in Native Mode
    - AD is a mixture of 2000 and 2003
    - AD forest has approximately 85 DC/GC in the 3 domains in the forest; root,
    corp, and cww domains.
    - Forest has over 100k users, but only about 85k with mailboxes.

    It think the exchange version was 2003.

    I need to incorporate this code into a new MAPI app that's using outlook 2007 and 2010 with exchange 2003, 2007 and 2010. I can just use the approach in the old code but I'd prefer to be a little smarter about the search. It's possible that "slowness" conclusion came from some incorrect analysis. So, is it possible that a restricted search for an exact match would be substantially slower than a less restrictive search?

    Wednesday, May 30, 2012 7:06 PM
  • Have you tried to use PR_ANR restriction? That is what Outlook itself uses when it resolves the names.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Wednesday, May 30, 2012 9:25 PM
  • The current code uses PR_ANR and works fine. More than anything, I was curious if RES_CONTENT really caused slowness and, if it didn't, I could simplify the code a tiny bit. But if outlook uses PR_ANR, then I'll probably just leave things the way they are.
    Wednesday, May 30, 2012 10:49 PM
  • You can also try RES_PROPERTY on PR_DISPLAY_NAME, but PR_ANR would probably be the best as it is most commonly used.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Wednesday, May 30, 2012 11:03 PM