-
Notifications
You must be signed in to change notification settings - Fork 12
SQL Execution Plan
DeveelDB implements the standard ANSI/ISO SQL-99 and defines a set of database objects, statements and expressions that are used to manage the system and interact with the data stored.
There are several kind of database objects in a DeveelDB system, and some are dependent from others (for instance, a user type depends on tables).
A special contract determines how the system should find and manage them: these are the IObjectManager
implementations: object managers are services registered at the moment of building a database system and are intended as providers for the objects (to find existing) or creators/destroyers.
The default system builder provides a default set of object managers for all the foundation object types (see the list below): a user can redefine an object manager before the system is built, but special attention must be taken.
- Tables
- Views
- Types
- Variables (Transient and Persistent)
- Rows
- Columns
- Triggers (Callback and Procedural)
- Sequences (Native and User-Defined)
- Routines (Functions and Procedures)
- Cursors
- Schemata
To interact with the objects of a database, a user must invoke some defined SQL statements, that can be constructed programmatically or as a result of the parsing of a SQL text command. A statement is a single command within a request context, that can be executed at the top level of a query or even inside a programmed block of code (eg. the PL/SQL block of a routine or a trigger).
DeveelDB provides the contract IStatement
to identify SQL statements, that can be extended by the IPreparableStatement
contract, to indicate a statement requires a special preparation before being executed (for example, to qualify the name of a table to access, to execute the call to a function, etc.). Since statements can be the containers for expressions (and in most of the cases they are), they are often extended by the IPreparable
interface, that allows the preparation of the expressions contained, before the execution.
Because of this schema, before the execution of a statement, the system prepares the statement with specialized calls, returning an object ready to be executed.
In case of stored programming blocks (eg. the body of a trigger or the body of a routine), the system prepares the statements that form the blocks and saves the prepared version of the statement, that will be executed in the subsequent calls.
Code blocks are formed of multiple statements and they consist of a sequence of commands that are executed in a context.
These blocks can be part of a whole larger context (eg. a trigger body) or being defined at execution time by the user (eg. a BEGIN ... END
block).
Each block defines a new execution context, in which variables defined within it are stored, retrieved and disposed at its end.
Loops are special blocks, which are executed according to some specific conditions
- Getting Started
- Basic Principles
- Operative Contexts
- Transactions
- Database Objects
- Data Types
- SQL Execution Plan
- SQL Model
- DeveelDB SQL Dialect
- Data Types
- Routines (Functions and Procedures)
- Collaborate
- Kernel Development
- External Contributions
- Bug Reporting
- Documentation