Flipside Docs
  • Welcome to Flipside!
    • Welcome to Flipside
    • Growth Services
    • Data
      • Choose your Flipside plan
        • Free
        • Builder
        • Pro
          • Get Started in Snowflake
          • Incremental Table Pattern
          • Copy Data from Snowflake to AWS
          • Copy Data from Snowflake to GCP
          • Copy Data from Snowflake to Azure
        • Snowflake Data Shares
          • Mounting a Snowflake Data Share
    • Earn
    • Community
  • Data
    • Flipside Data
      • Table Docs by Chain
      • Data Modeling Approach
      • Labels
        • Centralized Exchange Label Type
        • Decentralized Exchange Label Type
        • Operator Label Type
        • Chain Admin Label Type
        • Decentralized Finance Label Type
        • NonFungible Tokens Label Type
        • Games Label Type
        • Bridge Label Type
        • Decentralized Applications Label Type
        • Token Label Type
        • Flotsam Label Type
      • Tags
      • Table Freshness Targets
      • Contribute to Our Data
        • Contract Decoding & ABIs
        • How to Add Your Own Tags
        • Community Curation
          • Getting Started
            • Contribution Workflow
          • Model Standards
            • dbt Tips
          • PR Checklist
    • Data Products
      • Data Studio (SQL Analysts)
        • Get Started
          • Write/fork your first query
        • Flipside AI
        • Studio in Depth
          • Query Editor
            • Query Referencing
            • Pro Tips for Querying
            • Keyboard Shortcuts
            • Hex-to-Integer Function
          • Create a Chart
            • Advanced Visualization
          • Build a Dashboard
            • Markdown Reference
          • Team Accounts
        • Tutorials
          • How to Analyze Web3 Data
          • Video Tutorials
            • Overview of Schemas & Tables
            • Ethereum Tutorials
              • Getting Started with Decoded Ethereum Events
              • Getting Started with Ethereum Balances
              • Block Level and Daily Balances
              • Finding Centralized Exchange Flows
            • Solana Tutorials
              • Solana Schema & Tables: Video Walkthrough
              • Solana Specialty Tables: Video Walkthrough
              • Exploring Transactions in solana.events
            • THORChain Tutorials
              • THORChain Schema & Tables
              • Calculating IL for THORChain
          • More Tools & Resources
        • Get Inspired
      • LiveQuery
        • Get Started
        • LiveQuery in Depth
          • Functions
            • 🤝Partner Functions
            • 🧙‍♂️EVM Functions
              • 💡Seaport: Real-time Orders
              • 💡WETH Pool Balances
              • 💡General EVM Node Queries
            • 🤖API Functions
              • 💡Query TheGraph
              • 💡Query Defi Llama
            • ⚙️Utility Functions
              • 💡Hex Converters
              • 💡JSON RPC Request Builder
              • 💡EVM Logs Decoder
              • 💡Keccak256 Encoder
          • QuickNode Setup Guide
        • Secrets Manager
        • Get Inspired
      • Snowflake
      • API/SDK (Developers)
        • Get Started - Your first API call in < 2 min
        • SDK in Depth
          • JSON RPC methods
          • Run A Query
          • Query Results
          • Pagination
          • Sorting
          • Filtering
          • Query Seconds
          • Caching (maxAgeMinutes)
          • Rate Limits
          • Errors
          • More Examples
          • Archive
            • [ARCHIVED] JS/TS SDK
            • ShroomDK Migration Guide
            • [LEGACY] R
        • Tutorials
          • Have Questions?
        • Get Inspired
    • Insights and Tools
  • Earn
    • Flipside Earn
    • Onchain Rewards
      • Quests
    • Analyst Rewards
      • Top Dashboards
        • Top Dashboard Guidelines
        • Skill Tree
      • Ambassador Program
      • Direct to Analyst Commissions
    • Wallet Management
    • Tax Center
  • Support
    • General Support
    • Open a Ticket
      • That email doesn't look quite right
    • 🌟Product Special Releases
      • 2025
        • 2025-02-06 | EVM Blockchain Standardization
          • Table Change Overview
      • 2024
        • 2024-06-13 | Solana native and wrapped addresses
        • 2024-05-01 | Improvements to Pricing Data
          • Actions for Data Studio Users
          • Actions for API Users
          • Action for Data Share Users
    • 🗒️Release Notes
      • 2025
        • 2025-05-01 | Release Notes
        • 2025-04-17 | Release Notes
        • 2025-04-03 | Release Notes
        • 2025-03-20 | Release Notes
        • 2025-03-06 | Release Notes
        • 2025-02-20 | Release Notes
        • 2025-02-06 | Release Notes
        • 2025-01-23 | Release Notes
      • 2024
        • 2024-12-24 | Release Notes
        • 2024-12-12 | Release Notes
        • 2024-11-27 | Release Notes
        • 2024-11-14 | Release Notes
        • 2024-10-31 | Release Notes
        • 2024-10-03 | Release Notes
        • 2024-10-17 | Release Notes
        • 2024-09-19 | Release Notes
        • 2024-09-05 | Release Notes
        • 2024-08-22 | Release Notes
        • 2024-08-08 | Release Notes
        • 2024-07-25 | Release Notes
        • 2024-07-11 | Release Notes
        • 2024-06-27 | Release Notes
        • 2024-06-14 | Release Notes
        • 2024-05-30 | Release Notes
        • 2024-05-16 | Release Notes
        • 2024-05-02 | Release Notes
        • 2024-04-18 | Release Notes
        • 2024-04-05 | Release Notes
        • 2024-03-18 | Release Notes
        • 2024-03-05 | Release Notes
        • 2024-02-20 | Release Notes
        • 2024-02-05 | Release Notes
    • 📊Studio Change log
  • Flipside Community
    • Get Started
    • Ambassador Program
    • Join Our Discord
    • Join Our Guild
