PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/nbtree.h"
#include "access/relation.h"
#include "catalog/namespace.h"
#include "catalog/pg_am.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "pageinspect.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/rel.h"
#include "utils/varlena.h"
Go to the source code of this file.
Data Structures | |
struct | BTPageStat |
struct | ua_page_stats |
struct | ua_page_items |
Macros | |
#define | IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX) |
#define | IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID) |
#define | BT_METAP_COLS_V1_8 9 |
Typedefs | |
typedef struct BTPageStat | BTPageStat |
typedef struct ua_page_stats | ua_page_stats |
typedef struct ua_page_items | ua_page_items |
#define BT_METAP_COLS_V1_8 9 |
Definition at line 829 of file btreefuncs.c.
#define IS_BTREE | ( | r | ) | ((r)->rd_rel->relam == BTREE_AM_OID) |
Definition at line 52 of file btreefuncs.c.
#define IS_INDEX | ( | r | ) | ((r)->rd_rel->relkind == RELKIND_INDEX) |
Definition at line 51 of file btreefuncs.c.
typedef struct BTPageStat BTPageStat |
typedef struct ua_page_items ua_page_items |
typedef struct ua_page_stats ua_page_stats |
|
static |
Definition at line 227 of file btreefuncs.c.
References check_relation_block_range(), ereport, errcode(), errmsg(), ERROR, IS_BTREE, IS_INDEX, RELATION_IS_OTHER_TEMP, and RelationGetRelationName.
Referenced by bt_multi_page_stats(), bt_page_items_internal(), and bt_page_stats_internal().
Datum bt_metap | ( | PG_FUNCTION_ARGS | ) |
Definition at line 840 of file btreefuncs.c.
References AccessShareLock, BT_METAP_COLS_V1_8, BTMetaPageData::btm_allequalimage, BTMetaPageData::btm_fastlevel, BTMetaPageData::btm_fastroot, BTMetaPageData::btm_last_cleanup_num_delpages, BTMetaPageData::btm_last_cleanup_num_heap_tuples, BTMetaPageData::btm_level, BTMetaPageData::btm_magic, BTMetaPageData::btm_root, BTMetaPageData::btm_version, BTPageGetMeta, BTREE_NOVAC_VERSION, BUFFER_LOCK_SHARE, BufferGetPage(), BuildTupleFromCStrings(), elog, ereport, errcode(), errhint(), errmsg(), ERROR, get_call_result_type(), HeapTupleGetDatum(), INT64_FORMAT, IS_BTREE, IS_INDEX, j, LockBuffer(), makeRangeVarFromNameList(), TupleDescData::natts, PG_GETARG_TEXT_PP, PG_RETURN_DATUM, psprintf(), ReadBuffer(), relation_close(), RELATION_IS_OTHER_TEMP, relation_openrv(), RelationGetRelationName, relname, superuser(), textToQualifiedNameList(), TupleDescGetAttInMetadata(), TYPEFUNC_COMPOSITE, UnlockReleaseBuffer(), and values.
Datum bt_multi_page_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 345 of file btreefuncs.c.
References AccessShareLock, ua_page_stats::allpages, ua_page_stats::blk_count, ua_page_stats::blkno, bt_index_block_validate(), BUFFER_LOCK_SHARE, BuildTupleFromCStrings(), check_relation_block_range(), elog, ereport, errcode(), errmsg(), ERROR, get_call_result_type(), GetBTPageStatistics(), HeapTupleGetDatum(), InvalidBlockNumber, j, LockBuffer(), makeRangeVarFromNameList(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, NoLock, palloc(), PG_GETARG_INT64, PG_GETARG_TEXT_PP, psprintf(), ReadBuffer(), relation_close(), relation_open(), relation_openrv(), RelationGetNumberOfBlocks, RelationGetRelid, ua_page_stats::relid, relname, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, stat, superuser(), textToQualifiedNameList(), TupleDescGetAttInMetadata(), TYPEFUNC_COMPOSITE, UnlockReleaseBuffer(), FuncCallContext::user_fctx, and values.
Datum bt_page_items | ( | PG_FUNCTION_ARGS | ) |
Definition at line 720 of file btreefuncs.c.
References bt_page_items_internal(), and PAGEINSPECT_V1_8.
Datum bt_page_items_1_9 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 713 of file btreefuncs.c.
References bt_page_items_internal(), and PAGEINSPECT_V1_9.
Datum bt_page_items_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 735 of file btreefuncs.c.
References BlessTupleDesc(), bt_page_print_tuples(), BTPageGetOpaque, BTPageOpaqueData::btpo_level, FuncCallContext::call_cntr, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, FirstOffsetNumber, get_call_result_type(), get_page_from_raw(), ua_page_items::leafpage, FuncCallContext::max_calls, MAXALIGN, MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, NOTICE, ua_page_items::offset, P_ISDELETED, P_ISLEAF, P_ISMETA, P_RIGHTMOST, ua_page_items::page, PageGetMaxOffsetNumber(), PageGetSpecialSize(), PageIsNew(), palloc(), PG_GETARG_BYTEA_P, PG_RETURN_NULL, ua_page_items::rightmost, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, superuser(), ua_page_items::tupd, TYPEFUNC_COMPOSITE, and FuncCallContext::user_fctx.
|
static |
Definition at line 625 of file btreefuncs.c.
References AccessShareLock, BlessTupleDesc(), bt_index_block_validate(), bt_page_print_tuples(), BTPageGetOpaque, BUFFER_LOCK_SHARE, BufferGetPage(), FuncCallContext::call_cntr, elog, ereport, errcode(), errmsg(), ERROR, FirstOffsetNumber, get_call_result_type(), INT64_FORMAT, ua_page_items::leafpage, LockBuffer(), makeRangeVarFromNameList(), FuncCallContext::max_calls, MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, NOTICE, ua_page_items::offset, P_ISDELETED, P_ISLEAF, P_RIGHTMOST, ua_page_items::page, PageGetMaxOffsetNumber(), PAGEINSPECT_V1_8, palloc(), PG_GETARG_INT64, PG_GETARG_TEXT_PP, PG_GETARG_UINT32, ReadBuffer(), relation_close(), relation_openrv(), relname, ua_page_items::rightmost, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, superuser(), textToQualifiedNameList(), ua_page_items::tupd, TYPEFUNC_COMPOSITE, UnlockReleaseBuffer(), and FuncCallContext::user_fctx.
Referenced by bt_page_items(), and bt_page_items_1_9().
|
static |
Definition at line 482 of file btreefuncs.c.
References Assert, BoolGetDatum(), BTreeTupleGetHeapTID(), BTreeTupleGetNPosting(), BTreeTupleGetPosting(), BTreeTupleGetPostingOffset(), BTreeTupleIsPivot(), BTreeTupleIsPosting(), construct_array_builtin(), CStringGetTextDatum, DatumGetInt16(), elog, ERROR, heap_form_tuple(), HeapTupleGetDatum(), i, INDEX_SIZE_MASK, IndexInfoFindDataOffset(), IndexTupleHasNulls, IndexTupleHasVarwidths, IndexTupleSize, Int32GetDatum(), ItemIdIsDead, ItemIdIsValid, ItemPointerGetDatum(), j, ua_page_items::leafpage, MAXALIGN, ua_page_items::offset, P_HIKEY, ua_page_items::page, PageGetItem(), PageGetItemId(), palloc(), palloc0(), pfree(), PointerGetDatum(), ua_page_items::rightmost, sprintf, IndexTupleData::t_info, IndexTupleData::t_tid, ua_page_items::tupd, and values.
Referenced by bt_page_items_bytea(), and bt_page_items_internal().
Datum bt_page_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 330 of file btreefuncs.c.
References bt_page_stats_internal(), and PAGEINSPECT_V1_8.
Datum bt_page_stats_1_9 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 323 of file btreefuncs.c.
References bt_page_stats_internal(), and PAGEINSPECT_V1_9.
|
static |
Definition at line 261 of file btreefuncs.c.
References AccessShareLock, bt_index_block_validate(), BUFFER_LOCK_SHARE, BuildTupleFromCStrings(), elog, ereport, errcode(), errmsg(), ERROR, get_call_result_type(), GetBTPageStatistics(), HeapTupleGetDatum(), InvalidBlockNumber, j, LockBuffer(), makeRangeVarFromNameList(), PAGEINSPECT_V1_8, PG_GETARG_INT64, PG_GETARG_TEXT_PP, PG_GETARG_UINT32, PG_RETURN_DATUM, psprintf(), ReadBuffer(), relation_close(), relation_openrv(), relname, stat, superuser(), textToQualifiedNameList(), TupleDescGetAttInMetadata(), TYPEFUNC_COMPOSITE, UnlockReleaseBuffer(), and values.
Referenced by bt_page_stats(), and bt_page_stats_1_9().
|
static |
Definition at line 203 of file btreefuncs.c.
References ereport, errcode(), errmsg(), ERROR, MaxBlockNumber, and RelationGetNumberOfBlocks.
Referenced by bt_index_block_validate(), and bt_multi_page_stats().
|
static |
Definition at line 108 of file btreefuncs.c.
References BTPageGetDeleteXid(), BTPageGetOpaque, BTPageOpaqueData::btpo_cycleid, BTPageOpaqueData::btpo_flags, BTPageOpaqueData::btpo_level, BTPageOpaqueData::btpo_next, BTPageOpaqueData::btpo_prev, BufferGetPage(), DEBUG2, elog, EpochFromFullTransactionId, FirstOffsetNumber, IndexTupleSize, InvalidOffsetNumber, ItemIdIsDead, P_HAS_FULLXID, P_IGNORE, P_ISDELETED, P_ISLEAF, P_ISROOT, PageGetFreeSpace(), PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), PageGetPageSize(), PageHeaderData::pd_special, SizeOfPageHeaderData, and XidFromFullTransactionId.
Referenced by bt_multi_page_stats(), and bt_page_stats_internal().
PG_FUNCTION_INFO_V1 | ( | bt_metap | ) |
PG_FUNCTION_INFO_V1 | ( | bt_multi_page_stats | ) |
PG_FUNCTION_INFO_V1 | ( | bt_page_items | ) |
PG_FUNCTION_INFO_V1 | ( | bt_page_items_1_9 | ) |
PG_FUNCTION_INFO_V1 | ( | bt_page_items_bytea | ) |
PG_FUNCTION_INFO_V1 | ( | bt_page_stats | ) |
PG_FUNCTION_INFO_V1 | ( | bt_page_stats_1_9 | ) |