| From: | Peter Geoghegan <pg(at)bowt(dot)ie> |
|---|---|
| To: | Darren Lafreniere <dlafreniere(at)onezero(dot)com> |
| Cc: | "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Querying an index's btree version |
| Date: | 2020-03-11 20:30:38 |
| Message-ID: | CAH2-Wzkwg=A7bR8NvS4hjUQX9BkB7zjxMTunB6JM-pbR+9btyQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Wed, Mar 11, 2020 at 1:26 PM Darren Lafreniere
<dlafreniere(at)onezero(dot)com> wrote:
> We've read that PG 12 has improved btree index support, and that the latest internal btree version was bumped from 3 to 4. Is it possible to query the btree version that a particular index is using? We'd like to automatically start a concurrent re-index if we detect any btree indexes are still on version 3.
It's possible, but you have to install the superuser-only pageinspect
extension. Here is how you'd determine that an index called
'pg_aggregate_fnoid_index' is on version 4:
regression=# create extension pageinspect;
CREATE EXTENSION
regression=# select version from bt_metap('pg_aggregate_fnoid_index');
version
---------
4
(1 row)
--
Peter Geoghegan
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Adrian Klaver | 2020-03-11 20:34:14 | Re: Streaming replication - 11.5 |
| Previous Message | Darren Lafreniere | 2020-03-11 20:25:51 | Querying an index's btree version |