perf: add tasks_v3 index on (flow_id, run_number, step_name) for lateral joins - #500
Open
Shriprasad-P wants to merge 1 commit into
Open
Shriprasad-P wants to merge 1 commit into
Shriprasad-P wants to merge 1 commit into
Conversation
Fixes Netflix#475 The steps_v3 table's lateral join queries tasks_v3 on (flow_id, run_number, step_name). The existing composite index uses run_id (string) instead of run_number (integer), preventing PostgreSQL from using the index for these joins. This index supports joins in step queries with enable_joins=True, including step API endpoints and heartbeat monitoring.
Shriprasad-P
force-pushed
the
cursor/fix-tasks-v3-lateral-join-index-814e
branch
from
September 12, 2026 19:28
b9cb750 to
ceb85a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
Fixes #475
Summary
Adds a concurrent composite index
tasks_v3_idx_flow_run_number_stepon(flow_id, run_number, step_name)so lateral joins fromsteps_v3can use an index matchingrun_number(not onlyrun_id).Test plan
IF NOT EXISTS, up/down)