Powered by GitBook
On this page

Was this helpful?

  1. Data
  2. Data Products
  3. API/SDK (Developers)
  4. SDK in Depth

Query Seconds

PreviousFilteringNextCaching (maxAgeMinutes)

Last updated 1 year ago

Was this helpful?

Query Seconds represent computational time against Flipside's data warehouse, canonically referred to as a DataSource. Every QueryRun has the following life cycle.

A query run that is in the state QUERY_STATE_READY has been queued for execution. Once it begins execution it transitions to QUERY_STATE_RUNNING. From here it can transition to a number of states. If the query executes against the data source successfully it will transition to QUERY_STATE_STREAMING_RESULTS and begin downloading the query results for you to export.

If the query failed for any reason (syntax error, warehouse issue, etc.) the query will transition to a state of QUERY_STATE_FAILED. If the user decides to explicitly cancel the query the query run will be terminated and its state will transition to QUERY_STATE_CANCELED. Finally, if the QueryRun finishes downloading its results from the data source it will transition to QUERY_STATE_SUCCESS .

Given the above life-cycle for a QueryRun, let's walk thru a real example to determine how you might be billed for a query. Here is a query we're going to execute to find the address associated with an ENS domain.

SELECT
  origin_from_address
FROM ethereum.core.fact_event_logs
WHERE
  contract_address = lower('0x283af0b28c62c092c9727f1ee09c02ca627eb7f5')
  AND event_inputs:name = lower('{ens_domain}')
  AND event_name = 'NameRegistered'
  AND block_timestamp >= GETDATE() - interval'4 year'

This query will produce four different time stamps:

  1. TotalElapsedSeconds - the time difference between a terminal state (QUERY_STATE_SUCCESS , QUERY_STATE_FAILED or QUERY_STATE_CANCELED ), and QUERY_STATE_READY .

  2. StreamingSeconds - the time difference between QUERY_STATE_SUCCESS and QUERY_STATE_STREAMING_RESULTS

  3. ExecutionSeconds - the time difference between QUERY_STATE_STREAMING_RESULTS and QUERY_STATE_RUNNING

  4. QueuedSeconds - the time difference between QUERY_STATE_READY and QUERY_STATE_RUNNING

You are only debited/billed for ExecutionSeconds (#3) for a successfully run query. If your query fails or was canceled you are not billed for the ExecutionSeconds.

Let's assume this Query has never been executed, meaning no results exist, and as a result, a billable QueryRun is created.

This QueryRun executes successfully for a total of 18 seconds, here is the breakdown:

Breakdown
Seconds

StreamingSeconds

4

ExecutionSeconds

12

QueuedSeconds

1

Since you are only billed for ExecutionSeconds you would be debited for 12 seconds. At a rate of $0.02 per query second, you would be billed $0.24 (12 Execution Query Seconds * $0.02/query second).

In the next section will discuss controlling query execution (and costs) by using the parameter maxAgeMinutes.