IUseableIndexMetadata Class Reference

Represents the metadata for an index which can be used by the SQLEngine in the execution of a query. More...

Inherits Simba::SQLEngine::IIndexMetadata.

List of all members.

Public Types

enum  DMLSupportType { NO_DML_SUPPORT = 0, DMLSUPPORTS_INDEX_ONLY = 1 << 0, DMLSUPPORTS_BOOKMARKS = 1 << 1 }
 

A bitmask representing the supported behaviour of this index during update and delete operations.

More...

Public Member Functions

virtual bool CanIndexOnNull (simba_uint16 in_column) const =0
 Return whether the associated index supports indexing on IS NULL for the given column.
virtual bool CanProduceTableBookmarks () const =0
 Return whether the associated DSIExtIndex object can produce table bookmarks.
virtual const
IUseableIndexMetadata
GetAsUseableIndexMetadata () const
 Get this object as an IUseableIndexMetadata.
virtual simba_uint32 GetDeleteSupport () const
 Get a bitmasked value representing the supported behaviour of the index during delete operations.
virtual const std::set
< simba_uint16 > & 
GetIncludedColumns () const =0
 Get the indices (into the parent table) of columns whose data is retrievable via the associated index.
virtual const IndexColumnsGetIndexColumns () const =0
 Get the indexed columns.
virtual const simba_wstringGetName () const =0
 Get the name of the index.
virtual const ColumnIndexMapGetTableColumnToIndexColumnMap () const =0
 Get a map from column indices in the parent relation to column indices in this index.
virtual DSIExtIndexType GetType () const =0
 Get the type of the index.
virtual simba_uint32 GetUpdateSupport () const
 Get a bitmasked value representing the supported behaviour of the index during update operations.
virtual bool IsConditionTypeSupported (DSIExtColumnConditionType in_type, simba_uint16 in_column) const =0
 Get if the indicated condition type is supported for the given column of the index.
virtual bool IsInBookmarkComparatorOrder () const =0
 Get if the index traverses its rows in the order defined by the bookmark comparator.
virtual bool IsPrimaryKey () const =0
 Get if the index is the primary key.
virtual bool IsSorted () const =0
 Get if the index is a sorted index.
virtual bool IsUnique () const =0
 Get if the index is a unique index.
virtual bool IsUseable () const
 Get whether this index can be used by the SQLEngine.
virtual bool RequireBookmarkCaching () const
 Get whether bookmarks are required to be cached in the case that neither index-only nor bookmarks without caching works for the UPDATE statement (only caching bookmarks can work).
virtual ~IUseableIndexMetadata ()
 Destructor.

Protected Member Functions

 IUseableIndexMetadata ()
 Constructor.

Detailed Description

Represents the metadata for an index which can be used by the SQLEngine in the execution of a query.


Member Enumeration Documentation

A bitmask representing the supported behaviour of this index during update and delete operations.

DMLSUPPORTS_INDEX_ONLY means the index supports DML operations (UPDATE and/or DELETE) during index only scans.

DMLSUPPORTS_BOOKMARKS means the index supports DML operations (UPDATE and/or DELETE) when using bookmarks to access the rows.

Enumerator:
NO_DML_SUPPORT 
DMLSUPPORTS_INDEX_ONLY 
DMLSUPPORTS_BOOKMARKS 

Constructor & Destructor Documentation

virtual ~IUseableIndexMetadata (  )  [inline, virtual]

Destructor.

IUseableIndexMetadata (  )  [inline, protected]

Constructor.


Member Function Documentation

virtual bool CanIndexOnNull ( simba_uint16  in_column  )  const [pure virtual]

Return whether the associated index supports indexing on IS NULL for the given column.

Parameters:
in_column The column of interest.
Returns:
True if the associated index supports indexing IS NULL on the given column, False otherwise.
virtual bool CanProduceTableBookmarks (  )  const [pure virtual]

Return whether the associated DSIExtIndex object can produce table bookmarks.

Whether GetTableBookmark() can be called on the associated DSIExtIndex to produce a bookmark for the row in the table referred to by the current row in the DSIExtIndex.

If false, this index can only be used for 'index only scans'.

Returns:
Whether the associated DSIExtIndex object can produce table bookmarks.
virtual const IUseableIndexMetadata* GetAsUseableIndexMetadata (  )  const [inline, virtual]

Get this object as an IUseableIndexMetadata.

This method should only be called if IsUseable() returns true.

Returns:
This object as an IUseableIndexMetadata. (NOT OWN)
Exceptions:
SEInvalidOperationException if this is not an IUseableIndexMetadata.

Reimplemented from IIndexMetadata.

virtual simba_uint32 GetDeleteSupport (  )  const [inline, virtual]

Get a bitmasked value representing the supported behaviour of the index during delete operations.

