File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ impl<'a> SyncOperation<'a> {
114114 if self . data_tables . contains ( & table_name) {
115115 let quoted = quote_internal_name ( type_name, false ) ;
116116
117- // is_err() is essentially a NULL check here
117+ // is_err() is essentially a NULL check here.
118+ // NULL data means no PUT operations found, so we delete the row.
118119 if data. is_err ( ) {
119120 // DELETE
120121 let delete_statement = self
@@ -190,6 +191,7 @@ impl<'a> SyncOperation<'a> {
190191 "\
191192 -- 1. Filter oplog by the ops added but not applied yet (oplog b).
192193-- We do not do any DISTINCT operation here, since that introduces a temp b-tree.
194+ -- We filter out duplicates using the GROUP BY below.
193195WITH updated_rows AS (
194196 SELECT b.row_type, b.row_id FROM ps_buckets AS buckets
195197 CROSS JOIN ps_oplog AS b ON b.bucket = buckets.id
@@ -224,6 +226,7 @@ SELECT
224226 "\
225227 -- 1. Filter oplog by the ops added but not applied yet (oplog b).
226228-- We do not do any DISTINCT operation here, since that introduces a temp b-tree.
229+ -- We filter out duplicates using the GROUP BY below.
227230WITH
228231 involved_buckets (id) AS MATERIALIZED (
229232 SELECT id FROM ps_buckets WHERE ?1 IS NULL
You can’t perform that action at this time.
0 commit comments