There are two obvious ways to "reverse the DN"... one is to just write it backwards (uid=kdz,dc=example,dc=com) becomes (moc=cd,elpmaxe=cd,zdk=diu) the other is to reverse the SEQUENCE of RDNs (dc=com,dc=example,uid=kdz). Both should provide good better "locality" using default btree ordering routines, but generation costs are different. Likely the former is cheaper to generate.
Note that it can be easily achieved by ldap_dn2bv by using appropriate flags (e.g. LDAP_DN_FORMAT_DCE, or we could add a REVERSE flag to be ORed to the usual flags.
Ando.
-- Dr. Pierangelo Masarati | voice: +39 02 2399 8309 mailto:pierangelo.masarati@polimi.it | fax: +39 02 2399 8334 http://www.aero.polimi.it/~masarati Dip. Ing. Aerospaziale Politecnico di Milano, via La Masa 34, 20156 Milano, Italy