[Date Prev][Date Next] [Chronological] [Thread] [Top]

Efficient Searching



Hi all,
I've got a few questions regarding the search process in OpenLDAP - any help
appreciated!

I'm trying to get clear in my head whether, given a simple mapping from a value
to a DN, it is more efficient to create an equality index on an attribute or to
issue a base-scope search.

E.g. if you consider a DNS-type example, you could use the components of the
hostname to form a tree. So, for www.theplanet.co.uk you could create the DN
"cn=www, o=planet, cn=co, c=uk". Equally you could have a hostname attribute
with a value of www.theplanet.co.uk and an equality index defined on
it. (Ignore the numerous problems in this example - its just illustrative!)

With this in mind, you could either set the base DN to "cn=www, o=planet,
cn=co, c=uk", the scope to base and the filter to "objectclass=*", or you could
set the base DN to "c=uk", the scope to sub and the filter to
"hostname=www.theplanet.co.uk".

So, assuming you can guarantee that the target values are unique within the
tree - which is more efficient?! I suspect that the base-scope search is more
efficient - but am I right? I guess it boils down to how efficient the dn2id
index is vs a general equality index... isn't it?!

Also, when issuing a base-scope search, what is the most efficient filter to
use? How much of the filter gets checked *if* the target object of the base
search exists?

On a similar vein - does anyone know of any highly optimised back-ends for the
case where a given attribute value can be mapped to one, and only one,
entity?

Cheers,
  Neil

-------------------------------------------------------------------------------
  Neil Hunter                                     Tel:    +44 (0)113 207 6073
  Internet Systems Developer                      Fax:    +44 (0)113 207 6065
  Planet Online Limited                           Mobile: +44 (0)7787 100 649
-------------------------------------------------------------------------------