Skip to content

perf(clickhouse): add task_events_v2 inserted_at minmax index - #4620

Merged
carderne merged 2 commits into
mainfrom
perf/task-events-inserted-at-index
Aug 14, 2026
Merged

perf(clickhouse): add task_events_v2 inserted_at minmax index#4620
carderne merged 2 commits into
mainfrom
perf/task-events-inserted-at-index

Conversation

@carderne

Copy link
Copy Markdown
Collaborator

Adds a minmax skip index on task_events_v2.inserted_at (idx_inserted_at_projector) to support bounded, closed time-window scans of the source table.

ADD INDEX only defines the index for newly written parts; existing parts are not materialized. New parts (e.g. after the next UTC partition boundary) will carry it.

Split out ahead of the larger log-search-v2 work so the index can be deployed independently for read-path testing.

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 800b05e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4701ee6a-2484-4e34-9e1d-c0a9bf72203e

📥 Commits

Reviewing files that changed from the base of the PR and between 7c7ea0f and 800b05e.

📒 Files selected for processing (1)
  • internal-packages/clickhouse/schema/038_add_task_events_inserted_at_index.sql
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal-packages/clickhouse/schema/038_add_task_events_inserted_at_index.sql
📜 Recent review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 12)
  • GitHub Check: fk-cascade-guard / fk-cascade-guard
  • GitHub Check: code-quality / code-quality
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)

Walkthrough

Adds a Goose migration that creates the idx_inserted_at_projector minmax index on trigger_dev.task_events_v2.inserted_at for new parts. The downgrade migration conditionally drops the index. Existing parts are not materialized.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the index, scope, purpose, and deployment reason, but it omits the required issue, checklist, testing, changelog, and screenshots sections. Add the template sections, including the issue reference, completed checklist, testing steps, changelog entry, and screenshots or an explicit not-applicable note.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and clearly identifies the ClickHouse performance change: adding a minmax index on task_events_v2.inserted_at.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/task-events-inserted-at-index

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@carderne carderne mentioned this pull request Aug 14, 2026
2 tasks
The testcontainers migration parser splits Up statements on ';',
including semicolons inside comments, which produced a comments-only
fragment rejected by ClickHouse as 'Empty query.'
@carderne
carderne marked this pull request as ready for review August 14, 2026 13:31

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

@carderne
carderne enabled auto-merge (squash) August 14, 2026 13:45
@carderne
carderne merged commit 1240d91 into main Aug 14, 2026
41 checks passed
@carderne
carderne deleted the perf/task-events-inserted-at-index branch August 14, 2026 13:46
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