PrefixCompare Field

Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic Code: Visual C++

C#
Visual Basic
Visual C++

Berkeley DB .NET API Documentation
SecondaryBTreeDatabaseConfig..::.PrefixCompare Field
SecondaryBTreeDatabaseConfig Class See Also Send Feedback

The Btree prefix function.

Namespace: BerkeleyDB
Assembly: libdb_dotnet60 (in libdb_dotnet60.dll) Version: 6.0.30.0

# Syntax

C#
    public EntryPrefixComparisonDelegate PrefixCompare

Visual Basic (Declaration)
    Public PrefixCompare As EntryPrefixComparisonDelegate

Visual C++
    public:
    EntryPrefixComparisonDelegate^ PrefixCompare

# Remarks

The prefix function is used to determine the amount by which keys stored on the Btree internal pages can be safely truncated without losing their uniqueness. See the Btree prefix comparison section of the Berkeley DB Reference Guide for more details about how this works. The usefulness of this is data-dependent, but can produce significantly reduced tree sizes and search times in some data sets.

If no prefix function or key comparison function is specified by the application, a default lexical comparison function is used as the prefix function. If no prefix function is specified and Compare is specified, no prefix function is used. It is an error to specify a prefix function without also specifying Compare.

If the database already exists, the prefix function must be the same as that historically used to create the database or corruption can occur.

# See Also

SecondaryBTreeDatabaseConfig Class
BerkeleyDB Namespace