|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/heapam.h"#include "access/htup_details.h"#include "access/relation.h"#include "access/visibilitymap.h"#include "catalog/pg_am_d.h"#include "commands/vacuum.h"#include "funcapi.h"#include "miscadmin.h"#include "storage/bufmgr.h"#include "storage/freespace.h"#include "storage/procarray.h"#include "storage/read_stream.h"
Go to the source code of this file.
Data Structures | |
| struct | output_type |
| struct | StatApproxReadStreamPrivate |
Macros | |
| #define | NUM_OUTPUT_COLUMNS 10 |
Typedefs | |
| typedef struct output_type | output_type |
| typedef struct StatApproxReadStreamPrivate | StatApproxReadStreamPrivate |
Functions | |
| PG_FUNCTION_INFO_V1 (pgstattuple_approx) | |
| PG_FUNCTION_INFO_V1 (pgstattuple_approx_v1_5) | |
| Datum | pgstattuple_approx_internal (Oid relid, FunctionCallInfo fcinfo) |
| static BlockNumber | statapprox_heap_read_stream_next (ReadStream *stream, void *callback_private_data, void *per_buffer_data) |
| static void | statapprox_heap (Relation rel, output_type *stat) |
| Datum | pgstattuple_approx (PG_FUNCTION_ARGS) |
| Datum | pgstattuple_approx_v1_5 (PG_FUNCTION_ARGS) |
| #define NUM_OUTPUT_COLUMNS 10 |
Definition at line 47 of file pgstatapprox.c.
| typedef struct output_type output_type |
| PG_FUNCTION_INFO_V1 | ( | pgstattuple_approx | ) |
| PG_FUNCTION_INFO_V1 | ( | pgstattuple_approx_v1_5 | ) |
| Datum pgstattuple_approx | ( | PG_FUNCTION_ARGS | ) |
Definition at line 279 of file pgstatapprox.c.
References ereport, errcode(), errmsg, ERROR, fb(), PG_GETARG_OID, PG_RETURN_DATUM, pgstattuple_approx_internal(), and superuser().
| Datum pgstattuple_approx_internal | ( | Oid | relid, |
| FunctionCallInfo | fcinfo | ||
| ) |
Definition at line 307 of file pgstatapprox.c.
References AccessShareLock, elog, ereport, errcode(), errdetail_relkind_not_supported(), errmsg, ERROR, fb(), Float8GetDatum(), get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), i, Int64GetDatum(), TupleDescData::natts, NUM_OUTPUT_COLUMNS, RelationData::rd_rel, relation_close(), RELATION_IS_OTHER_TEMP, relation_open(), RelationGetRelationName, statapprox_heap(), TYPEFUNC_COMPOSITE, and values.
Referenced by pgstattuple_approx(), and pgstattuple_approx_v1_5().
| Datum pgstattuple_approx_v1_5 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 299 of file pgstatapprox.c.
References PG_GETARG_OID, PG_RETURN_DATUM, and pgstattuple_approx_internal().
|
static |
Definition at line 116 of file pgstatapprox.c.
References Assert, BAS_BULKREAD, buf, BUFFER_LOCK_SHARE, BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), StatApproxReadStreamPrivate::current_blocknum, elog, ERROR, fb(), FirstOffsetNumber, GetAccessStrategy(), GetOldestNonRemovableTransactionId(), HEAPTUPLE_DEAD, HEAPTUPLE_DELETE_IN_PROGRESS, HEAPTUPLE_INSERT_IN_PROGRESS, HEAPTUPLE_LIVE, HEAPTUPLE_RECENTLY_DEAD, HeapTupleSatisfiesVacuum(), InvalidBuffer, ItemIdGetLength, ItemIdIsDead, ItemIdIsNormal, ItemIdIsRedirected, ItemIdIsUsed, ItemPointerSet(), LockBuffer(), MAIN_FORKNUM, Max, StatApproxReadStreamPrivate::nblocks, OffsetNumberNext, PageGetExactFreeSpace(), PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), PageIsEmpty(), PageIsNew(), read_stream_begin_relation(), read_stream_end(), READ_STREAM_FULL, read_stream_next_buffer(), StatApproxReadStreamPrivate::rel, RelationGetNumberOfBlocks, RelationGetRelid, ReleaseBuffer(), StatApproxReadStreamPrivate::scanned, StatApproxReadStreamPrivate::stat, stat, statapprox_heap_read_stream_next(), HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, UnlockReleaseBuffer(), vac_estimate_reltuples(), and StatApproxReadStreamPrivate::vmbuffer.
Referenced by pgstattuple_approx_internal().
|
static |
Definition at line 71 of file pgstatapprox.c.
References CHECK_FOR_INTERRUPTS, StatApproxReadStreamPrivate::current_blocknum, fb(), output_type::free_space, GetRecordedFreeSpace(), InvalidBlockNumber, StatApproxReadStreamPrivate::nblocks, StatApproxReadStreamPrivate::rel, StatApproxReadStreamPrivate::scanned, StatApproxReadStreamPrivate::stat, output_type::tuple_len, VM_ALL_VISIBLE, and StatApproxReadStreamPrivate::vmbuffer.
Referenced by statapprox_heap().