René's URL Explorer Experiment


Title: fix(tables): per-batch delete-job commits, real trigger.dev retries, post-index ANALYZE guard by TheodoreSpeaks · Pull Request #4997 · simstudioai/sim · GitHub

Open Graph Title: fix(tables): per-batch delete-job commits, real trigger.dev retries, post-index ANALYZE guard by TheodoreSpeaks · Pull Request #4997 · simstudioai/sim

X Title: fix(tables): per-batch delete-job commits, real trigger.dev retries, post-index ANALYZE guard by TheodoreSpeaks · Pull Request #4997 · simstudioai/sim

Description: Summary background delete job committed each 10k-row page as one transaction — the row-count trigger's lock on the definition row was held for the whole page and the first page blew the 60s statement timeout on a 7M-row table; each 1000-id batch now commits in its own short transaction runTableDelete swallowed errors so trigger.dev saw the run as completed and retry: { maxAttempts: 3 } never fired; errors now propagate and the job is marked failed only in onFailure after the final attempt (detached non-trigger.dev path fails immediately as before) job error field stored the full drizzle SQL dump (87KB of $1..$1002 params); now stores the Postgres cause message truncated to 500 chars migration 0234: ANALYZE user_table_rows — 0233's CREATE INDEX CONCURRENTLY builds left pg_class.reltuples = Infinity on staging (NaN plan costs broke every query on the table, and Infinity disables autovacuum's own re-analyze threshold so it can't self-heal); the guard re-measures stats right after the index builds so prod never plans off a corrupt value Type of Change Bug fix Testing lib/table suite passes (223 tests incl. new coverage for rethrow/superseded/failure-marking paths), tsc clean, lint + strict boundary audit pass. Staging DB healed with the same manual ANALYZE; canary green since. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing 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 background delete job committed each 10k-row page as one transaction — the row-count trigger's lock on the definition row was held for the whole page and the first page blew the 60s st...

