Indexes in PostgreSQL — 2
Interface
In the first article, we've mentioned that an access method must provide information about itself. Let's look into the structure of the access method interface.
Properties
All properties of access methods are stored in the «pg_am» table («am» stands for access method). We can also get a list of available methods from this same table:
postgres=# select amname from pg_am;
amname
--------
btree
hash
gist
gin
spgist
brin
(6 rows)
Although sequential scan can rightfully be referred to access methods, it is not on this list for historical reasons.
In PostgreSQL versions 9.5 and lower, each property was represented with a separate field of the «pg_am» table. Starting with version 9.6, properties are queried with special functions and are separated into several layers:
- Access method properties — «pg_indexam_has_property»
- Properties of a specific index — «pg_index_has_property»
- Properties of individual columns of the index — «pg_index_column_has_property»
The access method layer and index layer are separated with an eye towards the future: as of now, all indexes based on one access method will always have the same properties.











This chapter was translated from Russian jointly by author and by 













