Re: Patch: Pass IndexInfo correctly to aminsert for indexes on TOAST

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "Ahuja, Nitin" <nitahuja(at)amazon(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Pass IndexInfo correctly to aminsert for indexes on TOAST
Date: 2018-02-26 13:48:52
Message-ID: CA+TgmoajesRph4TcuBY=4s_GjvCyN34-sGbM5=APC=FH7k32jQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 22, 2018 at 9:13 PM, Ahuja, Nitin <nitahuja(at)amazon(dot)com> wrote:
> Patch Description
> Currently, while saving the TOAST entry the call to index access method
> insert (aminsert) passed IndexInfo attribute as NULL. IndexInfo parameter
> was introduced in Postgres 10 for the aminsert method to allow caching data
> across aminsert calls within a single SQL statement. The IndexInfo is passed
> correctly for regular tuple insertion but not for TOAST entries. This
> currently prohibits aminsert method to be able to use IndexInfo for TOAST
> entries.
>
> This patch correctly passes the built IndexInfo to aminsert for TOAST
> entries.

If you don't offer any justification for the patch it's unlikely to be
accepted. BuildIndexInfo() isn't free, so unless it hurts something
to skip calling it, we should keep skipping it.

Also, your patch is (a) in the body of the email instead of attached,
(b) in HTML format, and (c) reversed -- if it were properly formatted,
the original hunks would be first and the revised ones second.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-02-26 13:51:34 Re: remove pg_class.relhaspkey
Previous Message Craig Ringer 2018-02-26 13:36:52 Re: Using JSONB directly from application