Manage query execution

Control when queries are executed in your workspace

Introduction

The default behaviour in Count is to keep cell results in-sync with the cell. This means that any time a cell is edited in a way that would cause the results to change, a new query is submitted.

If caching is enabled in your workspace, a query submission may not trigger a query on your database if the same query has been executed recently within the caching period that has been configured for the canvas.

It is possible to override this default behaviour using the following methods:

Run a new query

When it is important to see the latest data for a cell, it is possible to tell Count to bypass any cache, and send a new SQL query to your database. If caching is enabled, the cached results will be updated at this point.

  • Clicking the Run cell button above any selected cells will execute those cells. (Note that choosing this option will also re-enable cell execution if it has been disabled previously).

  • Clicking the Refresh all results button in the canvas query menu will re-execute all canvas cells.

Prevent query execution

If it is important to reduce load on your database at the expense of result freshness, it is also possible to prevent cells from executing in response to changes:

  • Click the Disable cell execution button underneath the Run cell menu to prevent that cell executing automatically in the future.

  • Deselect the Execute cells automatically option in the canvas query menu to prevent all cells in the canvas from executing automatically.

If a cell is prevented from executing automatically, it will show a message with an option to execute the query. If the cell is connected to a BigQuery connection, it will also show an estimate of the amount of data that will be processed by the query:

Cancelling running queries

Count currently supports query cancellation for the following database connections:

Cancel queries in a canvas

If your role allows you to edit a canvas, and the canvas contains one of the supported databases above, the option to cancel all pending canvas queries will be available in the data menu:

Cancel queries in a connection

If your role allows you to edit a database connection, you are able to cancel all queries running in all canvases for that connection from the button at the bottom of the connection settings:

As this action can cause errors in many canvases, it must be confirmed from the pop-up dialog:

How query cancellation works

The effectiveness of cancelling a query from Count may depend on the database connection used, and when the cancellation was requested.

The lifetime of a query proceeds as follows:

  • A query is submitted from a canvas and queued up to be executed - cancelling within this window will always succeed, though this time period is often short.

  • Count requests a slot from your database to execute the query - cancelling within this window will always succeed, and the duration of this period can vary depending on your database and the current load on it.

  • The query is submitted to your database - cancellation from Count is not always guaranteed for some database types, though the cancellation request is always sent to your database.

Last updated