3I1Berkeley DB: DbInfo::set_bt_prefix[P

DbInfo::set_bt_prefix





#include <db_cxx.h>

:typedef size_t (*bt_prefix_fcn)(const DBT *, const DBT *);*void DbInfo::set_bt_prefix(bt_prefix_fcn);





Description

)Set the Btree prefix comparison function.KIf specified, this method must return the number of bytes of the second keyJargument that are necessary to determine that it is greater than the first key argument.9If the keys are equal, the key length should be returned.

iThe data and size fields of the Dbt are the only<fields that may be used for the purposes of this comparison.

GThis function is used to compress the keys stored on the btree internalGpages. The usefulness of this is data dependent, but in some data sets>can produce significantly reduced tree sizes and search times.

GIf bt_prefix is not explicitly set, and no key comparison methodDis specified, a default lexical comparison method is used for prefixAcompression. If bt_prefix is not explicitly set and a keyHcomparison method is specified, no prefix compression is done. It is anFerror to set bt_prefix without also specifying a key comparisonmethod.



Class

4DbInfo



See Also

NDbInfo::set_bt_compare,LDbInfo::set_bt_maxkey,LDbInfo::set_bt_minkey,DbInfo::set_bt_prefix,LDbInfo::set_cachesize,HDbInfo::set_compare,DDbInfo::set_flags,LDbInfo::set_h_ffactor,FDbInfo::set_h_hash,HDbInfo::set_h_nelem,FDbInfo::set_lorder,FDbInfo::set_malloc,JDbInfo::set_pagesize,JDbInfo::set_re_delim,FDbInfo::set_re_len,EDbInfo::set_re_padandLDbInfo::set_re_source.
ÿÿ