Skip to content

Client-side query timing is a lot more slower than dashboard measurement #426

Description

@ishank-dev

Description

When I run a simple SELECT via the Python SDK and measure wall‑clock from .execute() through .fetchall(), I consistently see ~17 s latency for a query that the Firebolt UI reports as ~0.5 s server time. This large discrepancy makes it hard to understand where time is spent.

Steps to reproduce

Create benchmark_query.py with:

from time import perf_counter
from firebolt.client.auth import ClientCredentials
from firebolt.db import connect
import os; from dotenv import load_dotenv
load_dotenv()

creds = ClientCredentials(
    client_id=os.getenv("FIREBOLT_CLIENT_ID"),
    client_secret=os.getenv("FIREBOLT_CLIENT_SECRET")
)
conn = connect(
    engine_name=os.getenv("FIREBOLT_ENGINE_NAME"),
    database=os.getenv("FIREBOLT_DATABASE"),
    account_name=os.getenv("FIREBOLT_ACCOUNT"),
    auth=creds
)
cur = conn.cursor()

query = """
SELECT … FROM accidentdata
WHERE to_date(start_time) >= '2022-12-01'
  AND to_date(start_time) <= '2023-12-31'
"""
t0 = perf_counter()
cur.execute(query)
rows = cur.fetchall()
elapsed = perf_counter() - t0
print(f"Client RTT: {elapsed:.3f}s")

Run:

python benchmark_query.py

Compare the printed Client RTT to the dashboard’s “Query Duration” for that same statement.

Observed behavior

Python SDK: ~17.7 s

Firebolt Dashboard: ~0.5 s

Expected behavior
The SDK’s .execute() + .fetchall() should more closely align with the dashboard’s server‑side execution time

Python version: 3.12

OS: macOS 15.3.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions