pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@kurilemu.de>
To: Chao Li <li.evan.chao@gmail.com>
Cc: Antonin Houska <ah@cybertec.at>
Cc: Kirill Reshke <reshkekirill@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Fix REPACK with WITHOUT OVERLAPS replica identity indexes
Date: Thu, 10 Sep 2026 18:05:05 +0200
Message-ID: <aqLTreG8ePby8ud4@alvherre.pgsql> (raw)
In-Reply-To: <69CA7636-0359-42B6-B971-16A036698187@gmail.com>

On 2026-May-13, Chao Li wrote:

> After some investigation, I think I see the mismatch:
> 
> * get_relation_info(): non-ordered GiST cannot provide sort order.
> That is expected.
> * copy_table_data() only uses plan_cluster_use_sort() for btree. For
> any other clusterable index, it sets use_sort = false and does a raw
> index scan.
> * The docs say REPACK can re-sort using index scan “if the index is a
> b-tree” or seqscan+sort, which does not describe what the code
> actually does for GiST.
> 
> I am not sure whether we should change the behavior in PG19. Alvaro
> may have a better idea about that. But I agree that we can at least
> clarify the code comment and documentation. The attached patch
> attempts to do that.

I am sure that we should not change the behavior for 19.  We could
change it in 20, perhaps.  But I think the really gross problem is that
somehow I made the documentation say exactly the opposite of truth, in
the rework for commit ac58465e0618.  I fixed that just now with by
pushing 07aef52eba3c, which includes your (Chao's) proposed change; but
also, while reading and rereading the existing docs and your patch, it
struck me that the preexisting text was not super nice either: there was
one introductory text, then some technical details, then some more
discussion, then more technicalities.  That was weird and probably just
historical accident.  I reordered the text and made some other wording
changes.  I *think* result is reasonable, or at least it contains no
egregious errors; but maybe it could be further improved, if anybody is
interested.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"El Maquinismo fue proscrito so pena de cosquilleo hasta la muerte"
(Ijon Tichy en Viajes, Stanislaw Lem)






view thread (12+ messages)

Message-ID: <aqLTreG8ePby8ud4@alvherre.pgsql>
Permalink:  ../aqLTreG8ePby8ud4@alvherre.pgsql/
Also on:    postgresql.org/message-id/aqLTreG8ePby8ud4@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@kurilemu.de, li.evan.chao@gmail.com, ah@cybertec.at, reshkekirill@gmail.com
  Subject: Re: Fix REPACK with WITHOUT OVERLAPS replica identity indexes
  In-Reply-To: <aqLTreG8ePby8ud4@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox