-
Notifications
You must be signed in to change notification settings - Fork 160
Description
Motivation
SQL Lab's Query History tab displays a "Duration" column that should help users understand how long their queries actually took to execute. This is critical for performance analysis and query optimization. However, the current implementation calculates duration from when a query is submitted (start_time) to when it completes (end_time), which includes time spent waiting in queues, being scheduled, and other non-execution states. This makes the duration values misleading and unhelpful for users trying to understand actual query performance.
Current Behavior
The Duration column in SQL Lab's Query History tab calculates the total time from query submission to completion, including all intermediate states (pending, scheduled, queued, etc.) rather than just the actual execution time.
Reproduction Steps:
- Navigate to SQL Lab in Superset
- Execute several queries of varying complexity (e.g., simple SELECT statements, more complex joins)
- Click on the "Query History" tab
- Observe the "Duration" column values
- Notice that even simple queries that should execute in milliseconds may show durations of multiple seconds
Expected Behavior
The Duration column should display only the actual query execution time, excluding any time spent in pending, scheduled, or queued states.
Acceptance Criteria:
- Duration calculation uses the time when query execution actually begins, not when it was submitted
- The change works correctly for queries that have queue/scheduling delays
Steps to Test
- Start Superset and navigate to SQL Lab
- Execute multiple queries with different complexity levels
- Open the Query History tab
- Verify that duration values are reasonable and reflect actual execution time
https://github.com/apache/superset/pull/34511/files
Submission
Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.
Guide to submitting pull requests: https://hackmd.io/@timothy1ee/Hky8kV3hlx