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:
@ -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