Top Description Fields Methods
org.apache.derby.vti

public Interface VTICosting

Known Direct Implementers
org.apache.derby.diag.ErrorMessages, org.apache.derby.diag.LockTable, org.apache.derby.diag.SpaceTable, org.apache.derby.diag.TransactionTable
Imports
java.sql.SQLException

VTICosting is the interface that the query optimizer uses to cost Table Functions. The methods on this interface provide the optimizer with the following information:

The optimizer places a Table Function in the join order after making some assumptions:

The class which contains your Table Function can override these assumptions and improve the join order as follows:

The methods in this interface take a VTIEnvironment argument. This is a state variable created by the optimizer. The methods in this interface can use this state variable to pass information to one another and learn other details of the operating environment.

See Also
org.apache.derby.vti.VTIEnvironment

Field Summary

Modifier and TypeField and Description
public static final double
defaultEstimatedCost

A useful constant: The default estimated cost of instantiating and iterating throught a Table Function.

public static final double
defaultEstimatedRowCount

A useful constant: the default estimated number of rows returned by a Table Function.

Method Summary

Modifier and TypeMethod and Description
public double

Returns:

The estimated cost for a single instantiation of the Table Function.
getEstimatedCostPerInstantiation
(VTIEnvironment
The state variable for optimizing the Table Function.
vtiEnvironment
)

Get the estimated cost for a single instantiation of a Table Function.

public double

Returns:

The estimated row count for a single scan of the Table Function.
getEstimatedRowCount
(VTIEnvironment
The state variable for optimizing the Table Function.
vtiEnvironment
)

Get the estimated row count for a single scan of a Table Function.

public boolean

Returns:

True if the ResultSet can be instantiated multiple times, false if can only be instantiated once.
supportsMultipleInstantiations
(VTIEnvironment
The state variable for optimizing the Table Function.
vtiEnvironment
)

Find out if the ResultSet of the Table Function can be instantiated multiple times.

Field Detail

defaultEstimatedCostback to summary
public static final double defaultEstimatedCost

A useful constant: The default estimated cost of instantiating and iterating throught a Table Function.

defaultEstimatedRowCountback to summary
public static final double defaultEstimatedRowCount

A useful constant: the default estimated number of rows returned by a Table Function.

Method Detail

getEstimatedCostPerInstantiationback to summary
public double getEstimatedCostPerInstantiation(VTIEnvironment vtiEnvironment) throws SQLException

Get the estimated cost for a single instantiation of a Table Function.

Parameters
vtiEnvironment:VTIEnvironment

The state variable for optimizing the Table Function.

Returns:double

The estimated cost for a single instantiation of the Table Function.

Exceptions
SQLException:
thrown if the costing fails.
getEstimatedRowCountback to summary
public double getEstimatedRowCount(VTIEnvironment vtiEnvironment) throws SQLException

Get the estimated row count for a single scan of a Table Function.

Parameters
vtiEnvironment:VTIEnvironment

The state variable for optimizing the Table Function.

Returns:double

The estimated row count for a single scan of the Table Function.

Exceptions
SQLException:
thrown if the costing fails.
supportsMultipleInstantiationsback to summary
public boolean supportsMultipleInstantiations(VTIEnvironment vtiEnvironment) throws SQLException

Find out if the ResultSet of the Table Function can be instantiated multiple times.

Parameters
vtiEnvironment:VTIEnvironment

The state variable for optimizing the Table Function.

Returns:boolean

True if the ResultSet can be instantiated multiple times, false if can only be instantiated once.

Exceptions
SQLException:
thrown if the costing fails.