René's URL Explorer Experiment


Title: perf(db): index a workspace's live files in upload order by waleedlatif1 · Pull Request #9434 · simstudioai/sim · GitHub

Open Graph Title: perf(db): index a workspace's live files in upload order by waleedlatif1 · Pull Request #9434 · simstudioai/sim

X Title: perf(db): index a workspace's live files in upload order by waleedlatif1 · Pull Request #9434 · simstudioai/sim

Description: Summary Adds workspace_files_workspace_active_uploaded_idx (workspace_id, uploaded_at, id) with the predicate the other live workspace-file indexes share (deleted_at IS NULL AND context = 'workspace' AND workspace_id IS NOT NULL), built concurrently with the replay-safe recovery pattern No index served the file list's filter in upload order, so the planner combined the context and search-keyset indexes, matching every workspace's live files, filtered to one workspace on the heap and sorted, even for a bounded read; the full list and the SSR seed now read the workspace's rows in index order with no sort (the uploadedAt keyset pages still order on date_trunc('milliseconds', uploaded_at) and move to this order in the pagination PR, which aligns their keyset with the plain column) listWorkspaceFiles orders by uploaded_at, id, so ties come back in a stable order across reads The key stays narrow (no name/key columns) so an entry can never approach the btree size limit and fail a write Marks workspace_files_workspace_active_keyset_idx for retirement once its scans stop after deploy Adds @sim/db/testing/explain (explainCaptured), a test helper that EXPLAINs the SQL a call actually sends, with its bound parameters Type of Change Other: performance Testing New file-list.integration.ts: active, archived and all scopes list exactly their rows in (uploaded_at, id) order (archived and all fail without the tiebreak); the full list and the SSR seed's bounded read plan on the new index with no Sort (fails with the index dropped) Plans verified on a production-shaped local copy under stale statistics: the SSR seed drops from a whole-workspace scan and sort to an ordered index scan; name-sorted pages, key/name/id lookups and the archived list keep their plans Push- and migrate-provisioned databases build the identical index; replay rebuilds an invalid index and keeps a valid one bun run check:migrations origin/staging, drizzle-kit generate (no changes), bun run lint, bun run check:audits, bun run type-check Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Adds workspace_files_workspace_active_uploaded_idx (workspace_id, uploaded_at, id) with the predicate the other live workspace-file indexes share (deleted_at IS NULL AND context = 'wor...

X Description: Summary Adds workspace_files_workspace_active_uploaded_idx (workspace_id, uploaded_at, id) with the predicate the other live workspace-file indexes share (deleted_at IS NULL AND context = &#39...

Opengraph URL: https://github.com/simstudioai/sim/pull/9434

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:fb0f278e-3880-6a0b-552f-3df3e4c736b2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA9B2:2380E6:F5405:169EF8:6AFB09D0
html-safe-nonce9ed60a1ecf1de97a8cbeee82ebe95d4dd8e094c5672741b267ae3057b00062a7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUIyOjIzODBFNjpGNTQwNToxNjlFRjg6NkFGQjA5RDAiLCJ2aXNpdG9yX2lkIjoiNDg1ODMxMDQ4NTUzNjg2ODgxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac541837bf02eed3fd15a0a66d1cd909be561d289b832d4379ad15f9a9e6cb3adc
hovercard-subject-tagpull_request:5060886575
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/simstudioai/sim/pull/9434/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary Adds workspace_files_workspace_active_uploaded_idx (workspace_id, uploaded_at, id) with the predicate the other live workspace-file indexes share (deleted_at IS NULL AND context = 'wor...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None76fb13cb43f1834708971f45a9cfcab5df3177a7582086613d7cdc6e98c4bfde
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
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
releaseafc998826cdd963c8f91a96ae5372809ab5e296b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/9434/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F9434%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%2Fsimstudioai%2Fsim%2Fpull%2F9434%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=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/9434/files
Reloadhttps://github.com/simstudioai/sim/pull/9434/files
Reloadhttps://github.com/simstudioai/sim/pull/9434/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
perf/files-list-idxhttps://github.com/simstudioai/sim/tree/perf/files-list-idx
Conversation 9 https://github.com/simstudioai/sim/pull/9434
Commits 2 https://github.com/simstudioai/sim/pull/9434/commits
Checks 68 https://github.com/simstudioai/sim/pull/9434/checks
Files changed https://github.com/simstudioai/sim/pull/9434/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9434/files
perf(db): index a workspace's live files in upload order https://github.com/simstudioai/sim/pull/9434/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/9434/files
c6468fe perf(db): index a workspace's live files in upload order waleedlatif1 Oct 29, 2026 https://github.com/simstudioai/sim/pull/9434/commits/c6468fe3ad029a03e18acecbbe336d6448ce1d6f
9694ec6 docs(db): say the upload-order index serves the list and its seed waleedlatif1 Oct 29, 2026 https://github.com/simstudioai/sim/pull/9434/commits/9694ec67236b8207fb8b5e480952cd5215869b39
Clear filters https://github.com/simstudioai/sim/pull/9434/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9434/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9434/files
file-list.integration.ts https://github.com/simstudioai/sim/pull/9434/files#diff-9a7f74bcba68fd87c9923b7be3ab3e96ff047b09c867c02bc580e60073679d6c
file-manager.ts https://github.com/simstudioai/sim/pull/9434/files#diff-8a5fe21cb59e40994be235c3a799fe7cf265576f7480174d6df727af5a7bf644
0442_workspace_files_active_uploaded_idx.sql https://github.com/simstudioai/sim/pull/9434/files#diff-e809672c319849bd9026d158b2dd2bc62ef7ffde38357cecac48796f3a9bf9be
0442_snapshot.json https://github.com/simstudioai/sim/pull/9434/files#diff-6d5850938bfeb0b4e3b4d77b29589e2fa84a99cc12a8b71e62dc3a7b4cc41609
_journal.json https://github.com/simstudioai/sim/pull/9434/files#diff-37150cc65ad16ee6fbc5fa318fc096be7730e16d63eaf863e3df5521b7030649
package.json https://github.com/simstudioai/sim/pull/9434/files#diff-c89735ad606b83e822d493ca765a37afb7fcd2e5621f828a2cfc984ed5e67367
schema.ts https://github.com/simstudioai/sim/pull/9434/files#diff-9a959e2ce3cb4c86957bbae021d06eae364f7b0cb18964f5873bab53220af928
explain.ts https://github.com/simstudioai/sim/pull/9434/files#diff-3451bc7f5ca17320150a86318e313f926a5011e2b31d1fa9c7904d1515b7b142
check-unused-exports.baseline.json https://github.com/simstudioai/sim/pull/9434/files#diff-4b59a8526a4f226dffb0fbf6b8ec25d3082ab45da697f584eaaca4bd483c928f
apps/sim/lib/uploads/contexts/workspace/__integration__/file-list.integration.tshttps://github.com/simstudioai/sim/pull/9434/files#diff-9a7f74bcba68fd87c9923b7be3ab3e96ff047b09c867c02bc580e60073679d6c
View file https://github.com/simstudioai/sim/blob/9694ec67236b8207fb8b5e480952cd5215869b39/apps/sim/lib/uploads/contexts/workspace/__integration__/file-list.integration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9434/{{ revealButtonHref }}
apps/sim/lib/uploads/contexts/workspace/file-manager.tshttps://github.com/simstudioai/sim/pull/9434/files#diff-8a5fe21cb59e40994be235c3a799fe7cf265576f7480174d6df727af5a7bf644
View file https://github.com/simstudioai/sim/blob/9694ec67236b8207fb8b5e480952cd5215869b39/apps/sim/lib/uploads/contexts/workspace/file-manager.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9434/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9434/files#diff-8a5fe21cb59e40994be235c3a799fe7cf265576f7480174d6df727af5a7bf644
https://github.com/simstudioai/sim/pull/9434/files#diff-8a5fe21cb59e40994be235c3a799fe7cf265576f7480174d6df727af5a7bf644
https://github.com/simstudioai/sim/pull/9434/files#diff-8a5fe21cb59e40994be235c3a799fe7cf265576f7480174d6df727af5a7bf644
packages/db/migrations/0442_workspace_files_active_uploaded_idx.sqlhttps://github.com/simstudioai/sim/pull/9434/files#diff-e809672c319849bd9026d158b2dd2bc62ef7ffde38357cecac48796f3a9bf9be
View file https://github.com/simstudioai/sim/blob/9694ec67236b8207fb8b5e480952cd5215869b39/packages/db/migrations/0442_workspace_files_active_uploaded_idx.sql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9434/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/9434/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9434/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.