Lava query execution

Execution of a Lava query plan involves five phases:

  1. Acquire – acquires resources needed for execution, such as memory buffers and creating worktables.

  2. Open – prepares to return result rows.

  3. Next – generates the next result row.

  4. Close – cleans up; for example, notifies the access layer that scanning is complete or truncates worktables

  5. Release – releases resources acquired during Acquire, such as memory buffers, drops worktables.

Each Lava operator has a method with the same name as the phase, which is invoked for each of these phases.

Figure 1-2 demonstrates query plan execution:

After successfully completing the Release phase of execution, the Lava query engine returns control to the Procedural Execution Engine for final statement processing.