Re: GIN index not used if created in the same transaction as query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Brusselback <adambrusselback(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: GIN index not used if created in the same transaction as query
Date: 2017-05-19 16:09:58
Message-ID: 437.1495210198@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Adam Brusselback <adambrusselback(at)gmail(dot)com> writes:
> Is there any easy way I can know if an index is usable or not? Are there
> any catalog views or anything I could check that in?

IIRC, you can look at pg_index.indcheckxmin --- if that's set, then
the index had broken HOT chains during creation and may not be usable
right away. Telling whether your own transaction can use it is harder
from SQL level, but if you're in the same transaction that made the
index then the answer is probably always "no" :-(

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2017-05-19 23:04:36 pg_stat_statements with fetch
Previous Message Adam Brusselback 2017-05-19 15:49:32 Re: GIN index not used if created in the same transaction as query