Package org.apache.derby.vti

Support for Table Functions.

See:
          Description

Interface Summary
DeferModification This interface is implemented by a read/write VTI class that wants to control when modifications to the VTI are deferred, or to be notified that a it is to be modified.
IFastPath An internal api for VTIs to allow VTI's written in terms of the datatype system, e.g. returning rows.
IQualifyable  
Pushable Support for pushing SQL statement information down into a virtual table.
RestrictedVTI Interface for Table Functions which can be told which columns need to be fetched plus simple bounds on those columns.
VTICosting VTICosting is the interface that the query optimizer uses to cost Table Functions.
VTIEnvironment VTIEnvironment is the state variable created by the optimizer to help it place a Table Function in the join order.
 

Class Summary
Restriction An expression to be pushed into a Table Function so that the Table Function can short-circuit its processing and return fewer rows.
Restriction.AND An AND of two Restrictions
Restriction.ColumnQualifier A simple comparison of a column to a constant value.
Restriction.OR An OR of two Restrictions
UpdatableVTITemplate An abstract implementation of PreparedStatement (JDBC 3.0) that is useful when writing a read-write (updatable) virtual table interface (VTI).
VTIMetaDataTemplate An abstract implementation of ResultSetMetaData (JDBC 1.2) that is useful when writing a VTI (virtual table interface).
VTITemplate An abstract implementation of ResultSet (JDK1.1/JDBC 1.2) that is useful when writing a read-only VTI (virtual table interface) or for the ResultSet returned by executeQuery in read-write VTI classes.
 

Package org.apache.derby.vti Description

Support for Table Functions.

Derby lets you declare functions which return ResultSets. You can then use these function results as tables in your queries. This, in turn, lets you do the following:

Here is an example of how to declare and invoke a Table Function:


CREATE FUNCTION externalEmployees
()
RETURNS TABLE
(
  employeeId    INT,
  lastName       VARCHAR( 50 ),
  firstName      VARCHAR( 50 ),
  birthday         DATE
)
LANGUAGE JAVA
PARAMETER STYLE DERBY_JDBC_RESULT_SET
NO SQL
EXTERNAL NAME 'com.acme.hrSchema.EmployeesTable.read'
;

INSERT INTO employees
  SELECT s.*
    FROM TABLE (externalEmployees() ) s;

The Derby optimizer makes some assumptions about these Table Functions:

Based on these assumptions, the optimizer decides where to place the Table Function in the join order. Using the interfaces in this package, you may override the optimizer's guesses and force the optimizer to choose a better join order.


Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.