From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adam Brusselback <adambrusselback@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: GIN index not used if created in the same transaction as query
Date: Fri, 19 May 2017 12:09:58 -0400
Message-ID: <437.1495210198@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMjNa7e-Q9DwX4TZqtuQNkitf0b0W65NsW54u7HLnMU+m2pbkw@mail.gmail.com>
References: <CAMjNa7c_=5pZL8T-kBhiRb0=an=DbpGg5jsYZ9guDs8i75jwcg@mail.gmail.com>
<31274.1495208001@sss.pgh.pa.us>
<CAMjNa7e-Q9DwX4TZqtuQNkitf0b0W65NsW54u7HLnMU+m2pbkw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Adam Brusselback <adambrusselback@gmail.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
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, adambrusselback@gmail.com
Subject: Re: GIN index not used if created in the same transaction as query
In-Reply-To: <437.1495210198@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox