René's URL Explorer Experiment


Title: TaskRun optimizations: dropping FKs and some indexes by matt-aitken · Pull Request #3309 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: TaskRun optimizations: dropping FKs and some indexes by matt-aitken · Pull Request #3309 · triggerdotdev/trigger.dev

X Title: TaskRun optimizations: dropping FKs and some indexes by matt-aitken · Pull Request #3309 · triggerdotdev/trigger.dev

Description: Summary Drop all 8 foreign key constraints on TaskRun. The run listing path is now fully ClickHouse-backed so we no longer need Postgres to enforce referential integrity on this table. The FK constraints add write overhead on every insert/update with no remaining benefit. Prisma queries are unaffected. Remove PostgresRunsRepository and its associated feature flag (runsListRepository), which was the last remaining code path querying TaskRun directly for list/count operations. Drop three indexes that were only useful for the Postgres run list path and have no remaining query consumers: TaskRun_runtimeEnvironmentId_id_idx — was the cursor pagination index for PostgresRunsRepository; superseded by the (runtimeEnvironmentId, createdAt DESC) composite index TaskRun_scheduleId_idx — redundant with the (scheduleId, createdAt DESC) composite index; no direct Postgres queries filter by scheduleId alone TaskRun_rootTaskRunId_idx — no queries filter TaskRun by rootTaskRunId as a WHERE clause anywhere in the codebase All index drops use CONCURRENTLY IF EXISTS to avoid table locks in production. Test plan pnpm run db:migrate:deploy applies all migrations cleanly pnpm run typecheck --filter webapp passes Run list pages load correctly in the dashboard (ClickHouse path) Scheduled task runs still trigger and appear correctly

Open Graph Description: Summary Drop all 8 foreign key constraints on TaskRun. The run listing path is now fully ClickHouse-backed so we no longer need Postgres to enforce referential integrity on this table. The FK cons...

X Description: Summary Drop all 8 foreign key constraints on TaskRun. The run listing path is now fully ClickHouse-backed so we no longer need Postgres to enforce referential integrity on this table. The FK cons...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/3309

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,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-controllerpull_requests
route-actionfiles
fetch-noncev2:0082e000-a504-84a4-7313-1dc0216b31fb
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAB96:29F51C:96010:CF99E:6AFB2B58
html-safe-noncef93c541b616fb1b280088a80ca6c9aa89d36de083b01da02e8aaf2fdbe972419
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjk2OjI5RjUxQzo5NjAxMDpDRjk5RTo2QUZCMkI1OCIsInZpc2l0b3JfaWQiOiI4OTQxMzYzODQxNzQ5MTY2OTM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac62f91b6411ad08f900c21e8fa4b9d6c940d4a03f17fed58643817f5a5e84311b
hovercard-subject-tagpull_request:3477280028
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/3309/files
twitter:imagehttps://avatars.githubusercontent.com/u/10635986?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10635986?s=400&v=4
og:image:altSummary Drop all 8 foreign key constraints on TaskRun. The run listing path is now fully ClickHouse-backed so we no longer need Postgres to enforce referential integrity on this table. The FK cons...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None40c7ffe00e8bbb3ca8403c83d7ef110379c9eba2cbc7a7c333b037ffd940d4e4
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef494d77c37809e03e18d49c6e9945c57e0b64070
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/3309/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3309%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3309%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3309/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3309/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3309/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
matt-aitkenhttps://github.com/matt-aitken
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
taskrun-optimizationshttps://github.com/triggerdotdev/trigger.dev/tree/taskrun-optimizations
Conversation 9 https://github.com/triggerdotdev/trigger.dev/pull/3309
Commits 5 https://github.com/triggerdotdev/trigger.dev/pull/3309/commits
Checks 46 https://github.com/triggerdotdev/trigger.dev/pull/3309/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/3309/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3309/files
TaskRun optimizations: dropping FKs and some indexes https://github.com/triggerdotdev/trigger.dev/pull/3309/files#top
Show all changes 5 commits https://github.com/triggerdotdev/trigger.dev/pull/3309/files
42059ee Drop TaskRun foreign key constraints matt-aitken Apr 1, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3309/commits/42059ee3762698a966b35b2798e5175847d115de
f4f95f5 Remove PostgresRunsRepository matt-aitken Apr 1, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3309/commits/f4f95f5a0edbdddc97ab80c24b2d939b42fcea26
21ab29a Remove unused TaskRun_runtimeEnvironmentId_id_idx matt-aitken Apr 1, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3309/commits/21ab29ace4595ae574d8fde2f222b25931a4176c
3a5bc57 Drop TaskRun_rootTaskRunId_idx and TaskRun_scheduleId_idx matt-aitken Apr 1, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3309/commits/3a5bc570a794c9ab7eb64257f645bf2ff14176e4
a511151 fix(otel): increase getSpan start time buffer to 60s for scheduled runs matt-aitken Apr 1, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3309/commits/a511151fdc58f538933054cd173ad1cede8aa52c
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/3309/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3309/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3309/files
admin.feature-flags.tsx https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-5337614946e4da86105cfc4ee06612e7d4cc9296885bada0d5f0ceda5449ea4c
postgresRunsRepository.server.ts https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-3c9d60ebc6ef8bda131a7812a5a5269b426be620e0f1e4983de69956686559d1
runsRepository.server.ts https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-fd5167ddce7f3f071edb4eda73f524d5ee109514355ac583869fa24a055f342c
clickhouseEventRepository.server.ts https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-2feda1843834eeed8bb4b12473f3b851b4c608ca6eacc4d193aca742fd6e30ad
featureFlags.ts https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-b786b6c59ba126a02d9e947c4d01e2df333ea295686f0eace3043c932eb20cb0
migration.sql https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-4da4c868d79fd194b2ee526c77ad74eeee21f7ae606d5942d5d0e6c2e91dfd48
migration.sql https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-e01fc3832180ac16b16cb2d12e1a0ed2eb8e5418e1bdc6904a212595bf728dba
migration.sql https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-bb9247fad25ac0935f25c90a9ca27877862174ecebce1abc23e4bfcff79764f8
migration.sql https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-6b483bdedfa3eb1ac503ccdea42598fb34218024c437b98b04d7995aa5833318
schema.prisma https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-6b8eefc1da429865c9493bbac9d2c4d00d1cfe2f2231f6474b9692f13b88e419
apps/webapp/app/routes/admin.feature-flags.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-5337614946e4da86105cfc4ee06612e7d4cc9296885bada0d5f0ceda5449ea4c
View file https://github.com/triggerdotdev/trigger.dev/blob/a511151fdc58f538933054cd173ad1cede8aa52c/apps/webapp/app/routes/admin.feature-flags.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3309/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-5337614946e4da86105cfc4ee06612e7d4cc9296885bada0d5f0ceda5449ea4c
https://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-5337614946e4da86105cfc4ee06612e7d4cc9296885bada0d5f0ceda5449ea4c
apps/webapp/app/services/runsRepository/postgresRunsRepository.server.tshttps://github.com/triggerdotdev/trigger.dev/pull/3309/files#diff-3c9d60ebc6ef8bda131a7812a5a5269b426be620e0f1e4983de69956686559d1
View file https://github.com/triggerdotdev/trigger.dev/blob/f75d4d62afc86e50bfbaa5e0208be976ec168b68/apps/webapp/app/services/runsRepository/postgresRunsRepository.server.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3309/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3309/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3309/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.