Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f68faf4

Browse files
Fix comments about deduplication updating page.
nbtree deduplication passes add tuples from the original/target page to a temp page, merging as necessary. The temp page is copied back to the target permanent page in the critical section. This is similar to the approach taken by nbtree page splits. Adjust comments that referred to updating the original page in-place as tuples were merged. These were left over from earlier versions of the deduplication patch that didn't yet use a temp page.
1 parent b2fe783 commit f68faf4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/backend/access/nbtree/nbtdedup.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ _bt_dedup_pass(Relation rel, Buffer buf, Relation heapRel, IndexTuple newitem,
166166
* maxpostingsize).
167167
*
168168
* If state contains pending posting list with more than one item,
169-
* form new posting tuple, and actually update the page. Else
170-
* reset the state and move on without modifying the page.
169+
* form new posting tuple and add it to our temp page (newpage).
170+
* Else add pending interval's base tuple to the temp page as-is.
171171
*/
172172
pagesaving += _bt_dedup_finish_pending(newpage, state);
173173

@@ -184,7 +184,8 @@ _bt_dedup_pass(Relation rel, Buffer buf, Relation heapRel, IndexTuple newitem,
184184
* stop merging together tuples altogether. The few tuples
185185
* that remain at the end of the page won't be merged together
186186
* at all (at least not until after a future page split takes
187-
* place).
187+
* place, when this page's newly allocated right sibling page
188+
* gets its first deduplication pass).
188189
*/
189190
if (state->nmaxitems == 5)
190191
_bt_singleval_fillfactor(page, state, newitemsz);

0 commit comments

Comments
 (0)