Geert Hendrickx wrote:
Hi
I have a few questions on the index_hash64 / olcIndexHash64 feature;
Use a 64 bit hash for indexing. The default is to use 32 bit hashes. These hashes are used for equality and substring indexing. The 64 bit version may be needed to avoid index collisions when the number of indexed values exceeds ~64 million. (Note that substring indexing generates multiple index values per actual attribute value.) Indices generated with 32 bit hashes are incompatible with the 64 bit version, and vice versa. Any existing databases must be fully reloaded when changing this setting. This directive is only supported on 64 bit CPUs.
What is the effect if hash collisions happen? Will slapd actually return incorrect results, or does it just need to perform extra work to discard false positives from an index search result?
slapd will never return incorrect results. It will just have to do extra work.
Since this feature only impacts indexes and not data, isn't "slapindex" enough to to regenerate indexes, instead of a full slapcat/slapadd ?
Yes, using the truncate option to delete the old indices.
Finally, is there some way to detect if a given data.mdb file uses 32- or 64-bit index hashes? I can load a "legacy" data.mdb in a server with index_hash64 enabled, and slapd does not complain, indexes are just broken.
You can simply look at the size of the keys of the index tables.