Title: fix(knowledge): index the connector tombstone check so a sync stops scanning the whole document table by waleedlatif1 · Pull Request #8122 · simstudioai/sim · GitHub
Open Graph Title: fix(knowledge): index the connector tombstone check so a sync stops scanning the whole document table by waleedlatif1 · Pull Request #8122 · simstudioai/sim
X Title: fix(knowledge): index the connector tombstone check so a sync stops scanning the whole document table by waleedlatif1 · Pull Request #8122 · simstudioai/sim
Description: Summary add a partial index on document (connector_id) WHERE archived_at IS NULL AND (deleted_at IS NOT NULL OR content_hash IS NULL), the exact predicate of the connector sync's tombstone check that check runs SELECT id … LIMIT 1 on every connector sync; the planner estimates thousands of matches and picks a sequential scan expecting to stop early, so a connector with no tombstoned documents reads the entire document table on every sync. Under I/O pressure that statement hits the 60 s statement timeout, the sync fails with SQLSTATE 57014, and ten such failures disable the connector the index makes the check a point lookup regardless of table size or load migration 0374 builds it concurrently with the usual commit breakpoint and replay-safe drop Type of Change Bug fix Testing bun run check:migrations origin/staging passes the query's predicate implies the index predicate (each disjunct implies its counterpart), so the planner can use it; verified the current plan on a production-shaped table is a sequential scan 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 add a partial index on document (connector_id) WHERE archived_at IS NULL AND (deleted_at IS NOT NULL OR content_hash IS NULL), the exact predicate of the connector sync's tombstone che...
X Description: Summary add a partial index on document (connector_id) WHERE archived_at IS NULL AND (deleted_at IS NOT NULL OR content_hash IS NULL), the exact predicate of the connector sync's tombstone...
Opengraph URL: https://github.com/simstudioai/sim/pull/8122
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a82f5637-aa5d-e7c7-c52d-64e31aed0f06 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B152:250D58:2DCA5:3EDB6:6AFB64AA |
| html-safe-nonce | 538d141c4c17858b501dd1101d020037737ebc30f55988930fde556673ecb6c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTUyOjI1MEQ1ODoyRENBNTozRURCNjo2QUZCNjRBQSIsInZpc2l0b3JfaWQiOiI2MTY2MTg1Njk1Njk0Nzc1NDY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 081cae4fcd596133c10aaef2d0141087ff167f1ae3211f08ac7c36d36fe48dc7 |
| hovercard-subject-tag | pull_request:4597901526 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/8122/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary add a partial index on document (connector_id) WHERE archived_at IS NULL AND (deleted_at IS NOT NULL OR content_hash IS NULL), the exact predicate of the connector sync's tombstone che... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ef97164c52cf59bd10558ddec9c4f482763988 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width