QuestDB provides a comprehensive set of SQL functions organized by category. All functions are implemented in zero-GC Java for high performance.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/questdb/questdb/llms.txt
Use this file to discover all available pages before exploring further.
Function Categories
Date and Time Functions
Manipulate timestamps, dates, and time intervals. QuestDB supports microsecond and nanosecond precision. View Date/Time Functions Key functions:now()- Current timestampdate_trunc()- Truncate timestamp to specified unityear(),month(),day()- Extract date partstimestamp_floor()- Floor timestamp to intervaldateadd()- Add interval to timestamp
Aggregation Functions
Compute aggregate values across rows in GROUP BY queries. View Aggregation Functions Key functions:count()- Count rowssum(),avg()- Sum and averagemin(),max()- Minimum and maximumstddev(),variance()- Statistical functionsstring_agg()- Concatenate strings
String Functions
Manipulate string, varchar, and symbol types. View String Functions Key functions:concat()- Concatenate valueslength()- String lengthupper(),lower()- Case conversionsubstring()- Extract substringreplace()- Replace text
Numeric Functions
Mathematical operations and transformations. View Numeric Functions Key functions:abs(),sign()- Absolute value and signround(),ceil(),floor()- Roundingsqrt(),pow()- Power functionssin(),cos(),tan()- Trigonometry
Finance Functions
Specialized functions for orderbook and market data analysis. View Finance Functions Key functions:mid()- Mid price calculationspread()- Bid-ask spreadvwap()- Volume-weighted average pricetwap()- Time-weighted average price
Function Signatures
Function signatures in QuestDB use type notation:D- DOUBLEI- INTL- LONGS- STRINGN- TIMESTAMP (any precision)V- Variable argumentss- STRING constant
Example
round() takes a DOUBLE and an INT parameter.
NULL Handling
Most functions returnNULL when any input is NULL. Exceptions are documented in individual function references.
Performance Considerations
SIMD Acceleration
Many aggregation functions use SIMD instructions for vectorized computation:sum(),avg(),min(),max()- Statistical functions like
stddev(),variance()
Constant Folding
The query optimizer evaluates constant expressions at compile time:Runtime Constants
Functions likenow() are evaluated once per query execution, not per row:
Type Casting
QuestDB supports explicit type casting with:: syntax: