|
| 1 | +--- |
| 2 | +title: Executions |
| 3 | +description: When and how do queries on Dune get executed? |
| 4 | +--- |
| 5 | + |
| 6 | +# Overview |
| 7 | + |
| 8 | +**Queries on Dune need to be triggered and will be executed on one of our query engines.** |
| 9 | + |
| 10 | +Query executions can be triggered by any user/team in Dune for public queries and by the owner of the query for private queries. Query executions can be triggered through the query editor, the dashboard editor, or via the API. We also automatically refresh popular dashboards automatically in regular intervals. |
| 11 | + |
| 12 | +The query engine determines the amount of resources allocated to your query. The larger the query engine, the more resources are allocated to your query. This means that queries executed on a larger query engine will run faster and are less likely to time out. |
| 13 | + |
| 14 | +## Query executions triggers |
| 15 | + |
| 16 | +Query executions on Dune are triggered in four ways: |
| 17 | + |
| 18 | +1. **Interactive executions** are manually triggered by a user clicking the "Run" button in the query editor page or refreshing an entire dashboard. Interactive executions can be routed via the community, medium, or large cluster, depending on the query engine selected. |
| 19 | + |
| 20 | +2. **Scheduled executions** are triggered at a specific time and frequency. Scheduled executions can be routed via the medium or large cluster, depending on the execution tier selected. |
| 21 | + |
| 22 | +3. **API executions** are triggered by an API call. API executions can be routed via the community, medium, or large cluster, depending on the query engine selected. |
| 23 | + |
| 24 | +4. **Popular dashboards** are automatically refreshed based on their popularity. We measure popularity based on the number of views a dashboard has received. The most popular dashboards are refreshed every 30 minutes, the least popular dashboards are refreshed every 6 hours. Popular dashboards are refreshed via the community cluster. |
| 25 | + |
| 26 | + |
| 27 | +<div class="cards grid" markdown> |
| 28 | + |
| 29 | +- #### Interactive executions |
| 30 | + |
| 31 | + --- |
| 32 | + |
| 33 | + Trigger: user clicks "Run" button in query editor or refreshes dashboard |
| 34 | + |
| 35 | + [→ Interactive executions](../app/query-editor/query-window.md) |
| 36 | + |
| 37 | +- #### Scheduled executions |
| 38 | + |
| 39 | + --- |
| 40 | + |
| 41 | + Trigger: scheduled dashboard or query |
| 42 | + |
| 43 | + [→ Scheduled executions](../app/query-editor/query-scheduler.md) |
| 44 | + |
| 45 | +- #### API executions |
| 46 | + |
| 47 | + --- |
| 48 | + |
| 49 | + Trigger: API call |
| 50 | + |
| 51 | + [→ API executions](../api/api-reference/execute-queries/index.md) |
| 52 | + |
| 53 | +- #### Popular dashboards |
| 54 | + |
| 55 | + --- |
| 56 | + |
| 57 | + Trigger: Dashboard popularity |
| 58 | + |
| 59 | + |
| 60 | +</div> |
| 61 | + |
| 62 | + |
| 63 | +## Query engine size |
| 64 | + |
| 65 | +Dune has three query engine sizes: community, medium, and large. The query engine size determines the amount of resources allocated to your query. The larger the query engine, the more resources are allocated to your query. This means that queries executed on a larger query engine will run faster and are less likely to time out. |
| 66 | + |
| 67 | +### Community engine |
| 68 | + |
| 69 | +The community engine is the default query engine for all queries on Dune. It is a shared cluster, meaning that it is used by all Dune users. This means that the community cluster can be busy at times, which can lead to long loading times for the viewer if the query is resource-intensive. In the worst case, the query may even time out. |
| 70 | + |
| 71 | +### Medium engine |
| 72 | + |
| 73 | +The medium engine is built to handle most queries on Dune. It is cheap, reliable and fast. The medium engine will scale up and down depening on the demand. In contrast to the community engine, that means that running a query on the medium engine will not be affected by other users' queries. |
| 74 | + |
| 75 | +### Large engine |
| 76 | + |
| 77 | +The large engine is built to handle the most resource-intensive queries on Dune. It's blazing fast, reliable and can easily deal with large amounts of data. The large engine also scales up and down depending on the demand. Running a query on the large engine will not be affected by other users' queries. |
| 78 | +In addition to that, the large engine is also the only engine that can handle queries that requires lots of planning time. This mostly happens when you query a large amount of data, when you use a lot of joins or large aggregate window functions. |
| 79 | + |
0 commit comments