Skip to content

fix: execution listing queries should be faster now#7402

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/sub-pr-7384
Draft

fix: execution listing queries should be faster now#7402
Copilot wants to merge 7 commits intomainfrom
copilot/sub-pr-7384

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

Pull request description

Rewrote postgres execution listing queries to use text[] instead of jsonb arrays for tag/label/selector filtering, eliminating ~18s timeouts when listing executions for an organization. Added comprehensive unit tests covering all changed query paths and the new text[]-based filter encoding.

Checklist (choose whats happened)

  • breaking change! (describe)
  • tested locally
  • tested on cluster
  • added new dependencies
  • updated the docs
  • added a test

Breaking changes

Changes

  • Query rewrite: GetTestWorkflowExecutions, GetTestWorkflowExecutionsSummary, GetFinishedTestWorkflowExecutions, CountTestWorkflowExecutions, GetTestWorkflowExecutionsTotals — replaced jsonb array params for tags/labels/selectors with text[] using key, key=value, and key:not_exists encoding
  • Param builders: buildTestWorkflowExecutionParams / buildTestWorkflowExecutionTotalParams updated; new helpers parseSelectorToText, parseLabelSelectorToText, parseTagSelectorToText produce the text[] slices
  • sqlc tests (executions.sql_test.go): replaced permissive ExpectQuery("SELECT") with regexp.QuoteMeta(<query constant>); added tests for CountTestWorkflowExecutions, GetFinishedTestWorkflowExecutions, GetTestWorkflowExecutions, GetTestWorkflowExecutionsSummary
  • Param builder tests (postgres_test.go): added TestBuildTestWorkflowExecutionParams, TestBuildTestWorkflowExecutionTotalParams, TestParseSelectorToText, TestParseTagSelectorToText, TestParseLabelSelectorToText covering key-only, key=value, multi-value same key, not_exists, whitespace trimming, and mixed conditions

Fixes

  • Old queries timed out (~18s for listing the executions of an organization)

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

de-wim and others added 6 commits March 20, 2026 21:37
test seemed to just validate generated code matched certain regexes, what's the point?
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix execution listing queries for better performance fix: execution listing queries should be faster now Mar 23, 2026
Copilot AI requested a review from de-wim March 23, 2026 17:34
Base automatically changed from TKC-5244-postgres-list-executions-slow to main March 25, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants