Re: pgstatindex vs. !indisready - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pgstatindex vs. !indisready
Date
Msg-id ZTXQxnZ1n1psnyXT@paquier.xyz
Whole thread Raw
In response to Re: pgstatindex vs. !indisready  (Noah Misch <noah@leadboat.com>)
List 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

Attachment

pgsql-hackers by date:

Previous
From: sirisha chamarthi
Date:
Subject: Re: Why is hot_standby_feedback off by default?
Next
From: sirisha chamarthi
Date:
Subject: Re: Why is hot_standby_feedback off by default?