IBookmarkComparator Class Reference

A comparator for comparing a relation's bookmarks. More...

Inherits Simba::SQLEngine::ICellComparator.

List of all members.

Public Member Functions

virtual simba_int32 Compare (const simba_byte *in_left, simba_uint32 in_leftNumBytes, const simba_byte *in_right, simba_uint32 in_rightNumBytes) const =0
 Compares two bookmarks for order.
virtual simba_uint16 GetBookmarkSize () const =0
 Gets the size, in bytes, of bookmarks this object compares.
virtual bool ShouldAlwaysSortBookmarks () const =0
 Whether a set of bookmarks should always be sorted using this object before using them to access a table.

Protected Member Functions

 IBookmarkComparator ()
 Constructor.

Detailed Description

A comparator for comparing a relation's bookmarks.

This object should define a total order on the bookmarks of the relation it comes from.

This order should be such that visiting a set of bookmarks in this order in the relation should be as efficient as possible (for example, in clustered order).


Constructor & Destructor Documentation

IBookmarkComparator (  )  [inline, protected]

Constructor.


Member Function Documentation

virtual simba_int32 Compare ( const simba_byte *  in_left,
simba_uint32  in_leftNumBytes,
const simba_byte *  in_right,
simba_uint32  in_rightNumBytes 
) const [pure virtual]

Compares two bookmarks for order.

Parameters:
in_left The first byte buffer to compare. Must not be NULL. (NOT OWN)
in_leftNumBytes This parameter should be ignored.
in_right The second byte buffer to compare with in_left. Must not be NULL. (NOT OWN)
in_rightNumBytes This parameter should be ignored.
Returns:
0 if in_left is equal to in_right; negative integer if in_left is less than in_right; positive integer if in_left is greater than in_right.

Implements ICellComparator.

virtual simba_uint16 GetBookmarkSize (  )  const [pure virtual]

Gets the size, in bytes, of bookmarks this object compares.

Returns:
The size, in bytes, of bookmarks this object compares.
virtual bool ShouldAlwaysSortBookmarks (  )  const [pure virtual]

Whether a set of bookmarks should always be sorted using this object before using them to access a table.

This should return True if accessing a set of rows in the associated table using a set of bookmarks is more efficient if they are put into the order defined by this object, and the difference in efficiency is worth the overhead involved in sorting.

If this function returns false, the SQLEngine will use this object to sort a set of bookmarks for the associated table only if it needs to. Otherwise, in cases where the order of rows retrieved is immaterial, it will always sort bookmarks using this object before applying them to the associated table.

Returns:
Whether a set of bookmarks should always be sorted using this object before using them to access a table.

The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:18 2017 for SimbaEngine 10.1.3.1011 by simba