X Description: Summary background delete job committed each 10k-row page as one transaction — the row-count trigger's lock on the definition row was held for the whole page and the first page blew the 60...

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

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:3d5a1c31-8c36-ffee-58f4-364cf7ffc7c1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA73C:1BB36A:77E7EF:A4C7EF:6AFB43AA
html-safe-noncea283ddff1392a503397f815e5e3a6509f126c45cc6432bed5a0b24db5def7b59
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzNDOjFCQjM2QTo3N0U3RUY6QTRDN0VGOjZBRkI0M0FBIiwidmlzaXRvcl9pZCI6Ijc5MTQ4NDY5Mzk4MTAzMTcyMjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacae72ee79763916d98f877c88f8ed7e74b744cc510e67a257e587b4d1e55e983f
hovercard-subject-tagpull_request:3855745328
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/4997/files
twitter:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
og:image:altSummary background delete job committed each 10k-row page as one transaction — the row-count trigger's lock on the definition row was held for the whole page and the first page blew the 60s st...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned849b928f455c800985398e7f1b659425adb312a5fa14fba5d9a14e62e9fe5dd
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
releasea6c2f87cbcb6414452377b4967858ed6a66f1109
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/4997/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F4997%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%2F4997%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/4997/files
Reloadhttps://github.com/simstudioai/sim/pull/4997/files
Reloadhttps://github.com/simstudioai/sim/pull/4997/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests200 (200)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
TheodoreSpeakshttps://github.com/TheodoreSpeaks
staginghttps://github.com/simstudioai/sim/tree/staging
fix/table-delete-jobhttps://github.com/simstudioai/sim/tree/fix/table-delete-job
Conversation 9 https://github.com/simstudioai/sim/pull/4997
Commits 2 https://github.com/simstudioai/sim/pull/4997/commits
Checks 14 https://github.com/simstudioai/sim/pull/4997/checks
Files changed https://github.com/simstudioai/sim/pull/4997/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4997/files
fix(tables): per-batch delete-job commits, real trigger.dev retries, post-index ANALYZE guard https://github.com/simstudioai/sim/pull/4997/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/4997/files
1b01651 fix(tables): per-batch delete-job commits, real trigger.dev retries, … TheodoreSpeaks Jun 12, 2026 https://github.com/simstudioai/sim/pull/4997/commits/1b016516a0466eedd2ab54db6d868d6e81baf196
a0cf0c9 fix(tables): resume job progress across retries, rethrow root cause f… TheodoreSpeaks Jun 12, 2026 https://github.com/simstudioai/sim/pull/4997/commits/a0cf0c94ae9a6985a0e74fb81ddf75acd05d4f2d
Clear filters https://github.com/simstudioai/sim/pull/4997/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4997/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4997/files
route.ts https://github.com/simstudioai/sim/pull/4997/files#diff-86aaf5671f84f96632daab7807f39b084f93a4aafe458a04607c56cf8703c8ea
table-delete.ts https://github.com/simstudioai/sim/pull/4997/files#diff-9546f9e53bb60c35d2fd3b30b65542978b3fc207609e0d4468052fb1210487ea
constants.ts https://github.com/simstudioai/sim/pull/4997/files#diff-3789ef10f28c4ed64a7728377279f3fb4f153bc42fb87c1db3405e79ee97fcf5
delete-runner.test.ts https://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
delete-runner.ts https://github.com/simstudioai/sim/pull/4997/files#diff-09254d41b01b6cdad343c7efb45a23f8abcc32c3f2a0a06934f859cabcbb855b
service.ts https://github.com/simstudioai/sim/pull/4997/files#diff-691e9b1dc59be0015a1be5ea6189899b241d4e979a8b40e088dd7d722cfaadb6
0234_analyze_user_table_rows.sql https://github.com/simstudioai/sim/pull/4997/files#diff-93d7284c83daede6f6da00d3510a4571a60dc77689cdc4613d900bfc67e7dcff
0234_snapshot.json https://github.com/simstudioai/sim/pull/4997/files#diff-8a472707da37046d300c693024a44c7cc5f502e1b95f1812dcafd864d091c51a
_journal.json https://github.com/simstudioai/sim/pull/4997/files#diff-37150cc65ad16ee6fbc5fa318fc096be7730e16d63eaf863e3df5521b7030649
apps/sim/app/api/table/[tableId]/delete-async/route.tshttps://github.com/simstudioai/sim/pull/4997/files#diff-86aaf5671f84f96632daab7807f39b084f93a4aafe458a04607c56cf8703c8ea
View file https://github.com/simstudioai/sim/blob/a0cf0c94ae9a6985a0e74fb81ddf75acd05d4f2d/apps/sim/app/api/table/%5BtableId%5D/delete-async/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4997/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4997/files#diff-86aaf5671f84f96632daab7807f39b084f93a4aafe458a04607c56cf8703c8ea
https://github.com/simstudioai/sim/pull/4997/files#diff-86aaf5671f84f96632daab7807f39b084f93a4aafe458a04607c56cf8703c8ea
https://github.com/simstudioai/sim/pull/4997/files#diff-86aaf5671f84f96632daab7807f39b084f93a4aafe458a04607c56cf8703c8ea
https://github.com/simstudioai/sim/pull/4997/files#diff-86aaf5671f84f96632daab7807f39b084f93a4aafe458a04607c56cf8703c8ea
apps/sim/background/table-delete.tshttps://github.com/simstudioai/sim/pull/4997/files#diff-9546f9e53bb60c35d2fd3b30b65542978b3fc207609e0d4468052fb1210487ea
View file https://github.com/simstudioai/sim/blob/a0cf0c94ae9a6985a0e74fb81ddf75acd05d4f2d/apps/sim/background/table-delete.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4997/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4997/files#diff-9546f9e53bb60c35d2fd3b30b65542978b3fc207609e0d4468052fb1210487ea
https://github.com/simstudioai/sim/pull/4997/files#diff-9546f9e53bb60c35d2fd3b30b65542978b3fc207609e0d4468052fb1210487ea
Please reload this pagehttps://github.com/simstudioai/sim/pull/4997/files
apps/sim/lib/table/constants.tshttps://github.com/simstudioai/sim/pull/4997/files#diff-3789ef10f28c4ed64a7728377279f3fb4f153bc42fb87c1db3405e79ee97fcf5
View file https://github.com/simstudioai/sim/blob/a0cf0c94ae9a6985a0e74fb81ddf75acd05d4f2d/apps/sim/lib/table/constants.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4997/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4997/files#diff-3789ef10f28c4ed64a7728377279f3fb4f153bc42fb87c1db3405e79ee97fcf5
https://github.com/simstudioai/sim/pull/4997/files#diff-3789ef10f28c4ed64a7728377279f3fb4f153bc42fb87c1db3405e79ee97fcf5
apps/sim/lib/table/delete-runner.test.tshttps://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
View file https://github.com/simstudioai/sim/blob/a0cf0c94ae9a6985a0e74fb81ddf75acd05d4f2d/apps/sim/lib/table/delete-runner.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4997/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
https://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
https://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
https://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
https://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
https://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
https://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
https://github.com/simstudioai/sim/pull/4997/files#diff-2f0a55d8239a5683314ff1c860ecce36679afbe6d3a599db9574bf131c9598f7
apps/sim/lib/table/delete-runner.tshttps://github.com/simstudioai/sim/pull/4997/files#diff-09254d41b01b6cdad343c7efb45a23f8abcc32c3f2a0a06934f859cabcbb855b
View file https://github.com/simstudioai/sim/blob/a0cf0c94ae9a6985a0e74fb81ddf75acd05d4f2d/apps/sim/lib/table/delete-runner.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4997/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4997/files#diff-09254d41b01b6cdad343c7efb45a23f8abcc32c3f2a0a06934f859cabcbb855b
https://github.com/simstudioai/sim/pull/4997/files#diff-09254d41b01b6cdad343c7efb45a23f8abcc32c3f2a0a06934f859cabcbb855b
Please reload this pagehttps://github.com/simstudioai/sim/pull/4997/files
https://github.com/simstudioai/sim/pull/4997/files#diff-09254d41b01b6cdad343c7efb45a23f8abcc32c3f2a0a06934f859cabcbb855b
https://github.com/simstudioai/sim/pull/4997/files#diff-09254d41b01b6cdad343c7efb45a23f8abcc32c3f2a0a06934f859cabcbb855b
https://github.com/simstudioai/sim/pull/4997/files#diff-09254d41b01b6cdad343c7efb45a23f8abcc32c3f2a0a06934f859cabcbb855b
Please reload this pagehttps://github.com/simstudioai/sim/pull/4997/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4997/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.