1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

Revert: Let table AM insertion methods control index insertion

This commit reverts b1484a3f19 per review by Andres Freund.

Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de
This commit is contained in:
Alexander Korotkov
2024-04-11 15:47:53 +03:00
parent bc1e2092eb
commit da841aa4dc
12 changed files with 28 additions and 72 deletions

View File

@@ -2257,8 +2257,7 @@ heap_multi_insert_pages(HeapTuple *heaptuples, int done, int ntuples, Size saveF
*/
void
heap_multi_insert(Relation relation, TupleTableSlot **slots, int ntuples,
CommandId cid, int options, BulkInsertState bistate,
bool *insert_indexes)
CommandId cid, int options, BulkInsertState bistate)
{
TransactionId xid = GetCurrentTransactionId();
HeapTuple *heaptuples;
@@ -2607,7 +2606,6 @@ heap_multi_insert(Relation relation, TupleTableSlot **slots, int ntuples,
slots[i]->tts_tid = heaptuples[i]->t_self;
pgstat_count_heap_insert(relation, ntuples);
*insert_indexes = true;
}
/*

View File

@@ -245,7 +245,7 @@ heapam_tuple_satisfies_snapshot(Relation rel, TupleTableSlot *slot,
static TupleTableSlot *
heapam_tuple_insert(Relation relation, TupleTableSlot *slot, CommandId cid,
int options, BulkInsertState bistate, bool *insert_indexes)
int options, BulkInsertState bistate)
{
bool shouldFree = true;
HeapTuple tuple = ExecFetchSlotHeapTuple(slot, true, &shouldFree);
@@ -261,8 +261,6 @@ heapam_tuple_insert(Relation relation, TupleTableSlot *slot, CommandId cid,
if (shouldFree)
pfree(tuple);
*insert_indexes = true;
return slot;
}

View File

@@ -273,11 +273,9 @@ table_tuple_get_latest_tid(TableScanDesc scan, ItemPointer tid)
* default command ID and not allowing access to the speedup options.
*/
void
simple_table_tuple_insert(Relation rel, TupleTableSlot *slot,
bool *insert_indexes)
simple_table_tuple_insert(Relation rel, TupleTableSlot *slot)
{
table_tuple_insert(rel, slot, GetCurrentCommandId(true), 0, NULL,
insert_indexes);
table_tuple_insert(rel, slot, GetCurrentCommandId(true), 0, NULL);
}
/*