1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Revert indexed and enlargable binary heap implementation.

This reverts commit b840508644 and bcb14f4abc. These commits were made
for commit 5bec1d6bc5 (Improve eviction algorithm in ReorderBuffer
using max-heap for many subtransactions). However, per discussion,
commit efb8acc0d0 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
This commit is contained in:
Masahiko Sawada
2024-04-11 17:18:05 +09:00
parent efb8acc0d0
commit 810f64a015
10 changed files with 38 additions and 259 deletions

View File

@ -422,7 +422,6 @@ gather_merge_setup(GatherMergeState *gm_state)
/* Allocate the resources for the merge */
gm_state->gm_heap = binaryheap_allocate(nreaders + 1,
heap_compare_slots,
false,
gm_state);
}

View File

@ -125,7 +125,7 @@ ExecInitMergeAppend(MergeAppend *node, EState *estate, int eflags)
mergestate->ms_nplans = nplans;
mergestate->ms_slots = (TupleTableSlot **) palloc0(sizeof(TupleTableSlot *) * nplans);
mergestate->ms_heap = binaryheap_allocate(nplans, heap_compare_slots, false,
mergestate->ms_heap = binaryheap_allocate(nplans, heap_compare_slots,
mergestate);
/*

View File

@ -258,8 +258,7 @@ PgArchiverMain(char *startup_data, size_t startup_data_len)
/* Initialize our max-heap for prioritizing files to archive. */
arch_files->arch_heap = binaryheap_allocate(NUM_FILES_PER_DIRECTORY_SCAN,
ready_file_comparator, false,
NULL);
ready_file_comparator, NULL);
/* Initialize our memory context. */
archive_context = AllocSetContextCreate(TopMemoryContext,

View File

@ -1303,7 +1303,6 @@ ReorderBufferIterTXNInit(ReorderBuffer *rb, ReorderBufferTXN *txn,
/* allocate heap */
state->heap = binaryheap_allocate(state->nr_txns,
ReorderBufferIterCompare,
false,
state);
/* Now that the state fields are initialized, it is safe to return it. */

View File

@ -3014,7 +3014,6 @@ BufferSync(int flags)
*/
ts_heap = binaryheap_allocate(num_spaces,
ts_ckpt_progress_comparator,
false,
NULL);
for (i = 0; i < num_spaces; i++)