summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pgstatfuncs.c
AgeCommit message (Collapse)Author
2007-02-07Add a function pg_stat_clear_snapshot() that discards any statistics snapshotTom Lane
already collected in the current transaction; this allows plpgsql functions to watch for stats updates even though they are confined to a single transaction. Use this instead of the previous kluge involving pg_stat_file() to wait for the stats collector to update in the stats regression test. Internally, decouple storage of stats snapshots from transaction boundaries; they'll now stick around until someone calls pgstat_clear_snapshot --- which xact.c still does at transaction end, to maintain the previous behavior. This makes the logic a lot cleaner, at the price of a couple dozen cycles per transaction exit.
2007-01-05Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian
back-stamped for this.
2007-01-02Add n_live_tuples and n_dead_tuples to pg_stat_all_tables.Bruce Momjian
The purpose is to allow autovacuum-esq conditional vacuuming and clustering using SQL to discover the required stats. No documentation updates required. Catalog version updated. Glen Parker
2006-12-06Add a txn_start column to pg_stat_activity. This makes it easier toNeil Conway
identify long-running transactions. Since we already need to record the transaction-start time (e.g. for now()), we don't need any additional system calls to report this information. Catversion bumped, initdb required.
2006-10-04pgindent run for 8.2.Bruce Momjian
2006-08-19Add a 'waiting' column to pg_stat_activity to carry the same informationTom Lane
that ps_status provides by appending 'waiting' to the PS display. This completes the project of making it feasible to turn off process title updates and instead rely on pg_stat_activity. Per my suggestion a few weeks ago.
2006-07-14Remove 576 references of include files that were not needed.Bruce Momjian
2006-07-11Alphabetically order reference to include files, "N" - "S".Bruce Momjian
2006-06-19Take the statistics collector out of the loop for monitoring backends'Tom Lane
current commands; instead, store current-status information in shared memory. This substantially reduces the overhead of stats_command_string and also ensures that pg_stat_activity is fully up to date at all times. Per my recent proposal.
2006-05-19Add last-vacuum/analyze-time columns to the stats collector, both manual andAlvaro Herrera
issued by autovacuum. Add accessor functions to them, and use those in the pg_stat_*_tables system views. Catalog version bumped due to changes in the pgstat views and the pgstat file. Patch from Larry Rosenman, minor improvements by me.
2006-05-19Have autovacuum report its activities to the stat collector.Alvaro Herrera
2006-03-05Update copyright for 2006. Update scripts.Bruce Momjian
2005-10-17Clean up libpq's pollution of application namespace by renaming theTom Lane
exported routines of ip.c, md5.c, and fe-auth.c to begin with 'pg_'. Also get rid of the vestigial fe_setauthsvc/fe_getauthsvc routines altogether.
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-06-29Clean up the rather historically encumbered interface to now() andTom Lane
current time: provide a GetCurrentTimestamp() function that returns current time in the form of a TimestampTz, instead of separate time_t and microseconds fields. This is what all the callers really want anyway, and it eliminates low-level dependencies on AbsoluteTime, which is a deprecated datatype that will have to disappear eventually.
2005-06-28Replace pg_shadow and pg_group by new role-capable catalogs pg_authidTom Lane
and pg_auth_members. There are still many loose ends to finish in this patch (no documentation, no regression tests, no pg_dump support for instance). But I'm going to commit it now anyway so that Alvaro can make some progress on shared dependencies. The catalog changes should be pretty much done.
2005-05-11This patch reduces the size of the message header used by statisticsNeil Conway
collector messages, per recent discussion on pgsql-patches. This actually required quite a few changes -- for example, "databaseid != InvalidOid" was used to check whether a slot in the backend entry table was initialized, but that no longer works since the slot might be initialized prior to receiving the BESTART message which contains the database id. We now use procpid > 0 to indicate that a slot is non-empty. Other changes: - various comment improvements and cleanups - there's no need to zero-out the entire activity buffer in pgstat_add_backend(), we can just set activity[0] to '\0'. - remove the counting of the # of connections to a database; this was not used anywhere One change in behavior I wasn't sure about: previously, the code would create a hash table entry for a database as soon as any message was received whose header referenced that database. Now, we only create hash table entries as needed (so for example BESTART won't create a database hash table entry, since it doesn't need to access anything in the per-db hash table). It would be easy enough to retain the old behavior, but AFAICS it is not required.
2005-05-09Complete the following TODO items:Neil Conway
* Add session start time to pg_stat_activity * Add the client IP address and port to pg_stat_activity Original patch from Magnus Hagander, code review by Neil Conway. Catalog version bumped. This patch sends the client IP address and port number in every statistics message; that's not ideal, but will be fixed up shortly.
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
2004-10-01Convert pg_stat_get_backend_idset to use the existing SRF support.Tom Lane
This seems the cleanest way of fixing its lack of a shutdown callback, which was preventing it from working correctly in a query that didn't run it to completion. Per bug report from Szima GÄbor.
2004-02-12Added hints about the reason, why the command string inJan Wieck
the view pg_stat_activity is missing, as per Bruces suggestion. Jan
2003-09-15OK, some of these syntax errors should be given other codes.Peter Eisentraut
2003-09-09Some "feature not supported" errors are better syntax errors, because thePeter Eisentraut
feature they complain about isn't a feature or cannot be implemented without definitional changes.
2003-08-04pgindent run.Bruce Momjian
2003-07-27Error message editing in utils/adt. Again thanks to Joe Conway for doingTom Lane
the bulk of the heavy lifting ...
2003-04-04Avoid repeated computation of the constants date2j(1970, 1, 1) andTom Lane
date2j(2000, 1, 1). Should make for some marginal speed improvement in date/time operations.
2003-04-04Code review for pg_stat_get_backend_activity_start patch --- fixTom Lane
return type, make protection condition agree with recent change to pg_stat_get_backend_activity, clean up documentation.
2003-03-20It would also be handy if users could see their own pg_stat_activityBruce Momjian
queries while the rest remain blank. Kevin Brown
2003-03-20Add start time to pg_stat_activityBruce Momjian
Neil Conway
2002-12-04Make usesysid consistently int4, not oid.Bruce Momjian
Catalog patch from Alvaro Herrera for same. catversion updated. initdb required.
2002-08-20Allow pg_statistics to be reset by calling pg_stat_reset().Bruce Momjian
Christopher Kings-Lynne
2002-08-04Rename backend_pid to pg_backend_pid, move docs to monitoring section.Bruce Momjian
2002-07-31Rename pid function to backend_pid().Bruce Momjian
2002-07-31Add function to access backend pid, pg_stat_get_backend_mypid.Bruce Momjian
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-09-30pg_stat_get_backend_idset should reset fmgr_info->fn_extra at end ofTom Lane
execution, so that it restarts correctly if query tree is used again.
2001-06-25Suppress gcc warning.Tom Lane
2001-06-22The new files for statistical system views.Jan Wieck
Jan