pg_am

PostgreSQL 7.3.4 Documentation
Prev | Chapter 3. System Catalogs | Next

# 3.3. pg_am

`pg_am` stores information about index access methods. There is one row for each index access method supported by the system.

Table 3-3. pg_am Columns

Name | Type | References | Description
--- | --- | --- | ---
amname | `name` |  | name of the access method
amowner | `int4` | pg_shadow.usesysid | user ID of the owner (currently not used)
amstrategies | `int2` |  | number of operator strategies for this access method
amsupport | `int2` |  | number of support routines for this access method
amorderstrategy | `int2` |  | zero if the index offers no sort order, otherwise the strategy number of the strategy operator that describes the sort order
amcanunique | `bool` |  | does AM support unique indexes?
amcanmulticol | `bool` |  | does AM support multicolumn indexes?
amindexnulls | `bool` |  | does AM support NULL index entries?
amconcurrent | `bool` |  | does AM support concurrent updates?
amgettuple | `regproc` | pg_proc.oid | "next valid tuple" function
aminsert | `regproc` | pg_proc.oid | "insert this tuple" function
ambeginscan | `regproc` | pg_proc.oid | "start new scan" function
amrescan | `regproc` | pg_proc.oid | "restart this scan" function
amendscan | `regproc` | pg_proc.oid | "end this scan" function
ammarkpos | `regproc` | pg_proc.oid | "mark current scan position" function
amrestrpos | `regproc` | pg_proc.oid | "restore marked scan position" function
ambuild | `regproc` | pg_proc.oid | "build new index" function
ambulkdelete | `regproc` | pg_proc.oid | bulk-delete function
amcostestimate | `regproc` | pg_proc.oid | estimate cost of an indexscan

An index AM that supports multiple columns (has `amcanmulticol` true) must support indexing nulls in columns after the first, because the planner will assume the index can be used for queries on just the first column(s). For example, consider an index on (a,b) and a query WHERE a = 4. The system will assume the index can be used to scan for rows with a = 4, which is wrong if the index omits rows where b is null. However it is okay to omit rows where the first indexed column is null. (GiST currently does so.) `amindexnulls` should be set true only if the index AM indexes all rows, including arbitrary combinations of nulls.

Prev | Home | Next
pg_aggregate | Up | pg_amop