SQL #
The SQL dialect is based on ANSI SQL
, PostgreSQL
and extended with unique features, such as
native JSON support and Lambda aggregates.
Amelie has a unique architecture for full parallelization and lockless transaction processing. It treats local machine CPU cores as distributed system nodes, sharding, partitioning, and generating parallel group plans for all queries.
Learn more about How it Works.
Transactions #
Amelie supports non-interactive deterministic distributed multi-statement ACID transactions, in which all transaction statements (including BEGIN/COMMIT) must be provided for execution.
Amelie is designed for short ACID transactions and fast real-time analytics. It is not intended for long, complex, multi-statement transactions or queries that generate large amounts of data. There are configurable limits for transaction size.
Unless transaction is a basic expression or DDL
command, it will be executed by
one or more backend workers.
All transactions always operate on a STRICT SERIALIZABLE
level.
EXPLAIN/PROFILE commands can be used to get more details about the transaction and its bytecode.
Tables #
Amelie supports two types of tables: PARTITIONED
and SHARED
.
By default, all tables are PARTITIONED
and distributed. Partitions will be created on each backend worker for
parallel access or modification. Partitioned tables has some limitations.
SHARED
tables are not partitioned (single partition) and are available for concurrent direct read access from any backend worker.
The purpose of shared tables is to support efficient Parallel JOIN.
Learn more about the Partitioned and Shared tables.
DDL #
Currently DDL commands cannot be part of a multi-statement transactions.
DDL operations, such as CREATE or DROP TABLE, require an exclusive lock. The lock is taken in coordination with other sessions first.
Operations such as CREATE INDEX and ALTER TABLE ADD COLUMN are blocking but completely parallel. Each backend worker will be involved in creating an index for its partitions.
DML #
The INSERT / UPSERT, UPDATE and DELETE operations are distributed and will transactionally update table partitions on one or more backends.
DML operations can be part of a multi-statement transaction.
Select #
The SELECT operation is distributed and transactional and will be executed on one or more backends if tables are involved.
Operations such as GROUP BY
, ORDER BY
and JOIN
will be executed individually per
backend in parallel. After the successful execution, the results of each computation are merged together,
processed, and returned.
Native JSON Support #
- JSON arrays and objects can be constructed without functions using the
[]
,{}
operators - JSON fields can be accessed directly without functions using the
.
and[
operators - JSON columns can store any JSON value (not only object) and is using memory efficient encoding
- Select expressions and subqueries can be executed natively inside JSON objects
Learn more about JSON expressions.
Lambda #
Lambda is a unique construct that combines the functionality of a function and an aggregate function with a state. Lambda expressions can help work with JSON and do some non-trivial transformations.
Learn more about Lambda.