Skip to content

A few sync_local simplifications - #219

Draft
simolus3 wants to merge 3 commits into
mainfrom
sync-local-refactor
Draft

A few sync_local simplifications#219
simolus3 wants to merge 3 commits into
mainfrom
sync-local-refactor

Conversation

@simolus3

@simolus3 simolus3 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

When sync_local is called for partial checkpoints, we currently pass a JSON array of bucket names around in Rust. This PR simplifies that by passing the actual bucket names around as a vector of string references, and only serializes to JSON in the single place where we bind them to a SQL query.

I have also experimented with an approach splitting the statements (first finding updated rows, then looking up the latest oplog entry in a separate prepared statement) which avoids the serialization entirely, but causes many more reads in the sync local performance test.

Additionally, this changes how statements used to forward writes in sync_local are created: Instead of having separate branches for raw and mananged tables in the oplog loop, this prepares statements for managed views through PreparedPendingStatement. This is mainly a preparation for a third type of table (managed by the core extension while using direct columns), but is also a simplification.

AI use: Reviewed with Claude Code.

@simolus3
simolus3 requested a review from rkistner September 2, 2026 13:05
@simolus3
simolus3 marked this pull request as draft September 8, 2026 11:38
@simolus3

simolus3 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for the noise, while working on raw tables more I realized there are additional changes I want to include here.

@simolus3 simolus3 changed the title Avoid passing partial arguments as string to sync_local A few sync_local simplifications Sep 8, 2026
@simolus3
simolus3 force-pushed the sync-local-refactor branch from ea9b215 to 6e5227b Compare September 9, 2026 07:53
@simolus3
simolus3 added this pull request to stack #222 September 9, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant