The SQL statement that references a UDF goes through query processing
states in the SAP Sybase IQ server. In each of these states, the server
uses the v4 API to communicate and negotiate with the UDF.
Initial State
Initial state on the server. The only UDF method called during the Initial state is _start_extfn.
Annotation State
During the annotation state the server updates the parse tree with the metadata necessary for efficient and correct query optimization.
Query Optimization State
During the Optimization state, the server is in the initial process of constructing a query plan. The server collects schema information and some preliminary statistical information.
Plan Building State
.During the plan building state, the server builds the query execution plan based on the best plan found during the query optimization state.
Execution State
During the execution state, the server makes an execution call into the UDF.