Count
count.co
  • Getting Started
    • What is Count?
    • Count FAQ
    • Intro to your workspace
    • Example canvases
    • Getting started guides
      • Set up your workspace and projects
        • 1. Review workspace settings
        • 2. Create and organise your projects
      • Canvas orientation
      • Your first ad hoc analysis
        • 1. Examples and templates
        • 2. Build your first queries
        • 3. Create visuals
        • 4. Caching, local cells and scheduling
        • 5. Collaborating with a stakeholder
      • Your first report
        • 1. Examples and templates
        • 2. Filters and control cells
        • 3. Sharing your report
        • 4. Alerts
  • Connect your data
    • Database connection overview
      • Athena
      • Azure Synapse
      • BigQuery
      • Databricks
      • Microsoft SQL Server
      • MySQL
      • PostgreSQL
      • Redshift
      • Snowflake
    • Refresh database schema
    • Upload CSV files
    • dbt integration
      • ☁️dbt Cloud integration
      • 👩‍💻dbt Core integration
  • Import & Export
    • Import from other tools
      • Import Miro files
      • Import SQL files
      • Import Google Sheets
      • Import Jupyter notebooks
    • Export code and results
      • Export compiled SQL and Jinja-SQL
      • Export CSV files
      • Export images and PDF files
  • THE CANVAS
    • Navigating the canvas
      • Canvas tool bar
      • Data sidebar
      • Customizing the canvas
    • Canvas objects
      • Cells
      • Text and markdown
      • Shapes and tools
      • Sticky notes
      • Frames
      • Images
      • Embeds
      • Stamps
      • Grouping objects
      • Object order and alignment
      • Locking objects
      • Scaling objects
      • Shared styles
    • Overviews
    • Templates
    • Count AI
    • Alerts and subscriptions
      • Slack integration
    • Keyboard shortcuts
  • Querying data
    • Cells overview
      • Dynamic query compilation engine
    • SQL cells
      • Referencing other cells
      • Jinja templating
      • SQL formatting
    • Python cells
    • Visual and low-code cells
      • Calculations in visuals and low-code cells
      • Joins in visuals and low-code cells
    • Control cells
      • Single and multiple selects
      • Date controls
      • Text, number, and boolean controls
      • Custom control cells
    • Local DuckDB cells
      • DuckDB on the server
    • Query caching and scheduling
    • Manage queries and results
    • Troubleshooting
  • Visualizing data
    • Visualization overview
    • Templated visuals
    • Custom visuals
      • Marks
      • Facet
      • Subplots
      • Style
      • Filters
    • Formatting a visual
      • Axes
        • Secondary Axis
      • Colors and labels
      • Legends
      • Tooltips
    • Column summaries
    • Dynamic text
    • Every Visual Under the Sun
  • Presenting and Reporting
    • Reports and Slides
  • Count Metrics
    • Intro to Count Metrics
    • Build and edit a catalog
    • Views
      • Creating views
      • Customizing views
    • Datasets
      • Creating datasets
    • Save changes to the catalog
      • Catalog validation
      • Version control
    • Exposing catalogs to the workspace
    • Caching in Count Metrics
    • Using the catalog
      • Explore from cell
  • Sharing and Permissions
    • Real-time collaboration
    • Comments
    • Sharing permissions
    • Shared links
    • Embedding canvases
  • History and Versions
    • Version control
    • Duplicating and merging
    • Data snapshots
  • Settings and administration
    • Workspace settings
      • Workspace members
      • Groups
      • Tags
      • Billing
      • Single sign-on (SSO)
        • Okta
        • Entra ID
        • JumpCloud
        • Google
        • Generic OIDC
      • Brand
    • Connection settings
    • Project settings
    • User settings
    • Roles and permissions
  • Quick guides
    • Interactive control guides
      • Date ranges
      • Date groupings
      • Search
      • Select All
  • Resources
    • Join the Slack community
  • Blog
  • Security overview
  • Terms of use
  • Pricing FAQ
Powered by GitBook
On this page
  • Introduction
  • Query lifecycle
  • Run a new query
  • Prevent query execution
  • Cancel running queries
  • How query cancellation works
  • Cancel queries in a canvas
  • Cancel queries for a connection
  • Manage query results
  1. Querying data

Manage queries and results

Control when queries are executed, and how to access their results.

PreviousQuery caching and schedulingNextTroubleshooting

Last updated 2 months ago

Introduction

Most of the time when using Count, it isn't necessary to monitor query execution - the appropriate queries will be submitted automatically based on your changes to cells and other canvas objects.

In some cases it may be important to control exactly which queries are executed - for example, if the query is expensive or your database is expected to be under heavy load. Below you can read more about the query lifecycle in Count, and how to control queries and their results.

Query lifecycle

When a query begins executing in a Count cell or visual, the current state of the query is displayed in the output area:

The stages are:

  • Connecting - your browser has asked for a query to be submitted. If other queries for the same connection are also waiting to be executed, the number of waiting queries will also be displayed.

  • Running query - Count has sent the query to your database, and is waiting for the results. The displayed execution time includes both the time spent running the query, and the time spent retrieving the results.

  • Compressing results - Count has received the result set for the query, and is compressing it.

  • Downloading results - your browser has been notified that the query results are ready, and has begun downloading them.

Some of these steps may be skipped or display different information in the following cases:

  • Connecting - for local DuckDB or Python cells, this step also includes the time spent loading the database or Python instance, and waiting for upstream cells to finish executing.

  • Compressing results - this step may be skipped if the query results are small.

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:

Cancel running queries

Count supports query cancellation for all database connections. Currently-executing queries can be viewed and cancelled from the settings pages for each connection.

How query cancellation works

The effectiveness of cancelling a query from Count may depend on the database connection used, and in which step the cancellation was requested:

  • Connecting - cancelling a query during this step should always succeed, as the query has not started execution yet.

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

Cancel queries in a canvas

If your role allows you to edit a canvas, the option to cancel all pending canvas queries will be available in the data menu:

Cancel queries for a connection

If your role allows you to edit a database connection, you are able to cancel all queries for that connection:

  • From the connection page, select See all from the queries section in the sidebar to view running queries.

  • Select one or more queries, then choose Cancel queries and confirm the cancellation

When contacting Count support about a running query, please include the debug information about the query from the context menu:

Manage query results

By default, all cells in Count apply a limit of 10,000 rows in the SQL that is sent to your database to minimise the time spent transferring large result sets.

This default behaviour can be changed from the Row limit settings in the Design sidebar:

Selecting the Unlimited option will remove the 10,000 row limit from the SQL query, and Count will continue to fetch results until they are complete, or their uncompressed size reaches the limit configured for your workspace (this default limit is 128MB).

  • Browser download limit - set this option to a number to limit the number of rows that are downloaded to your browser, or delete the number to download all results. If the results are small and the Compressing step of the query is skipped, Count will ignore this row download limit and download the complete result set.

Downloading all results to your browser may take a long time if the results are large

Running query - this step may be skipped if are available for the cell.

It is strongly recommended to enable of results if using the Unlimited setting, to avoid frequent re-execution of long-running queries.

cached results
caching
The various states of a query as represented in a cell output.
Re-run all of the cells in the canvas.
Disable automatic cell execution from the right sidebar.
Cancel all running queries in a canvas.
Cancel running queries from the connection page.
Access query debug information from the query context menu.