ExprRange.h

Classes

TableExprRange -- Select range of a column in an select expression (full description)

class TableExprRange

Interface

Public Members
TableExprRange()
TableExprRange (const ROTableColumn&, double stval, double endval)
TableExprRange (const TableExprRange&)
~TableExprRange ()
TableExprRange& operator= (const TableExprRange&)
const Vector<double>& start() const
const Vector<double>& end() const
const ROTableColumn& getColumn() const
void mixAnd (const TableExprRange&)
void mixOr (const TableExprRange&)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Prerequisite

Etymology

TableExprRange represents the ranges of a column as specified in a table select expression.

Synopsis

TableExprRange holds the ranges of values for a column as specified in a table select expression. It traverses the expression tree and composes the hull of the values. Only double values are taken into account. It can handle operators &&, ||, ==, >, >=, <, <=, !. It can handle a comparison operator only for a column with a constant. Other operators and expressions are non-convertable.

The ranges function in class TableExprNode returns a Block of TableExprRange objects which contains the ranges for each (applicable) column used in the expression.

Motivation

TableExprRange gives great possibilities in optimizing a table selection. It allows to get a rough estimate of the values needed for a column which can be used to do a fast preselect using an index.

To Do

Member Description

TableExprRange()

Default constructor (needed for Block).

TableExprRange (const ROTableColumn&, double stval, double endval)

Construct from a column and a single constant range.

TableExprRange (const TableExprRange&)

Copy constructor.

~TableExprRange ()

TableExprRange& operator= (const TableExprRange&)

Assignment operator (copy semantics).

const Vector<double>& start() const

Return the vector of start values. Together with the equally sized vector of end values, this forms the ranges for the column (which can be acquired using getColumn).

const Vector<double>& end() const

Return the vector of end values. Together with the equally sized vector of start values, this forms the ranges for the column (which can be acquired using getColumn).

const ROTableColumn& getColumn() const

Return the column object.

void mixAnd (const TableExprRange&)

Mix with another range for an AND expression.

void mixOr (const TableExprRange&)

Mix with another range for an OR expression.