QuestDB attempts to implement standard ANSI SQL. We also attempt to be PostgreSQL compatible, although some of it is work in progress. This page presents the main extensions we bring to SQL and the main differences that one might find in SQL but not in QuestDB's dialect.
We have extended SQL language to support our data storage model and simplify semantics of time series queries.
LATEST BY is a clause introduced to help
DELETE operations within an append-only framework.
Timestamp search can be performed with regular operators, e.g
However, QuestDB provides a
native notation which is faster
and less verbose.
select * from is optional. So
SELECT * FROM tab; achieves the
same effect as
select * from makes SQL look more complete, there
are examples where its optionality makes things a lot easier to read.
GROUP BY clause is optional and can be omitted as the QuestDB optimiser
derives group-by implementation from
In standard SQL, users might write a query like the below.
However, enumerating subset of
SELECT columns in the
GROUP BY clause is
redundant and therefore unnecessary. The same SQL in QuestDB SQL-dialect can be
Let's look at another more complex example using
HAVING in standard SQL.
In QuestDB's dialect,
select * from optionality and featherweight sub-queries
come to the rescue to create a smaller, more readable query, without unnecessary
HAVING functionality can be obtained implicitly as