Skip to content

Commit 20ff3e4

Browse files
committed
Merge branch 'docs' into postgres-bucket-storage
2 parents a5ea6ad + ed6795f commit 20ff3e4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

usage/lifecycle-maintenance/compacting-buckets.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ DELETE FROM lists WHERE name = 'b';
8282

8383
After compacting, the bucket looks like this:
8484

85-
8685
```bash
8786
(1, PUT, row_1, <data>)
8887
(2, MOVE)
@@ -95,7 +94,7 @@ After compacting, the bucket looks like this:
9594
(100001, REMOVE, row50000)
9695
```
9796

98-
This is inefficient, since we have over 100k operations for downloading a single actual row.
97+
This is inefficient, since we have over 100k operations for downloading a single row.
9998

10099
To handle this case, we "defragment" the bucket by updating existing rows in the source database. In this case, we can run:
101100

@@ -115,6 +114,10 @@ This creates a new PUT operation at the end of the bucket, which allows the comp
115114

116115
The bucket is now back to two operations, allowing new clients to sync efficiently.
117116

117+
<Check>
118+
Note: All rows in the bucket must be updated for this to be effective.
119+
</Check>
120+
118121
### Defragmenting trade-offs
119122

120123
Defragmenting + compacting as described above can significantly reduce the number of operations in a bucket, at the cost of existing clients needing to re-sync that data. When and how to do this depends on the specific use-case and data update patterns.
@@ -137,4 +140,4 @@ In the future, we may use [incremental sync rule reprocessing](https://roadmap.p
137140

138141
## Technical details
139142

140-
See the [documentation](https://github.com/powersync-ja/powersync-service/blob/main/docs/compacting-operations.md) in the `powersync-service` repo for more technical details on compacting.
143+
See the [documentation](https://github.com/powersync-ja/powersync-service/blob/main/docs/compacting-operations.md) in the `powersync-service` repo for more technical details on compacting.

0 commit comments

Comments
 (0)