public interface VTICosting
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.
VTIEnvironment
Modifier and Type | Field and Description |
---|---|
static double |
defaultEstimatedCost
A useful constant: The default estimated cost of instantiating and
iterating throught a Table Function.
|
static double |
defaultEstimatedRowCount
A useful constant: the default estimated number of rows returned by a
Table Function.
|
Modifier and Type | Method and Description |
---|---|
double |
getEstimatedCostPerInstantiation(VTIEnvironment vtiEnvironment)
Get the estimated cost for a single instantiation of a Table Function.
|
double |
getEstimatedRowCount(VTIEnvironment vtiEnvironment)
Get the estimated row count for a single scan of a Table Function.
|
boolean |
supportsMultipleInstantiations(VTIEnvironment vtiEnvironment)
Find out if the ResultSet of the Table Function can be instantiated multiple times.
|
static final double defaultEstimatedRowCount
static final double defaultEstimatedCost
double getEstimatedRowCount(VTIEnvironment vtiEnvironment) throws java.sql.SQLException
vtiEnvironment
- The state variable for optimizing the Table Function.java.sql.SQLException
- thrown if the costing fails.double getEstimatedCostPerInstantiation(VTIEnvironment vtiEnvironment) throws java.sql.SQLException
vtiEnvironment
- The state variable for optimizing the Table Function.java.sql.SQLException
- thrown if the costing fails.boolean supportsMultipleInstantiations(VTIEnvironment vtiEnvironment) throws java.sql.SQLException
vtiEnvironment
- The state variable for optimizing the Table Function.java.sql.SQLException
- thrown if the costing fails.Apache Derby 10.10 API Documentation - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.