Re: Could not use index because of indcheckxmin is true - Mailing list pgsql-sql

From Tom Lane
Subject Re: Could not use index because of indcheckxmin is true
Date
Msg-id 1025275.1697121002@sss.pgh.pa.us
Whole thread Raw
In response to Could not use index because of indcheckxmin is true  (Japin Li <japinli@hotmail.com>)
Responses Re: Could not use index because of indcheckxmin is true  (Japin Li <japinli@hotmail.com>)
List pgsql-sql
Japin Li <japinli@hotmail.com> writes:
> When I create an index using CREATE INDEX (without concurrently), I get
> an index which indcheckxmin is true.  According to the docs[1], it cannot
> be used with indcheckxmin is ture, how can I fix this?

There is nothing to fix; you just wait a little bit.

>> indcheckxmin bool
>> If true, queries must not use the index until the xmin of this pg_index
>> row is below their TransactionXmin event horizon, because the table may
>> contain broken HOT chains with incompatible rows that they can see

Note the "until" clause.  Once transactions that ran concurrently
with the CREATE INDEX are done, the index is available for use.
There is no need for anyone to clear the indcheckxmin flag, and
AFAIR there is no code that does so.

            regards, tom lane



pgsql-sql by date:

Previous
From: Japin Li
Date:
Subject: Could not use index because of indcheckxmin is true
Next
From: Japin Li
Date:
Subject: Re: Could not use index because of indcheckxmin is true