Materialized tables are a way to store the results of a query in a table that can be queried like any other table. This is useful when you have a query that takes a long time to run, or when you want to use the results of a query in another query.
The “Materialized View” feature on Dune allows you to use an existing query’s results as table in another query. This functionality enables you to build your own simple data pipeline inside of Dune. This feature is especially useful when you have a query that takes a long time to run, or when you want to use the results of a query in another query. Instead of running the same query pattern over and over again, you can run it once and then use the results in other queries.
You should think of using this feature any time you run into:
solana.transactions
or ethereum.traces
)This feature will help you to avoid these issues and save time and credits.
Write a new query or go to an existing query. (We suggest creating via team context on a plan with sufficient credits)
SELECT count(*)
will not work)You can find the example query here, and it can be queried with just:
Wait for a materialized view to finish creation first. It should be roughly similar to the time the query normally takes to execute - maybe a bit longer due to time it takes to write the new table.
Query the materialized view via dune.<username>.result_<given_name>
.
If your username starts with a number, you’ll need to wrap the <username> in quotes i.e. dune."21co".result_stablecoin_total_supply_on_ethereum
When you query a materialized view in another query, it does not rerun the materialized view (unlike query views).
You can find your matviews either in the data explorer, or in your library. The table name can always be found on the query if you click into the query and then open the matview settings.
name
in quotes i.e. dune."21co".result_stablecoin_total_supply_on_ethereum
Materialized tables are a way to store the results of a query in a table that can be queried like any other table. This is useful when you have a query that takes a long time to run, or when you want to use the results of a query in another query.
The “Materialized View” feature on Dune allows you to use an existing query’s results as table in another query. This functionality enables you to build your own simple data pipeline inside of Dune. This feature is especially useful when you have a query that takes a long time to run, or when you want to use the results of a query in another query. Instead of running the same query pattern over and over again, you can run it once and then use the results in other queries.
You should think of using this feature any time you run into:
solana.transactions
or ethereum.traces
)This feature will help you to avoid these issues and save time and credits.
Write a new query or go to an existing query. (We suggest creating via team context on a plan with sufficient credits)
SELECT count(*)
will not work)You can find the example query here, and it can be queried with just:
Wait for a materialized view to finish creation first. It should be roughly similar to the time the query normally takes to execute - maybe a bit longer due to time it takes to write the new table.
Query the materialized view via dune.<username>.result_<given_name>
.
If your username starts with a number, you’ll need to wrap the <username> in quotes i.e. dune."21co".result_stablecoin_total_supply_on_ethereum
When you query a materialized view in another query, it does not rerun the materialized view (unlike query views).
You can find your matviews either in the data explorer, or in your library. The table name can always be found on the query if you click into the query and then open the matview settings.
name
in quotes i.e. dune."21co".result_stablecoin_total_supply_on_ethereum