Skip to content

Add table option to skip empty updates #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025
Merged

Add table option to skip empty updates #66

merged 2 commits into from
Apr 24, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Mar 20, 2025

For updates on views that happen to not change any columns (e.g. a SET col = LOWER(col) where all values in col were already in lower case), we currently insert an empty update operation into the local upload queue. While this can be resolved by users rewriting SQL statements and typically shouldn't make up a bulk of the queue, we've seen a report claiming that skipping empty updates speeds up uploads: powersync-ja/powersync-kotlin#144.

Ignoring empty updates entirely might break users relying on the current behavior, so this adds an opt-in option to ignore schema updates. For this, the powersync_crud_ vtab gains a new hidden column with option flags that can be set for inserts. FLAG_IGNORE_EMPTY_UPDATE, which is disabled by default, would make an insert into ps_crud do nothing if it's an empty update.

Copy link
Contributor

@rkistner rkistner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with the approach

@simolus3 simolus3 force-pushed the skip-empty-updates branch from 041dcdb to 515602b Compare April 24, 2025 10:10
@simolus3 simolus3 changed the base branch from update-metadata to update-options-update April 24, 2025 10:10
@simolus3 simolus3 changed the base branch from update-options-update to main April 24, 2025 11:23
@simolus3 simolus3 merged commit 410cd77 into main Apr 24, 2025
21 checks passed
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.

2 participants