In Adaptive Server, all query plans are submitted to the procedural execution engine for execution. The Procedural Execution Engine drives execution of the query plan by:
Executing simple SQL statements such as set, while, and goto directly.
Calling out to the utility modules of the query plan to execute create table and create index and other utility commands.
Setting up the context for and driving the execution of stored procedures and triggers.
Setting up the execution context and calling the query execution engine to execute query plans for select, insert, delete, and update statements.
Setting up the cursor execution context for cursor open, fetch, and close statements, and calling the query execution engine to execute these statements.
Doing transaction processing and post execution cleanup.
To support the demands of today’s applications, the query execution engine for Adaptive Server 15.0 and later has been completely rewritten. With a new query execution engine and query optimizer in place, the procedural execution engine in Adaptive Server 15.0 and later passes all query plans generated by the new query optimizer to the Lava query execution engine.
The Lava query execution engine executes Lava query plans. All query plans chosen by the optimizer are compiled into Lava query plans. However, SQL statements that are not optimized, such as set or create, are compiled into query plans like those in versions of Adaptive Server earlier than 15.0, and are not executed by the Lava query execution engine. Non-Lava query plans are either executed by the procedural execution engine or by utility modules called by the procedural engine. Adaptive Server version 15.0 and later has two distinct kinds of query plans and this is clearly seen in the showplan output (see Chapter 3, “Displaying Query Optimization Strategies and Estimates”).