Re: Index AmInsert Parameter Confused?

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: jacktby jacktby <jacktby(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Index AmInsert Parameter Confused?
Date: 2023-09-26 16:45:05
Message-ID: CAEze2Wi2FO3ZZiMPPUYA8k7C=Rf9+Con3kK3h=yMPnZ_tv52JA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 26 Sept 2023 at 18:38, jacktby jacktby <jacktby(at)gmail(dot)com> wrote:
>
> typedef bool (*aminsert_function) (Relation indexRelation,
> Datum *values,
> bool *isnull,
> ItemPointer heap_tid,
> Relation heapRelation,
> IndexUniqueCheck checkUnique,
> bool indexUnchanged,
> struct IndexInfo *indexInfo);
>
> Why is there a heap_tid, We haven’t inserted the value, so where does it from ?

Index insertion only happens after the TableAM tuple has been
inserted. As indexes refer to locations in the heap, this TID contains
the TID of the table tuple that contains the indexed values, so that
the index knows which tuple to refer to.

Note that access/amapi.h describes only index AM APIs; it does not
cover the table AM APIs descibed in access/tableam.h

Kind regards,

Matthias van de Meent

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2023-09-26 17:00:12 Re: Questions about the new subscription parameter: password_required
Previous Message Heikki Linnakangas 2023-09-26 16:29:44 Re: False "pg_serial": apparent wraparound” in logs