diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-11-20 00:48:58 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-11-20 00:48:58 +0000 |
commit | 8a7025f0bb9a9ad15c6dc27979a3c9f4116bca2a (patch) | |
tree | 6999fa315fa493b13416a4c40d64dfa9f9948aa4 /src/backend/tcop/postgres.c | |
parent | e719591ea31a5ebd85a3aefcf2306e7f69345331 (diff) | |
download | postgresql-8a7025f0bb9a9ad15c6dc27979a3c9f4116bca2a.tar.gz postgresql-8a7025f0bb9a9ad15c6dc27979a3c9f4116bca2a.zip |
Move pgstat_report_tabstat() call so that stats are not reported to the
collector until the transaction commits. Per recent discussion, this
should avoid confusing autovacuum when an updating transaction runs for
a long time.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index fe6475f83ea..9b3c14399c9 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.437 2004/11/14 19:35:31 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.438 2004/11/20 00:48:58 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -2904,12 +2904,11 @@ PostgresMain(int argc, char *argv[], const char *username) * This is also a good time to send collected statistics to the * collector, and to update the PS stats display. We avoid doing * those every time through the message loop because it'd slow - * down processing of batched messages. + * down processing of batched messages, and because we don't want + * to report uncommitted updates (that confuses autovacuum). */ if (send_rfq) { - pgstat_report_tabstat(); - if (IsTransactionOrTransactionBlock()) { set_ps_display("idle in transaction"); @@ -2917,6 +2916,8 @@ PostgresMain(int argc, char *argv[], const char *username) } else { + pgstat_report_tabstat(); + set_ps_display("idle"); pgstat_report_activity("<IDLE>"); } |