René's URL Explorer Experiment


Title: perf(webapp): paginate the environment variables settings page by ericallam · Pull Request #4597 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: perf(webapp): paginate the environment variables settings page by ericallam · Pull Request #4597 · triggerdotdev/trigger.dev

X Title: perf(webapp): paginate the environment variables settings page by ericallam · Pull Request #4597 · triggerdotdev/trigger.dev

Description: What The environment variables settings page loaded every variable in the project in one shot, with a nested values read plus a valueReference (SecretReference) sub-load that was selected but never read. For a project with many variables this pulled variables × environments value rows (~18k for large projects) on every page load, plus a matching ~18k-row SecretReference IN query. This paginates the presenter by variable key and removes the dead include. Remove the never-read valueReference: { select: { key } } include → the SecretReference query is gone entirely. Paginate the parent variable query: count + orderBy key + skip/take, page size 50 → the value read is bounded to pageSize × environments per page. Scope the count and the page to variables that have a value in a displayed environment (values: { some: { environmentId: { in } } }), so totalCount/totalPages and the skip/take window match what actually renders (no phantom empty pages from variables that live only in archived branches or another member's dev env). Display order comes from the DB orderBy: { key: "asc" } — the presenter no longer re-sorts each page with localeCompare, which under pagination could disagree with the DB collation at page boundaries. The secret-value lookup (SecretStore keys) and the updater lookup (user by id) are now scoped to the current page instead of the whole project. Search moves server-side (variable key, case-insensitive) and drives both the count and the page; the UI gains standard pagination controls. Why The two correlated ~18k-row control-plane queries flagged in the ticket come from this settings-page presenter, not from any hot path. Both are index-covered (rows_read == rows_returned); the issue is the sheer volume fetched in one burst. Bounding it per page removes the burst. Evidence Measured on an isolated stack with a seeded project of 1000 variables × 3 environments (3000 value rows), using Prisma's emitted-SQL log: SecretReference query value rows fetched before 1 3000 after 0 150 (page 1) + one count EXPLAIN on Prisma's verbatim statements (index confirmed via enable_seqscan=off; the local table is too small for the planner to choose them by default): count (WHERE projectId AND EXISTS(values in displayed envs)) → Hash Join: Index Scan on EnvironmentVariable_pkey + Bitmap Index Scan on EnvironmentVariableValue_environmentId_idx paginated parent (WHERE projectId AND EXISTS(...) ORDER BY key LIMIT/OFFSET) → Nested Loop Semi Join: Index Scan on EnvironmentVariable_projectId_key_key (no Sort node) driving an Index-Only Scan on EnvironmentVariableValue_variableId_environmentId_key nested values (variableId = ANY … AND environmentId = ANY …) → index scan on EnvironmentVariableValue_environmentId_idx SecretStore keys (key = ANY …) → index scan on SecretStore_key_idx No new index required. Verified in the browser on the seeded project: 20 pages, page navigation, server-side search (matches across all pages), last page renders, no app console errors. typecheck, oxlint, oxfmt all clean. Behavior change The previous client-side search matched variable name and value (and environment type / branch name). Values are encrypted at rest and resolved separately, so they cannot be searched server-side under pagination. Search is now variable-name only, server-side, case-insensitive. Projects with fewer than one page of variables see no pagination bar and no visible change. Rollout / rollback Pure read-path change on a dashboard loader, no schema or data migration. Rollback is a straight revert. Screenshots

Open Graph Description: What The environment variables settings page loaded every variable in the project in one shot, with a nested values read plus a valueReference (SecretReference) sub-load that was selected but never...

X Description: What The environment variables settings page loaded every variable in the project in one shot, with a nested values read plus a valueReference (SecretReference) sub-load that was selected but never...

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

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:b24828e3-eb15-5baf-dca5-9bc73590f624
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBE50:3AAE13:315FBEF:463167F:6AFAF38D
html-safe-nonce914efb5a2f78f7624c6a412517918354215fedf51ceaa7d1fc2b045cff3a2356
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTUwOjNBQUUxMzozMTVGQkVGOjQ2MzE2N0Y6NkFGQUYzOEQiLCJ2aXNpdG9yX2lkIjoiNzU1MDEwMDIwMDg2MTkyMjE4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac66c7e5be1207ca99e4d0c02d49f852c2252cf8cc5b5c4f13ebcb7c8a1ba12d47
hovercard-subject-tagpull_request:4266254938
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/4597/files
twitter:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
og:image:altWhat The environment variables settings page loaded every variable in the project in one shot, with a nested values read plus a valueReference (SecretReference) sub-load that was selected but never...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
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
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/4597/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4597%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%2F4597%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/4597/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4597/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4597/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
ericallamhttps://github.com/ericallam
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
feature/tri-13185-perfcontrol-plane-env-var-resolution-fetches-18khttps://github.com/triggerdotdev/trigger.dev/tree/feature/tri-13185-perfcontrol-plane-env-var-resolution-fetches-18k
Conversation 14 https://github.com/triggerdotdev/trigger.dev/pull/4597
Commits 1 https://github.com/triggerdotdev/trigger.dev/pull/4597/commits
Checks 45 https://github.com/triggerdotdev/trigger.dev/pull/4597/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/4597/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4597/files
perf(webapp): paginate the environment variables settings page https://github.com/triggerdotdev/trigger.dev/pull/4597/files#top
Show all changes 1 commit https://github.com/triggerdotdev/trigger.dev/pull/4597/files
4f69315 perf(webapp): paginate the environment variables settings page ericallam Aug 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4597/commits/4f69315705dce58e58e6e5fc94fc54ba1e589b32
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/4597/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4597/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4597/files
paginate-environment-variables.md https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-89aecf719c7c1162488751abec35bed33b908c26812c71e800f6b5741b1bbd3e
EnvironmentVariablesPresenter.server.ts https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
route.tsx https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
.server-changes/paginate-environment-variables.mdhttps://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-89aecf719c7c1162488751abec35bed33b908c26812c71e800f6b5741b1bbd3e
View file https://github.com/triggerdotdev/trigger.dev/blob/4f69315705dce58e58e6e5fc94fc54ba1e589b32/.server-changes/paginate-environment-variables.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4597/{{ revealButtonHref }}
apps/webapp/app/presenters/v3/EnvironmentVariablesPresenter.server.tshttps://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
View file https://github.com/triggerdotdev/trigger.dev/blob/4f69315705dce58e58e6e5fc94fc54ba1e589b32/apps/webapp/app/presenters/v3/EnvironmentVariablesPresenter.server.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4597/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4597/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4597/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4597/files
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4597/files
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-0cae041b399da9d109ad89c32b727a85f4ecdaba60ebb2b5b995a8b79b1fbcd9
...gs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables/route.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
View file https://github.com/triggerdotdev/trigger.dev/blob/4f69315705dce58e58e6e5fc94fc54ba1e589b32/apps/webapp/app/routes/_app.orgs.%24organizationSlug.projects.%24projectParam.env.%24envParam.environment-variables/route.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4597/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
https://github.com/triggerdotdev/trigger.dev/pull/4597/files#diff-ad7c9b1ac26415e250b5c70e3beb34cdd501c1462d2318c1b4c5415884dc591f
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4597/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.