Re: Adding REPACK [concurrently]

From: Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Treat <rob(at)xzilla(dot)net>
Subject: Re: Adding REPACK [concurrently]
Date: 2026-03-07 14:28:00
Message-ID: CADzfLwVVxC-Ptp98B=gTQgT7uuWY1KnQDLBhGkP1NS3iz-AYcA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

On Thu, Mar 5, 2026 at 8:06 PM Antonin Houska <ah(at)cybertec(dot)at> wrote:
> This is it. One more diff added, to engage BulkInsertState.

Few more comments:

> * In case functions in the index need the active snapshot and caller
> * hasn't set one.

Looks like a stale comment.

-----------

> recheck = ExecInsertIndexTuples(iistate->rri,
> iistate->estate,
> 0,
> index_slot,
> NIL, NULL);

Such code in apply_concurrent_update and apply_concurrent_insert.
AFAIU we need to call ResetPerTupleExprContext(iistate->estate); after
list_free(recheck); to avoid small per-row memory leak.

-----------------

In find_target_tuple index_rescan is called before setting the
sk_argument - it works, but feels to be incorrect for the common case.
We should call it once entry->sk_argument is ready.

-----------------

I put possible fixes into the attached patch.

Mikhail.

Attachment Content-Type Size
nocfbot-review_changes.patch application/octet-stream 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nick Cleaton 2026-03-07 15:01:48 Re: [PATCH] libpq: try all addresses for a host before moving to next on target_session_attrs mismatch
Previous Message Evgeny Voropaev 2026-03-07 13:56:18 Compress prune/freeze records with Delta Frame of Reference algorithm