Title: perf(run-ops-database): index BatchTaskRun for the batches list on the dedicated schema by ericallam · Pull Request #4396 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: perf(run-ops-database): index BatchTaskRun for the batches list on the dedicated schema by ericallam · Pull Request #4396 · triggerdotdev/trigger.dev
X Title: perf(run-ops-database): index BatchTaskRun for the batches list on the dedicated schema by ericallam · Pull Request #4396 · triggerdotdev/trigger.dev
Description: Summary The batches list page orders by (createdAt DESC, id DESC), which is why #4361 added a matching index on BatchTaskRun. That index only landed in @trigger.dev/database. The dedicated run-ops database has its own migration history, so it never received the index. BatchListPresenter reads both databases and merges, so for environments whose batches live in the dedicated database the page kept falling back to a scan and in-memory sort, which is the exact behaviour #4361 set out to fix. Fix Adds the index to the run-ops schema with its own migration. CREATE INDEX CONCURRENTLY IF NOT EXISTS, so it is a no-op where the index already exists and still records its ledger row. The second half is the interesting part. Because the two packages own separate migration histories, a run-graph schema change has to be authored twice, and nothing made the miss visible: the run-ops status check truthfully reports "up to date" against its own history, so the apply step just skips. schemaParity.test.ts compares the physical shape of every model the run-ops schema declares against its counterpart in @trigger.dev/database: scalar fields with their attributes, plus @@index, @@unique, @@id and @@map. Relation navigation fields are excluded, since the run-ops schema deliberately drops relations that would cross a database boundary while keeping the scalar FK column. A field counts as a relation when its type resolves to a model name, which keeps enum-typed columns in scope. Two models are listed as run-ops-only: CompletedWaitpoint and WaitpointRunConnection, both explicit FK-free replacements for a control-plane implicit many-to-many, since an implicit m2m carries a foreign key that cannot resolve across databases. The test also asserts that exception list is exhaustive, so a new unpaired model fails rather than being silently skipped. Confirmed the guard actually fails: reverting the index turns BatchTaskRun red with the missing @@index named in the diff.
Open Graph Description: Summary The batches list page orders by (createdAt DESC, id DESC), which is why #4361 added a matching index on BatchTaskRun. That index only landed in @trigger.dev/database. The dedicated run-ops ...
X Description: Summary The batches list page orders by (createdAt DESC, id DESC), which is why #4361 added a matching index on BatchTaskRun. That index only landed in @trigger.dev/database. The dedicated run-ops ...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4396
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:97a0a33d-b4b4-81f7-f027-7ddc5ad31c3d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D090:137618:1646C0:1F7FCD:6AFAFB10 |
| html-safe-nonce | 05d87cbbcef7813f50cca1ef9c11cb8a98245924c8518dfa3c541a6862c569f1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDkwOjEzNzYxODoxNjQ2QzA6MUY3RkNEOjZBRkFGQjEwIiwidmlzaXRvcl9pZCI6Ijg1NzUwMjA5OTQxNjkzMzg2NDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f8ebe1a1aa62df42ecb447927cd1b670d0ba91ff9630c598d92214f48f5dd75e |
| hovercard-subject-tag | pull_request:4143155414 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4396/files |
| twitter:image | https://avatars.githubusercontent.com/u/534?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/534?s=400&v=4 |
| og:image:alt | Summary The batches list page orders by (createdAt DESC, id DESC), which is why #4361 added a matching index on BatchTaskRun. That index only landed in @trigger.dev/database. The dedicated run-ops ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54f7a6886649661c85eee945cca0773566bfb4065370e0429b7c8f7204184650 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cf8450eb633ec589502c42ff6f4072e40db65da3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width