PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/hash.h"
#include "access/htup_details.h"
#include "access/relation.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"
Go to the source code of this file.
Data Structures | |
struct | HashPageStat |
struct | user_args |
Macros | |
#define | IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX) |
#define | IS_HASH(r) ((r)->rd_rel->relam == HASH_AM_OID) |
Typedefs | |
typedef struct HashPageStat | HashPageStat |
Functions | |
PG_FUNCTION_INFO_V1 (hash_page_type) | |
PG_FUNCTION_INFO_V1 (hash_page_stats) | |
PG_FUNCTION_INFO_V1 (hash_page_items) | |
PG_FUNCTION_INFO_V1 (hash_bitmap_info) | |
PG_FUNCTION_INFO_V1 (hash_metapage_info) | |
static Page | verify_hash_page (bytea *raw_page, int flags) |
static void | GetHashPageStatistics (Page page, HashPageStat *stat) |
Datum | hash_page_type (PG_FUNCTION_ARGS) |
Datum | hash_page_stats (PG_FUNCTION_ARGS) |
Datum | hash_page_items (PG_FUNCTION_ARGS) |
Datum | hash_bitmap_info (PG_FUNCTION_ARGS) |
Datum | hash_metapage_info (PG_FUNCTION_ARGS) |
#define IS_HASH | ( | r | ) | ((r)->rd_rel->relam == HASH_AM_OID) |
Definition at line 32 of file hashfuncs.c.
#define IS_INDEX | ( | r | ) | ((r)->rd_rel->relkind == RELKIND_INDEX) |
Definition at line 31 of file hashfuncs.c.
typedef struct HashPageStat HashPageStat |
|
static |
Definition at line 156 of file hashfuncs.c.
References FirstOffsetNumber, HashPageOpaqueData::hasho_bucket, HashPageOpaqueData::hasho_flag, HashPageOpaqueData::hasho_nextblkno, HashPageOpaqueData::hasho_page_id, HashPageOpaqueData::hasho_prevblkno, HashPageGetOpaque, ItemIdIsDead, PageGetFreeSpace(), PageGetItemId(), PageGetMaxOffsetNumber(), and PageGetPageSize().
Referenced by hash_page_stats().
Datum hash_bitmap_info | ( | PG_FUNCTION_ARGS | ) |
Definition at line 391 of file hashfuncs.c.
References _hash_getbuf(), _hash_ovflblkno_to_bitno(), _hash_relbuf(), AccessShareLock, bit(), BlessTupleDesc(), BMPG_MASK, BMPG_SHIFT, BoolGetDatum(), BufferGetPage(), elog, ereport, errcode(), errmsg(), ERROR, get_call_result_type(), HASH_METAPAGE, HASH_READ, HashMetaPageData::hashm_mapp, HashMetaPageData::hashm_nmaps, HashPageGetBitmap, HashPageGetMeta, heap_form_tuple(), HeapTupleGetDatum(), i, index_close(), Int32GetDatum(), Int64GetDatum(), IS_HASH, IS_INDEX, ISSET, j, LH_BITMAP_PAGE, LH_META_PAGE, MaxBlockNumber, PG_GETARG_INT64, PG_GETARG_OID, PG_RETURN_DATUM, RELATION_IS_OTHER_TEMP, relation_open(), RelationGetNumberOfBlocks, RelationGetRelationName, superuser(), TYPEFUNC_COMPOSITE, and values.
Datum hash_metapage_info | ( | PG_FUNCTION_ARGS | ) |
Definition at line 515 of file hashfuncs.c.
References BlessTupleDesc(), construct_array_builtin(), elog, ereport, errcode(), errmsg(), ERROR, Float8GetDatum(), get_call_result_type(), HASH_MAX_BITMAPS, HASH_MAX_SPLITPOINTS, HashMetaPageData::hashm_bmshift, HashMetaPageData::hashm_bmsize, HashMetaPageData::hashm_bsize, HashMetaPageData::hashm_ffactor, HashMetaPageData::hashm_firstfree, HashMetaPageData::hashm_highmask, HashMetaPageData::hashm_lowmask, HashMetaPageData::hashm_magic, HashMetaPageData::hashm_mapp, HashMetaPageData::hashm_maxbucket, HashMetaPageData::hashm_nmaps, HashMetaPageData::hashm_ntuples, HashMetaPageData::hashm_ovflpoint, HashMetaPageData::hashm_procid, HashMetaPageData::hashm_spares, HashMetaPageData::hashm_version, HashPageGetMeta, heap_form_tuple(), HeapTupleGetDatum(), i, Int32GetDatum(), Int64GetDatum(), j, LH_META_PAGE, ObjectIdGetDatum(), user_args::page, PG_GETARG_BYTEA_P, PG_RETURN_DATUM, PointerGetDatum(), superuser(), TYPEFUNC_COMPOSITE, values, and verify_hash_page().
Datum hash_page_items | ( | PG_FUNCTION_ARGS | ) |
Definition at line 300 of file hashfuncs.c.
References _hash_get_indextuple_hashkey(), FuncCallContext::attinmeta, BlessTupleDesc(), FuncCallContext::call_cntr, elog, ereport, errcode(), errmsg(), ERROR, FirstOffsetNumber, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), Int32GetDatum(), Int64GetDatum(), ItemIdIsValid, j, LH_BUCKET_PAGE, LH_OVERFLOW_PAGE, FuncCallContext::max_calls, MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, user_args::offset, user_args::page, PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), palloc(), PG_GETARG_BYTEA_P, PointerGetDatum(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, superuser(), IndexTupleData::t_tid, AttInMetadata::tupdesc, TupleDescGetAttInMetadata(), TYPEFUNC_COMPOSITE, FuncCallContext::user_fctx, values, and verify_hash_page().
Datum hash_page_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 237 of file hashfuncs.c.
References BlessTupleDesc(), elog, ereport, errcode(), errmsg(), ERROR, get_call_result_type(), GetHashPageStatistics(), heap_form_tuple(), HeapTupleGetDatum(), Int32GetDatum(), Int64GetDatum(), InvalidBlockNumber, j, LH_BUCKET_PAGE, LH_OVERFLOW_PAGE, PG_GETARG_BYTEA_P, PG_RETURN_DATUM, stat, superuser(), TYPEFUNC_COMPOSITE, values, and verify_hash_page().
Datum hash_page_type | ( | PG_FUNCTION_ARGS | ) |
Definition at line 192 of file hashfuncs.c.
References cstring_to_text(), ereport, errcode(), errmsg(), ERROR, HashPageOpaqueData::hasho_flag, HashPageGetOpaque, LH_BITMAP_PAGE, LH_BUCKET_PAGE, LH_META_PAGE, LH_OVERFLOW_PAGE, LH_PAGE_TYPE, PageIsNew(), PG_GETARG_BYTEA_P, PG_RETURN_TEXT_P, superuser(), type, and verify_hash_page().
PG_FUNCTION_INFO_V1 | ( | hash_bitmap_info | ) |
PG_FUNCTION_INFO_V1 | ( | hash_metapage_info | ) |
PG_FUNCTION_INFO_V1 | ( | hash_page_items | ) |
PG_FUNCTION_INFO_V1 | ( | hash_page_stats | ) |
PG_FUNCTION_INFO_V1 | ( | hash_page_type | ) |
Definition at line 59 of file hashfuncs.c.
References elog, ereport, errcode(), errdetail(), errmsg(), ERROR, get_page_from_raw(), HASH_MAGIC, HASH_VERSION, HashMetaPageData::hashm_magic, HashMetaPageData::hashm_version, HashPageOpaqueData::hasho_flag, HashPageOpaqueData::hasho_page_id, HASHO_PAGE_ID, HashPageGetMeta, HashPageGetOpaque, LH_BITMAP_PAGE, LH_BUCKET_PAGE, LH_META_PAGE, LH_OVERFLOW_PAGE, LH_PAGE_TYPE, LH_UNUSED_PAGE, MAXALIGN, PageGetSpecialSize(), and PageIsNew().
Referenced by hash_metapage_info(), hash_page_items(), hash_page_stats(), and hash_page_type().