1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

Statistical system views (yet without the config stuff, but

it's hard to keep such massive changes in sync with the tree
so I need to get it in and work from there now).

Jan
This commit is contained in:
Jan Wieck
2001-06-22 19:16:24 +00:00
parent 7d6e28149e
commit 8d80b0d980
34 changed files with 537 additions and 98 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.20 2001/06/13 21:44:40 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.21 2001/06/22 19:16:21 wieck Exp $
*
*-------------------------------------------------------------------------
*/
@@ -609,7 +609,7 @@ acquire_sample_rows(Relation onerel, HeapTuple *rows, int targrows,
goto pageloop;
}
ItemPointerSet(&targtuple.t_self, targblock, targoffset);
heap_fetch(onerel, SnapshotNow, &targtuple, &targbuffer);
heap_fetch(onerel, SnapshotNow, &targtuple, &targbuffer, NULL);
if (targtuple.t_data != NULL)
{
/*

View File

@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.65 2001/03/22 03:59:21 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.66 2001/06/22 19:16:21 wieck Exp $
*
*-------------------------------------------------------------------------
*/
@@ -264,7 +264,8 @@ rebuildheap(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex)
LocalHeapTuple.t_self = ScanResult->heap_iptr;
LocalHeapTuple.t_datamcxt = NULL;
LocalHeapTuple.t_data = NULL;
heap_fetch(LocalOldHeap, SnapshotNow, &LocalHeapTuple, &LocalBuffer);
heap_fetch(LocalOldHeap, SnapshotNow, &LocalHeapTuple, &LocalBuffer,
ScanDesc);
if (LocalHeapTuple.t_data != NULL)
{

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.92 2001/06/01 02:41:35 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.93 2001/06/22 19:16:21 wieck Exp $
*
*-------------------------------------------------------------------------
*/
@@ -551,7 +551,7 @@ RelationBuildTriggers(Relation relation)
break;
tuple.t_self = indexRes->heap_iptr;
heap_fetch(tgrel, SnapshotNow, &tuple, &buffer);
heap_fetch(tgrel, SnapshotNow, &tuple, &buffer, sd);
pfree(indexRes);
if (!tuple.t_data)
continue;
@@ -1394,7 +1394,7 @@ DeferredTriggerExecute(DeferredTriggerEvent event, int itemno,
if (ItemPointerIsValid(&(event->dte_oldctid)))
{
ItemPointerCopy(&(event->dte_oldctid), &(oldtuple.t_self));
heap_fetch(rel, SnapshotAny, &oldtuple, &oldbuffer);
heap_fetch(rel, SnapshotAny, &oldtuple, &oldbuffer, NULL);
if (!oldtuple.t_data)
elog(ERROR, "DeferredTriggerExecute: failed to fetch old tuple");
}
@@ -1402,7 +1402,7 @@ DeferredTriggerExecute(DeferredTriggerEvent event, int itemno,
if (ItemPointerIsValid(&(event->dte_newctid)))
{
ItemPointerCopy(&(event->dte_newctid), &(newtuple.t_self));
heap_fetch(rel, SnapshotAny, &newtuple, &newbuffer);
heap_fetch(rel, SnapshotAny, &newtuple, &newbuffer, NULL);
if (!newtuple.t_data)
elog(ERROR, "DeferredTriggerExecute: failed to fetch new tuple");
}
@@ -1861,7 +1861,7 @@ DeferredTriggerSetState(ConstraintsSetStmt *stmt)
break;
tuple.t_self = indexRes->heap_iptr;
heap_fetch(tgrel, SnapshotNow, &tuple, &buffer);
heap_fetch(tgrel, SnapshotNow, &tuple, &buffer, sd);
pfree(indexRes);
if (!tuple.t_data)
continue;

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.196 2001/06/13 21:44:40 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.197 2001/06/22 19:16:21 wieck Exp $
*
*-------------------------------------------------------------------------
*/
@@ -48,6 +48,8 @@
#include "utils/syscache.h"
#include "utils/temprel.h"
#include "pgstat.h"
extern XLogRecPtr log_heap_clean(Relation reln, Buffer buffer,
char *unused, int unlen);
extern XLogRecPtr log_heap_move(Relation reln,
@@ -185,6 +187,11 @@ vacuum(VacuumStmt *vacstmt)
if (IsTransactionBlock())
elog(ERROR, "%s cannot run inside a BEGIN/END block", stmttype);
/*
* Send info about dead objects to the statistics collector
*/
pgstat_vacuum_tabstat();
if (vacstmt->verbose)
MESSAGE_LEVEL = NOTICE;
else
@@ -2350,7 +2357,7 @@ vac_update_relstats(Oid relid, long num_pages, double num_tuples,
/* get the buffer cache tuple */
rtup.t_self = ctup->t_self;
ReleaseSysCache(ctup);
heap_fetch(rd, SnapshotNow, &rtup, &buffer);
heap_fetch(rd, SnapshotNow, &rtup, &buffer, NULL);
/* overwrite the existing statistics in the tuple */
pgcform = (Form_pg_class) GETSTRUCT(&rtup);