PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/gin_private.h"
#include "access/hash.h"
#include "access/htup_details.h"
#include "access/nbtree.h"
#include "access/relation.h"
#include "access/table.h"
#include "catalog/namespace.h"
#include "catalog/pg_am.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "storage/lmgr.h"
#include "utils/builtins.h"
#include "utils/rel.h"
#include "utils/varlena.h"
Go to the source code of this file.
Data Structures | |
struct | BTIndexStat |
struct | GinIndexStat |
struct | HashIndexStat |
Macros | |
#define | IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX) |
#define | IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID) |
#define | IS_GIN(r) ((r)->rd_rel->relam == GIN_AM_OID) |
#define | IS_HASH(r) ((r)->rd_rel->relam == HASH_AM_OID) |
Typedefs | |
typedef struct BTIndexStat | BTIndexStat |
typedef struct GinIndexStat | GinIndexStat |
typedef struct HashIndexStat | HashIndexStat |
#define IS_BTREE | ( | r | ) | ((r)->rd_rel->relam == BTREE_AM_OID) |
Definition at line 71 of file pgstatindex.c.
#define IS_GIN | ( | r | ) | ((r)->rd_rel->relam == GIN_AM_OID) |
Definition at line 72 of file pgstatindex.c.
#define IS_HASH | ( | r | ) | ((r)->rd_rel->relam == HASH_AM_OID) |
Definition at line 73 of file pgstatindex.c.
#define IS_INDEX | ( | r | ) | ((r)->rd_rel->relkind == RELKIND_INDEX) |
Definition at line 70 of file pgstatindex.c.
typedef struct BTIndexStat BTIndexStat |
typedef struct GinIndexStat GinIndexStat |
typedef struct HashIndexStat HashIndexStat |
|
static |
Definition at line 745 of file pgstatindex.c.
References HashIndexStat::dead_items, FirstOffsetNumber, HashIndexStat::free_space, ItemIdIsDead, HashIndexStat::live_items, PageGetExactFreeSpace(), PageGetItemId(), and PageGetMaxOffsetNumber().
Referenced by pgstathashindex().
PG_FUNCTION_INFO_V1 | ( | pg_relpages | ) |
PG_FUNCTION_INFO_V1 | ( | pg_relpages_v1_5 | ) |
PG_FUNCTION_INFO_V1 | ( | pg_relpagesbyid | ) |
PG_FUNCTION_INFO_V1 | ( | pg_relpagesbyid_v1_5 | ) |
PG_FUNCTION_INFO_V1 | ( | pgstatginindex | ) |
PG_FUNCTION_INFO_V1 | ( | pgstatginindex_v1_5 | ) |
PG_FUNCTION_INFO_V1 | ( | pgstathashindex | ) |
PG_FUNCTION_INFO_V1 | ( | pgstatindex | ) |
PG_FUNCTION_INFO_V1 | ( | pgstatindex_v1_5 | ) |
PG_FUNCTION_INFO_V1 | ( | pgstatindexbyid | ) |
PG_FUNCTION_INFO_V1 | ( | pgstatindexbyid_v1_5 | ) |
Datum pg_relpages | ( | PG_FUNCTION_ARGS | ) |
Definition at line 395 of file pgstatindex.c.
References AccessShareLock, ereport, errcode(), errmsg(), ERROR, makeRangeVarFromNameList(), PG_GETARG_TEXT_PP, pg_relpages_impl(), PG_RETURN_INT64, relation_openrv(), relname, superuser(), and textToQualifiedNameList().
|
static |
Definition at line 456 of file pgstatindex.c.
References AccessShareLock, ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, RelationData::rd_rel, relation_close(), RelationGetNumberOfBlocks, and RelationGetRelationName.
Referenced by pg_relpages(), pg_relpages_v1_5(), pg_relpagesbyid(), and pg_relpagesbyid_v1_5().
Datum pg_relpages_v1_5 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 414 of file pgstatindex.c.
References AccessShareLock, makeRangeVarFromNameList(), PG_GETARG_TEXT_PP, pg_relpages_impl(), PG_RETURN_INT64, relation_openrv(), relname, and textToQualifiedNameList().
Datum pg_relpagesbyid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 428 of file pgstatindex.c.
References AccessShareLock, ereport, errcode(), errmsg(), ERROR, PG_GETARG_OID, pg_relpages_impl(), PG_RETURN_INT64, relation_open(), and superuser().
Datum pg_relpagesbyid_v1_5 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 445 of file pgstatindex.c.
References AccessShareLock, PG_GETARG_OID, pg_relpages_impl(), PG_RETURN_INT64, and relation_open().
Datum pgstatginindex | ( | PG_FUNCTION_ARGS | ) |
Definition at line 485 of file pgstatindex.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_OID, PG_RETURN_DATUM, pgstatginindex_internal(), and superuser().
Datum pgstatginindex_internal | ( | Oid | relid, |
FunctionCallInfo | fcinfo | ||
) |
Definition at line 507 of file pgstatindex.c.
References AccessShareLock, BufferGetPage(), elog, ereport, errcode(), errmsg(), ERROR, get_call_result_type(), GIN_METAPAGE_BLKNO, GIN_SHARE, GinPageGetMeta, GinMetaPageData::ginVersion, heap_form_tuple(), HeapTupleGetDatum(), Int32GetDatum(), Int64GetDatum(), IS_GIN, IS_INDEX, LockBuffer(), GinMetaPageData::nPendingHeapTuples, GinMetaPageData::nPendingPages, GinIndexStat::pending_pages, GinIndexStat::pending_tuples, RelationData::rd_index, ReadBuffer(), relation_close(), RELATION_IS_OTHER_TEMP, relation_open(), RelationGetRelationName, TYPEFUNC_COMPOSITE, UInt32GetDatum(), UnlockReleaseBuffer(), values, and GinIndexStat::version.
Referenced by pgstatginindex(), and pgstatginindex_v1_5().
Datum pgstatginindex_v1_5 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 499 of file pgstatindex.c.
References PG_GETARG_OID, PG_RETURN_DATUM, and pgstatginindex_internal().
Datum pgstathashindex | ( | PG_FUNCTION_ARGS | ) |
Definition at line 586 of file pgstatindex.c.
References _hash_getbuf(), _hash_relbuf(), AccessShareLock, BAS_BULKREAD, HashIndexStat::bitmap_pages, BlessTupleDesc(), HashIndexStat::bucket_pages, buf, BUFFER_LOCK_SHARE, BufferGetBlockNumber(), BufferGetPage(), CHECK_FOR_INTERRUPTS, HashIndexStat::dead_items, elog, ereport, errcode(), errmsg(), ERROR, Float8GetDatum(), HashIndexStat::free_space, get_call_result_type(), GetAccessStrategy(), GetHashPageStats(), HASH_METAPAGE, HASH_READ, HashMetaPageData::hashm_bsize, HashMetaPageData::hashm_version, HashPageOpaqueData::hasho_flag, HashPageGetMeta, HashPageGetOpaque, heap_form_tuple(), HeapTupleGetDatum(), if(), index_close(), Int32GetDatum(), Int64GetDatum(), IS_HASH, IS_INDEX, LH_BITMAP_PAGE, LH_BUCKET_PAGE, LH_META_PAGE, LH_OVERFLOW_PAGE, LH_PAGE_TYPE, LH_UNUSED_PAGE, HashIndexStat::live_items, LockBuffer(), MAIN_FORKNUM, MAXALIGN, HashIndexStat::overflow_pages, PageGetSpecialSize(), PageIsNew(), PG_GETARG_OID, PG_RETURN_DATUM, RBM_NORMAL, RelationData::rd_index, ReadBufferExtended(), RELATION_IS_OTHER_TEMP, relation_open(), RelationGetNumberOfBlocks, RelationGetRelationName, HashIndexStat::space_per_page, TYPEFUNC_COMPOSITE, UnlockReleaseBuffer(), HashIndexStat::unused_pages, values, and HashIndexStat::version.
Datum pgstatindex | ( | PG_FUNCTION_ARGS | ) |
Definition at line 145 of file pgstatindex.c.
References AccessShareLock, ereport, errcode(), errmsg(), ERROR, makeRangeVarFromNameList(), PG_GETARG_TEXT_PP, PG_RETURN_DATUM, pgstatindex_impl(), relation_openrv(), relname, superuser(), and textToQualifiedNameList().
|
static |
Definition at line 216 of file pgstatindex.c.
References AccessShareLock, BAS_BULKREAD, BTMetaPageData::btm_level, BTMetaPageData::btm_root, BTMetaPageData::btm_version, BTPageGetMeta, BTPageGetOpaque, BTPageOpaqueData::btpo_next, BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, BufferGetPage(), BuildTupleFromCStrings(), CHECK_FOR_INTERRUPTS, BTIndexStat::deleted_pages, elog, BTIndexStat::empty_pages, ereport, errcode(), errmsg(), ERROR, BTIndexStat::fragments, BTIndexStat::free_space, get_call_result_type(), GetAccessStrategy(), HeapTupleGetDatum(), INT64_FORMAT, BTIndexStat::internal_pages, IS_BTREE, IS_INDEX, j, BTIndexStat::leaf_pages, BTIndexStat::level, LockBuffer(), MAIN_FORKNUM, BTIndexStat::max_avail, P_IGNORE, P_ISDELETED, P_ISLEAF, P_NONE, PageGetExactFreeSpace(), psprintf(), pstrdup(), RBM_NORMAL, RelationData::rd_index, ReadBufferExtended(), relation_close(), RELATION_IS_OTHER_TEMP, RelationGetNumberOfBlocks, RelationGetRelationName, ReleaseBuffer(), BTIndexStat::root_blkno, SizeOfPageHeaderData, TupleDescGetAttInMetadata(), TYPEFUNC_COMPOSITE, values, and BTIndexStat::version.
Referenced by pgstatindex(), pgstatindex_v1_5(), pgstatindexbyid(), and pgstatindexbyid_v1_5().
Datum pgstatindex_v1_5 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 170 of file pgstatindex.c.
References AccessShareLock, makeRangeVarFromNameList(), PG_GETARG_TEXT_PP, PG_RETURN_DATUM, pgstatindex_impl(), relation_openrv(), relname, and textToQualifiedNameList().
Datum pgstatindexbyid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 188 of file pgstatindex.c.
References AccessShareLock, ereport, errcode(), errmsg(), ERROR, PG_GETARG_OID, PG_RETURN_DATUM, pgstatindex_impl(), relation_open(), and superuser().
Datum pgstatindexbyid_v1_5 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 205 of file pgstatindex.c.
References AccessShareLock, PG_GETARG_OID, PG_RETURN_DATUM, pgstatindex_impl(), and relation_open().