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
Database..::.Join Method
Database Class See Also

Create a specialized join cursor for use in performing equality or natural joins on secondary indices.

Namespace: BerkeleyDB
Assembly: libdb_dotnet48 (in libdb_dotnet48.dll) Version: 4.8.24.0

# Syntax

C#
    public JoinCursor Join(
    	SecondaryCursor[] lst,
    	bool sortCursors
    )

Visual Basic (Declaration)
    Public Function Join ( _
    	lst As SecondaryCursor(), _
    	sortCursors As Boolean _
    ) As JoinCursor

Visual C++
    public:
    JoinCursor^ Join(
    	array<SecondaryCursor^>^ lst,
    	bool sortCursors
    )

#### Parameters

lst
  Type: array< BerkeleyDB..::.SecondaryCursor >[]()[]
  An array of SecondaryCursors. Each cursor must have been initialized to refer to the key on which the underlying database should be joined.

sortCursors
  Type: System..::.Boolean
  If true, sort the cursors from the one that refers to the least number of data items to the one that refers to the most. If the data are structured so that cursors with many data items also share many common elements, higher performance will result from listing those cursors before cursors with fewer data items; that is, a sort order other than the default. A setting of false permits applications to perform join optimization prior to calling Join.

#### Return Value

A specialized join cursor for use in performing equality or natural joins on secondary indices.

# Remarks

Once the cursors have been passed as part of lst, they should not be accessed or modified until the newly created JoinCursorhas been closed, or else inconsistent results may be returned.

Joined values are retrieved by doing a sequential iteration over the first cursor in lst, and a nested iteration over each secondary cursor in the order they are specified in the curslist parameter. This requires database traversals to search for the current datum in all the cursors after the first. For this reason, the best join performance normally results from sorting the cursors from the one that refers to the least number of data items to the one that refers to the most.

# See Also

Database Class
BerkeleyDB Namespace