Re: pgstatindex vs. !indisready

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgstatindex vs. !indisready
Date: 2023-10-23 01:47:50
Message-ID: ZTXQxnZ1n1psnyXT@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 22, 2023 at 02:02:45PM -0700, Noah Misch wrote:
> - /* OK, do it */
> - brinsummarize(indexRel, heapRel, heapBlk, true, &numSummarized, NULL);
> + /* see gin_clean_pending_list() */
> + if (indexRel->rd_index->indisvalid)
> + brinsummarize(indexRel, heapRel, heapBlk, true, &numSummarized, NULL);
> + else
> + ereport(DEBUG1,
> + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
> + errmsg("index \"%s\" is not valid",
> + RelationGetRelationName(indexRel))));

brinsummarize() could return 0 even for a valid index, and we would
not be able to make the difference with an invalid index. Perhaps you
are right and this is not a big deal in practice to do as you are
suggesting.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message sirisha chamarthi 2023-10-23 02:02:39 Re: Why is hot_standby_feedback off by default?
Previous Message sirisha chamarthi 2023-10-23 01:26:23 Re: Why is hot_standby_feedback off by default?