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.
org.apache.derby.vti.VTIEnvironment
| Modifier and Type | Field 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. |
| Modifier and Type | Method and Description |
|---|---|
| public double | Returns: The estimated cost for a single instantiation of the Table Function.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.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.The state variable for optimizing the Table Function. vtiEnvironment)Find out if the ResultSet of the Table Function can be instantiated multiple times. |
| defaultEstimatedCost | back to summary |
|---|---|
| public static final double defaultEstimatedCost A useful constant: The default estimated cost of instantiating and iterating throught a Table Function. | |
| defaultEstimatedRowCount | back to summary |
|---|---|
| public static final double defaultEstimatedRowCount A useful constant: the default estimated number of rows returned by a Table Function. | |
| getEstimatedCostPerInstantiation | back to summary |
|---|---|
| public double getEstimatedCostPerInstantiation(VTIEnvironment vtiEnvironment) throws SQLException Get the estimated cost for a single instantiation of a Table Function.
| |
| getEstimatedRowCount | back to summary |
|---|---|
| public double getEstimatedRowCount(VTIEnvironment vtiEnvironment) throws SQLException Get the estimated row count for a single scan of a Table Function.
| |
| supportsMultipleInstantiations | back to summary |
|---|---|
| public boolean supportsMultipleInstantiations(VTIEnvironment vtiEnvironment) throws SQLException Find out if the ResultSet of the Table Function can be instantiated multiple times.
| |