2
* $PostgreSQL: pgsql/contrib/pgstattuple/pgstattuple.c,v 1.37 2009/03/31 22:54:31 tgl Exp $
2
* $PostgreSQL: pgsql/contrib/pgstattuple/pgstattuple.c,v 1.38 2009/06/11 14:48:52 momjian Exp $
4
4
* Copyright (c) 2001,2002 Tatsuo Ishii
59
59
uint64 dead_tuple_count;
60
60
uint64 dead_tuple_len;
61
61
uint64 free_space; /* free/reusable space in bytes */
64
64
typedef void (*pgstat_page) (pgstattuple_type *, Relation, BlockNumber);
66
static Datum build_pgstattuple_type(pgstattuple_type * stat,
66
static Datum build_pgstattuple_type(pgstattuple_type *stat,
67
67
FunctionCallInfo fcinfo);
68
68
static Datum pgstat_relation(Relation rel, FunctionCallInfo fcinfo);
69
69
static Datum pgstat_heap(Relation rel, FunctionCallInfo fcinfo);
70
static void pgstat_btree_page(pgstattuple_type * stat,
70
static void pgstat_btree_page(pgstattuple_type *stat,
71
71
Relation rel, BlockNumber blkno);
72
static void pgstat_hash_page(pgstattuple_type * stat,
72
static void pgstat_hash_page(pgstattuple_type *stat,
73
73
Relation rel, BlockNumber blkno);
74
static void pgstat_gist_page(pgstattuple_type * stat,
74
static void pgstat_gist_page(pgstattuple_type *stat,
75
75
Relation rel, BlockNumber blkno);
76
76
static Datum pgstat_index(Relation rel, BlockNumber start,
77
77
pgstat_page pagefn, FunctionCallInfo fcinfo);
78
static void pgstat_index_page(pgstattuple_type * stat, Page page,
78
static void pgstat_index_page(pgstattuple_type *stat, Page page,
79
79
OffsetNumber minoff, OffsetNumber maxoff);
82
82
* build_pgstattuple_type -- build a pgstattuple_type tuple
85
build_pgstattuple_type(pgstattuple_type * stat, FunctionCallInfo fcinfo)
85
build_pgstattuple_type(pgstattuple_type *stat, FunctionCallInfo fcinfo)
203
* Reject attempts to read non-local temporary relations; we would
204
* be likely to get wrong data since we have no visibility into the
205
* owning session's local buffers.
203
* Reject attempts to read non-local temporary relations; we would be
204
* likely to get wrong data since we have no visibility into the owning
205
* session's local buffers.
207
207
if (RELATION_IS_OTHER_TEMP(rel))
331
331
* pgstat_btree_page -- check tuples in a btree page
334
pgstat_btree_page(pgstattuple_type * stat, Relation rel, BlockNumber blkno)
334
pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
374
374
* pgstat_hash_page -- check tuples in a hash page
377
pgstat_hash_page(pgstattuple_type * stat, Relation rel, BlockNumber blkno)
377
pgstat_hash_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
417
417
* pgstat_gist_page -- check tuples in a gist page
420
pgstat_gist_page(pgstattuple_type * stat, Relation rel, BlockNumber blkno)
420
pgstat_gist_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
480
480
* pgstat_index_page -- for generic index page
483
pgstat_index_page(pgstattuple_type * stat, Page page,
483
pgstat_index_page(pgstattuple_type *stat, Page page,
484
484
OffsetNumber minoff, OffsetNumber maxoff)