Skip to content

Commit 810f64a

Browse files
Revert indexed and enlargable binary heap implementation.
This reverts commit b840508 and bcb14f4. These commits were made for commit 5bec1d6 (Improve eviction algorithm in ReorderBuffer using max-heap for many subtransactions). However, per discussion, commit efb8acc replaced binary heap + index with pairing heap, and made these commits unnecessary. Reported-by: Jeff Davis Discussion: https://postgr.es/m/12747c15811d94efcc5cda72d6b35c80d7bf3443.camel%40j-davis.com
1 parent efb8acc commit 810f64a

File tree

10 files changed

+38
-259
lines changed

10 files changed

+38
-259
lines changed

src/backend/executor/nodeGatherMerge.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ gather_merge_setup(GatherMergeState *gm_state)
422422
/* Allocate the resources for the merge */
423423
gm_state->gm_heap = binaryheap_allocate(nreaders + 1,
424424
heap_compare_slots,
425-
false,
426425
gm_state);
427426
}
428427

src/backend/executor/nodeMergeAppend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ExecInitMergeAppend(MergeAppend *node, EState *estate, int eflags)
125125
mergestate->ms_nplans = nplans;
126126

127127
mergestate->ms_slots = (TupleTableSlot **) palloc0(sizeof(TupleTableSlot *) * nplans);
128-
mergestate->ms_heap = binaryheap_allocate(nplans, heap_compare_slots, false,
128+
mergestate->ms_heap = binaryheap_allocate(nplans, heap_compare_slots,
129129
mergestate);
130130

131131
/*

src/backend/postmaster/pgarch.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ PgArchiverMain(char *startup_data, size_t startup_data_len)
258258

259259
/* Initialize our max-heap for prioritizing files to archive. */
260260
arch_files->arch_heap = binaryheap_allocate(NUM_FILES_PER_DIRECTORY_SCAN,
261-
ready_file_comparator, false,
262-
NULL);
261+
ready_file_comparator, NULL);
263262

264263
/* Initialize our memory context. */
265264
archive_context = AllocSetContextCreate(TopMemoryContext,

src/backend/replication/logical/reorderbuffer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,6 @@ ReorderBufferIterTXNInit(ReorderBuffer *rb, ReorderBufferTXN *txn,
13031303
/* allocate heap */
13041304
state->heap = binaryheap_allocate(state->nr_txns,
13051305
ReorderBufferIterCompare,
1306-
false,
13071306
state);
13081307

13091308
/* Now that the state fields are initialized, it is safe to return it. */

src/backend/storage/buffer/bufmgr.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3014,7 +3014,6 @@ BufferSync(int flags)
30143014
*/
30153015
ts_heap = binaryheap_allocate(num_spaces,
30163016
ts_ckpt_progress_comparator,
3017-
false,
30183017
NULL);
30193018

30203019
for (i = 0; i < num_spaces; i++)

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4200,7 +4200,6 @@ restore_toc_entries_parallel(ArchiveHandle *AH, ParallelState *pstate,
42004200
/* Set up ready_heap with enough room for all known TocEntrys */
42014201
ready_heap = binaryheap_allocate(AH->tocCount,
42024202
TocEntrySizeCompareBinaryheap,
4203-
false,
42044203
NULL);
42054204

42064205
/*

src/bin/pg_dump/pg_dump_sort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ TopoSort(DumpableObject **objs,
405405
return true;
406406

407407
/* Create workspace for the above-described heap */
408-
pendingHeap = binaryheap_allocate(numObjs, int_cmp, false, NULL);
408+
pendingHeap = binaryheap_allocate(numObjs, int_cmp, NULL);
409409

410410
/*
411411
* Scan the constraints, and for each item in the input, generate a count

0 commit comments

Comments
 (0)