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
  • Caching
  • Local cells
  • Scheduling
  • FAQ
  1. Getting Started
  2. Getting started guides
  3. Your first ad hoc analysis

4. Caching, local cells and scheduling

Now you've started building some queries, let's consider how we can optimise your canvas performance (before you go too far!)

Previous3. Create visualsNext5. Collaborating with a stakeholder

Last updated 8 months ago

Using a combination of caching, local cells and scheduled queries you'll be able to explore your data more quickly - you're not waiting for your database to execute a query every time a cell changes, instead it all happens really fast in your browser.

Caching

Caching your results means that your query results are stored in the canvas. This means when your canvas is refreshed, or someone else joins your canvas, the queries aren't run against your database again, and so will load immediately (showing the results from when they last ran against the database). When you query the results of your cached data using local cells (DuckDB or Python), these queries execute much more rapidly because they're running locally in your browser.

How to set up/update caching in your canvas
  1. Click on the play icon in the top right corner of your canvas

  2. Select the option "Caching settings..."

  3. Choose how long you want your cached results to be saved for

    The most performant option is typically 'Cache results indefinitely' which will only refresh a query when prompted or when an upstream cell is also updated.

Local cells

Local cells (DuckDB or Python) run in-memory in your browser. This means you can query cached database results immediately, and you don't have to wait for your query to be returned from your database.

It's important to be aware that there is a limit on the amount of data that a cell can return (approximately 120MB), so it's best to get your results down to a reasonable size before switching to DuckDB.

If you're unable to reduce the size of your data, you can still make use of local cells to first prototype locally then revert back to live data on your database for the full results.

How to use local cells alongside caching to improve performance
  1. Create your base cell (the cell that is returning the data from your database).

  2. Create a second cell.

  3. Change the data source to local (using the right hand design bar)

    These results should be almost instantaneous because the local cell is querying the results from the database cell its referencing, rather than your database directly.

Scheduling

With scheduling you set your canvas to automatically run at a specific interval. For example, you may want to set your queries to refresh every morning at 7AM before other canvas viewers typically open your canvas. If the rest of your canvas is set up to heavily make use of local cells, then when users come in later in the day they'll not be querying your database, meaning canvases run fast for the user, and the database load (and potentially costs) are lower.

FAQ

How do I update a cell if caching is enabled?

If you ever need to refresh your results from your database, you can click on any cell, select the play button just above, and select Run cell.

What causes a cell to re-execute when caching is enabled?

When a cell input is edited, Count will re-compile the SQL query and compare it to the previous one. If the SQL has changed, then a new query will be executed.

Changes that consist only of whitespace alterations will not cause a new query to be executed.

Can I use caching and local cells by default?

Yes! For caching, you can set this in your workspace settings.

For DuckDB - you can set by default at a connection setting level to Use DuckDB by default for visuals.

Where is cached data stored?

💡 Learn more about caching and scheduling in our .

Cached data is stored in-memory on our servers, and sometimes also saved to disk for longer caching periods. Stale cached data is periodically deleted. Read more about data security .

guides here
here