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

indexing optimization



In schema_init.c hashPreset() we compute the initial value of the index hash. This includes a prefix string which is usually the attribute's canonical name, a prefix character which is 0 or a particular substring index type, and then the syntax OID and matching rule OID.

This is computed once per attribute. We could instead compute this one-time only, and save the result in the Attribute structure, or the AttributeDescription structure. (It probably makes most sense in the latter, since the prefix also may include any tags on the attributeDescription.)

This change would require changing the signature of the indexer functions, to pass in the AttrDesc pointer or something to convey the precomputed hash.

Or we could do away with some of this. Hashing against the syntax and mr OID seems gratuitous, since the index values are already going to be segregated by prefix and pre. One way or another, the hash over these two OIDs should be factored out, because even if we want to keep them, they're constants and we shouldn't need to keep recomputing them.

--
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/