mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Pass ItemPointer not HeapTuple to IndexBuildCallback.
Not all AMs use HeapTuples internally, making it inconvenient to pass a HeapTuple. As the index callbacks really only need the TID, not the full tuple, modify callback to only take ItemPointer. Author: Ashwin Agrawal Reviewed-By: Andres Freund Discussion: https://postgr.es/m/CALfoeis6=8ehuR=VNtHvj3z16cYfCwPdTcpaxU+sfSUJ5QgR3g@mail.gmail.com
This commit is contained in:
@ -140,7 +140,7 @@ static BTScanInsert bt_right_page_check_scankey(BtreeCheckState *state);
|
||||
static void bt_downlink_check(BtreeCheckState *state, BTScanInsert targetkey,
|
||||
BlockNumber childblock);
|
||||
static void bt_downlink_missing_check(BtreeCheckState *state);
|
||||
static void bt_tuple_present_callback(Relation index, HeapTuple htup,
|
||||
static void bt_tuple_present_callback(Relation index, ItemPointer tid,
|
||||
Datum *values, bool *isnull,
|
||||
bool tupleIsAlive, void *checkstate);
|
||||
static IndexTuple bt_normalize_tuple(BtreeCheckState *state,
|
||||
@ -1890,7 +1890,7 @@ bt_downlink_missing_check(BtreeCheckState *state)
|
||||
* also allows us to detect the corruption in many cases.
|
||||
*/
|
||||
static void
|
||||
bt_tuple_present_callback(Relation index, HeapTuple htup, Datum *values,
|
||||
bt_tuple_present_callback(Relation index, ItemPointer tid, Datum *values,
|
||||
bool *isnull, bool tupleIsAlive, void *checkstate)
|
||||
{
|
||||
BtreeCheckState *state = (BtreeCheckState *) checkstate;
|
||||
@ -1901,7 +1901,7 @@ bt_tuple_present_callback(Relation index, HeapTuple htup, Datum *values,
|
||||
|
||||
/* Generate a normalized index tuple for fingerprinting */
|
||||
itup = index_form_tuple(RelationGetDescr(index), values, isnull);
|
||||
itup->t_tid = htup->t_self;
|
||||
itup->t_tid = *tid;
|
||||
norm = bt_normalize_tuple(state, itup);
|
||||
|
||||
/* Probe Bloom filter -- tuple should be present */
|
||||
|
@ -72,7 +72,7 @@ initCachedPage(BloomBuildState *buildstate)
|
||||
* Per-tuple callback for table_index_build_scan.
|
||||
*/
|
||||
static void
|
||||
bloomBuildCallback(Relation index, HeapTuple htup, Datum *values,
|
||||
bloomBuildCallback(Relation index, ItemPointer tid, Datum *values,
|
||||
bool *isnull, bool tupleIsAlive, void *state)
|
||||
{
|
||||
BloomBuildState *buildstate = (BloomBuildState *) state;
|
||||
@ -81,7 +81,7 @@ bloomBuildCallback(Relation index, HeapTuple htup, Datum *values,
|
||||
|
||||
oldCtx = MemoryContextSwitchTo(buildstate->tmpCtx);
|
||||
|
||||
itup = BloomFormTuple(&buildstate->blstate, &htup->t_self, values, isnull);
|
||||
itup = BloomFormTuple(&buildstate->blstate, tid, values, isnull);
|
||||
|
||||
/* Try to add next item to cached page */
|
||||
if (BloomPageAddItem(&buildstate->blstate, buildstate->data.data, itup))
|
||||
|
Reference in New Issue
Block a user