Returns:
0 for no support, DMLSUPPORTS_INDEX_ONLY for index only scan support on delete, DMLSUPPORTS_BOOKMARKS for bookmark retrieval support on delete, and DMLSUPPORTS_INDEX_ONLY & DMLSUPPORTS_BOOKMARKS for full support on delete.
virtual const std::set<simba_uint16>& GetIncludedColumns (  )  const [pure virtual]

Get the indices (into the parent table) of columns whose data is retrievable via the associated index.

These are the columns whose data may be retrieved using RetrieveData() on the associated DSIExtIndex object.

Returns:
The indices of columns whose data is retrievable via the associated index.
virtual const IndexColumns& GetIndexColumns (  )  const [pure virtual]

Get the indexed columns.

Returns:
The columns involved in the index.

Implements IIndexMetadata.

virtual const simba_wstring& GetName (  )  const [pure virtual]

Get the name of the index.

Returns:
The name of the index.

Implements IIndexMetadata.

virtual const ColumnIndexMap& GetTableColumnToIndexColumnMap (  )  const [pure virtual]

Get a map from column indices in the parent relation to column indices in this index.

Specifically, this is a map from column indices from columns retrievable from the parent relation (for example, in the case of a table, the columns returned from DSIExtResultSet::GetSelectColumns() ) to columns retrievable in the associated DSIExtIndex object (in other words, from this->GetIncludedColumns() ).

As an example, suppose the table A exposes columns via GetSelectColumns() like so: [Column1, Column2, Column3] Then, to retrieve data from, say, Column1, the SDK will pass in 0 as the column index into DSIExtResultSet::RetrieveData().

If this is a index for table A, and you can retrieve data for Column1 by passing in X for the column index into DSIExtIndex::RetrieveData() on the associated index object, then the map returned by this method such include the mapping 0 -> X.

Returns:
A map from column indices in the parent relation to column indices in this index.
virtual DSIExtIndexType GetType (  )  const [pure virtual]

Get the type of the index.

Returns:
The type of the index.

Implements IIndexMetadata.

virtual simba_uint32 GetUpdateSupport (  )  const [inline, virtual]

Get a bitmasked value representing the supported behaviour of the index during update operations.

Returns:
0 for no support, DMLSUPPORTS_INDEX_ONLY for index only scan support on update, DMLSUPPORTS_BOOKMARKS for bookmark retrieval support on update, and DMLSUPPORTS_INDEX_ONLY & DMLSUPPORTS_BOOKMARKS for full support on update.
virtual bool IsConditionTypeSupported ( DSIExtColumnConditionType  in_type,
simba_uint16  in_column 
) const [pure virtual]

Get if the indicated condition type is supported for the given column of the index.

Parameters:
in_type The condition type of interest.
in_column The column of interest.
Returns:
True if the condition type is supported for the given column; false otherwise.
virtual bool IsInBookmarkComparatorOrder (  )  const [pure virtual]

Get if the index traverses its rows in the order defined by the bookmark comparator.

For example, this will be true if the bookmark comparator for the parent table is based on the row's location on disk, and this index is clustered.

If this returns true, the SQLEngine will not attempt to sort the stream of bookmarks produced by this index with the table's bookmark comparator. This will cause incorrect results if the index does not actually follow that order.

Returns:
True the index traverses its rows in the order defined by the bookmark comparator, False otherwise.
virtual bool IsPrimaryKey (  )  const [pure virtual]

Get if the index is the primary key.

Note that only one index should be the primary key for any table.

Returns:
True if the index is the primary key; false otherwise.

Implements IIndexMetadata.

virtual bool IsSorted (  )  const [pure virtual]

Get if the index is a sorted index.

Returns:
True if the index is a sorted index; false otherwise.
virtual bool IsUnique (  )  const [pure virtual]

Get if the index is a unique index.

Returns:
True if the index is a unique index; false otherwise.

Implements IIndexMetadata.

virtual bool IsUseable (  )  const [inline, virtual]

Get whether this index can be used by the SQLEngine.

Returns:
True if this index can be used by the SQLEngine, false otherwise.

Reimplemented from IIndexMetadata.

virtual bool RequireBookmarkCaching (  )  const [inline, virtual]

Get whether bookmarks are required to be cached in the case that neither index-only nor bookmarks without caching works for the UPDATE statement (only caching bookmarks can work).

When the UPDATE statement is updating the column which is also the indexed column, it is possible for some DSIIs that both index-only scan and bookmarks without caching don't work as expected (depending on the DSI implementation). In this case, it is recommended to override this method and have it return true.

If it is not the above case and this method is overridden and returns true, the bookmarks will always be cached when the indexed column is also the target column of updating, and it will use extra memory which is unnecessary.

The default value is false (no caching).

Returns:
true if the bookmarks are required to be cached in the case that neither index-only nor bookmarks without caching works for the UPDATE statement (only caching bookmarks can work); false otherwise.

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