Query Engine
Dune utilizes a fork of TrinoSQL to power DuneSQL. DuneSQL is a custom built query engine that is optimized for blockchain data.
DuneSQL Features
DuneSQL offers several useful features for working with blockchain data:
- Blockchain varbinary data types: Designed for storing addresses, hashes, and other encoded data.
- Native support for uint256 and int256 data types: Ideal for handling large numbers commonly found in blockchain data, with built-in functions for ease of use.
- Columnar storage format Optimized for fast reads, this format organizes data in columns rather than rows, enabling quick access to single columns for aggregation or filtering.
- Querying a query: DuneSQL allows you to query a query, which is great for creating reusable queries, building up complex queries, and reusing queries as views.
Using DuneSQL
DuneSQL is our query engine for blockchain data. It is a fork of TrinoSQL, which is an open-source, distributed SQL query engine for running interactive analytic queries against data sources of all sizes ranging from gigabytes to petabytes.
We maintain extensive documentation for DuneSQL Here you will be able to find:
Functions and Operators
A reference guide to DuneSQL functions and operators.
Data Types
A reference guide to DuneSQL data types.
Reserved Keywords
A list of reserved keywords in DuneSQL.
Writing Efficient Queries
An efficient query-writing process requires knowledge of how DuneSQL and data storage works.
Querying a Query
DuneSQL allows you to query a query, which is great for creating reusable queries, building up complex queries, and reusing queries as views.
Materialized Views
Learn how to create and use materialized views in DuneSQL for improved query performance.
Resources and Support
For assistance with DuneSQL, consider the following resources:
- Google search for TrinoSQL-related queries
- Talk to your favorite AI assistant about TrinoSQL-related questions
- the official Trino docs - Functions and Operators
Was this page helpful?