René's URL Explorer Experiment


Title: perf(tables): read a sorted view's order once per drain and project selected columns in SQL by waleedlatif1 · Pull Request #8915 · simstudioai/sim · GitHub

Open Graph Title: perf(tables): read a sorted view's order once per drain and project selected columns in SQL by waleedlatif1 · Pull Request #8915 · simstudioai/sim

X Title: perf(tables): read a sorted view's order once per drain and project selected columns in SQL by waleedlatif1 · Pull Request #8915 · simstudioai/sim

Description: Summary Custom-sort drains read the order once: sorted reads advanced by OFFSET, so every batch recomputed the sort key over the whole table (the key comes from the row's jsonb, so each pass decompresses every row). The drain now runs one id-only pass with the same ORDER BY/OFFSET, then fetches rows by primary key in the same byte-budgeted batches, preserving order. Unbounded drains start with a small id pass and extend as needed. Column selection is projected in SQL: when a read selects a subset of schema columns, data is narrowed in SQL (one read of the value, column ids bound as parameters, non-object data maps to {} as before) instead of shipping whole rows and projecting in Node. Batches are sized from the bytes actually fetched. Selecting every column keeps the existing Node-side path. Output is unchanged: rows, key order, null/missing semantics, hasMore/cursor/offset behavior, byte budget and TABLE_QUERY_RESULT_TOO_LARGE thresholds. Type of Change Performance improvement Testing Old vs new fetchRowsBounded compared over 4,410 cases (sorts incl. ties/nulls/missing keys, filters, column selections with and without SQL projection, limits, offsets, budgets, second id pass, non-object data): identical results; full sort passes reduced ~4×, never more than before Replica EXPLAIN (ANALYZE, BUFFERS, SERIALIZE) on a wide table: 2-column selection ~3× less server time and ~48× fewer bytes; sorted drain one full pass instead of one per batch. Trade-off: a selection that omits only columns no row has written pays ~10 ms more server time for the same bytes Integration cases: sorted drain across batch boundaries, from an offset and through a second id pass; projection exactness (JSON null kept, missing key omitted, caller column order) Unit tests for bounded fetch sizing and filter threading pass; biome on changed files 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 Custom-sort drains read the order once: sorted reads advanced by OFFSET, so every batch recomputed the sort key over the whole table (the key comes from the row's jsonb, so each pass d...

X Description: Summary Custom-sort drains read the order once: sorted reads advanced by OFFSET, so every batch recomputed the sort key over the whole table (the key comes from the row's jsonb, so each pa...

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

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:5d28b8a0-365e-ee14-6f16-6d28b1c793c3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB42E:1E90AB:35BB5A:4B92CB:6AFB714A
html-safe-nonce0a8b8345bf5d1510449c747eaf3f656360faf1d7bf2b3c2ed05ff39f78f21ec2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDJFOjFFOTBBQjozNUJCNUE6NEI5MkNCOjZBRkI3MTRBIiwidmlzaXRvcl9pZCI6IjIxNzYyNDY4OTExNTczNTI3NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac23b84383fd808caf1056ac5980ed918525b9df99ae92c073e2cdd006794d4e2b
hovercard-subject-tagpull_request:4825747810
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/8915/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 Custom-sort drains read the order once: sorted reads advanced by OFFSET, so every batch recomputed the sort key over the whole table (the key comes from the row's jsonb, so each pass d...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0e29e7974fdda2feeaf5c891efd4b23b0734b23480232b62c7bdef13f40b5b48
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
release2e8872b770cc4d5d0cc1f2026afab747a268e2ce
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8915/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8915%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%2F8915%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/8915/files
Reloadhttps://github.com/simstudioai/sim/pull/8915/files
Reloadhttps://github.com/simstudioai/sim/pull/8915/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/table-readshttps://github.com/simstudioai/sim/tree/perf/table-reads
Conversation 12 https://github.com/simstudioai/sim/pull/8915
Commits 3 https://github.com/simstudioai/sim/pull/8915/commits
Checks 47 https://github.com/simstudioai/sim/pull/8915/checks
Files changed https://github.com/simstudioai/sim/pull/8915/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8915/files
perf(tables): read a sorted view's order once per drain and project selected columns in SQL https://github.com/simstudioai/sim/pull/8915/files#top
Show all changes 3 commits https://github.com/simstudioai/sim/pull/8915/files
5b54043 perf(tables): project selected columns in SQL and read a custom sort'… waleedlatif1 Oct 12, 2026 https://github.com/simstudioai/sim/pull/8915/commits/5b54043bfbf0dcb6a586c0d9f2190ba8f8f6e74a
7c52ed5 perf(tables): read a projected row's data once and size its batches b… waleedlatif1 Oct 12, 2026 https://github.com/simstudioai/sim/pull/8915/commits/7c52ed5fe38984c32f07805b51d5363a88a059f2
4ed388c fix(tables): drain a custom sort in one snapshot waleedlatif1 Oct 12, 2026 https://github.com/simstudioai/sim/pull/8915/commits/4ed388cc6d95a77866a199259008946380229520
Clear filters https://github.com/simstudioai/sim/pull/8915/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8915/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8915/files
row-writes.integration.ts https://github.com/simstudioai/sim/pull/8915/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
service.ts https://github.com/simstudioai/sim/pull/8915/files#diff-bb7e45c4b7c8d660db1d230975eb35231ae2616360572a342fd56d37296bb23f
service-filter-threading.test.ts https://github.com/simstudioai/sim/pull/8915/files#diff-242996057da626d86f9ffb8fd3cb5e2608373baef6e7258c5bf691303cd39f2c
apps/sim/lib/table/rows/row-writes.integration.tshttps://github.com/simstudioai/sim/pull/8915/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
View file https://github.com/simstudioai/sim/blob/4ed388cc6d95a77866a199259008946380229520/apps/sim/lib/table/rows/row-writes.integration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8915/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8915/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
Please reload this pagehttps://github.com/simstudioai/sim/pull/8915/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8915/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8915/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.