Yeah there are two bad things in that query.
The NOT ops which kill the ability to use the index
msExchHomeServerName has.
The medial/tuple search, i.e. wildcard somewhere other than
the end of the string. I don't know how much optimization there is in the engine
for trying to quickly find matches with tuple searches if there is no tuple
index, but I expect it isn't a considerable amount considering the perf you tend
to see. For instance, I am not sure it even does simple things like skip
attributes that would be too small to match the search string, etc. It isn't
like it is a human mind processing the strings, it can't glance at at an entry
and say, yeah there is no chance of a match there, next. It actually has to keep
comparing parts of the string over and over again until it proves there is no
possible match. That would actually probably be some interesting reading
sometime. Maybe we can get Eric or Brett to blog about it.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Desmond Sent: Wednesday, June 15, 2005 2:03 AM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] My LDAP Query Appears
functional. Thanks. Definetely want to try this on a slightly more beefy box –
pegged this thing out at 100% for a while to return the 1200 qualfiying objects.
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of joe I am a bit tired and a
little high from sniffing tile adhesive but a couple of things. First, I don't
think you are using the correct attribute, I think you want
msExchHomeServerName. Second, I would think you want NOT CO-XMB11 AND NOT
CO-XMB12. I would write it more
like (&
(objectcategory=person)
(objectclass=user)
(mail=*)
(!(msExchHomeServerName=*CO-XMB11))
(!(msExchHomeServerName=*CO-XMB12)) ) And yeah, I can't say
that would probably be very performant, but I am not sure in my present state
how to make it performant without listing by name every other mailbox server by
full From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Brian
Desmond I
can’t get it to work and I’m tired. Anyone see my problem? I want all the users
in the current domain whose mailbox server is not CO-XMB11 or CO-XMB12. I really
don’t care about perf, I’ll run it once and forget about
it. (&(objectCategory=person)(objectClass=user)(mail=*)(!(|(msExchHomeServer=*CO-XMB11)(msExchHomeServer=*CO-XMB12)))) (&
(objectCategory=person)(objectClass=user)(mail=*)
(!
(|
(msExchHomeServer=*CO-XMB11)(msExchHomeServer=*CO-XMB12)
)
) ) Thanks, c -
312.731.3132 |
- RE: [ActiveDir] My LDAP Query joe
- RE: [ActiveDir] My LDAP Query Brian Desmond
- RE: [ActiveDir] My LDAP Query Rick Kingslan