Re: REINDEX in tables

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Matthias Apitz <guru(at)unixarea(dot)de>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: REINDEX in tables
Date: 2023-10-25 13:17:17
Message-ID: ZTkVXSBrHlTWQElP@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 25, 2023 at 02:14:49PM +0200, Andreas Kretschmer wrote:
> Am 25.10.23 um 14:11 schrieb Laurenz Albe:
> > On Wed, 2023-10-25 at 11:59 +0200, Andreas Kretschmer wrote:
> > > Am 25.10.23 um 11:57 schrieb Matthias Apitz:
> > > > El día miércoles, octubre 25, 2023 a las 11:33:11 +0200, Andreas Kretschmer escribió:
> > > > > Am 25.10.23 um 11:24 schrieb Matthias Apitz:
> > > > > > We have a client who run REINDEX in certain tables of the database of
> > > > > > our application (on Linux with PostgreSQL 13.x):
> > > > > >
> > > > > > REINDEX TABLE CONCURRENTLY d83last;
> > > > > > REINDEX TABLE CONCURRENTLY d86plz;
> > > > > > REINDEX TABLE CONCURRENTLY ig_memtable;
> > > > > > REINDEX TABLE CONCURRENTLY ig_dictionary;
> > > > > > REINDEX TABLE CONCURRENTLY ig_dictionary;
> > > > > > REINDEX TABLE CONCURRENTLY d50zweig ;
> > > > > > REINDEX TABLE CONCURRENTLY d50zweig ;
> > > > > >
> > > > > > We as the software vendor and support, do not use or recommend this
> > > > > > procedure, because we have own SQL files for creating or deleting
> > > > > > indices in the around 400 tables.
> > > > > >
> > > > > > The client is now concerned about the issue that the number of
> > > > > > rows in some of the above tables has increased. Is this possible?
> > > no, reindex will not add rows to the table.
> > But if the indexes were corrupted before the REINDEX, it is possible that
> > a query that didn't find a result before the REINDEX can find one afterwards.
>
> Thanks for the addition my friend, that's correct and could be an
> explanation here.

However, if that is happening, there is something seriously wrong,
perhaps bad hardware. I would find the cause of this corruption.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Олег Самойлов 2023-10-25 14:58:15 Re: Very newbie question
Previous Message Andreas Kretschmer 2023-10-25 12:14:49 Re: REINDEX in tables