From 27c3e3de0939d93ae8adb50ab7e00c4a5ff2fa0d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 20 Jun 2006 22:52:00 +0000 Subject: Remove redundant gettimeofday() calls to the extent practical without changing semantics too much. statement_timestamp is now set immediately upon receipt of a client command message, and the various places that used to do their own gettimeofday() calls to mark command startup are referenced to that instead. I have also made stats_command_string use that same value for pg_stat_activity.query_start for both the command itself and its eventual replacement by or . There was some debate about that, but no argument that seemed convincing enough to justify an extra gettimeofday() call. --- src/backend/commands/prepare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/commands') diff --git a/src/backend/commands/prepare.c b/src/backend/commands/prepare.c index 3c77e8a70f..d89c01a62e 100644 --- a/src/backend/commands/prepare.c +++ b/src/backend/commands/prepare.c @@ -10,7 +10,7 @@ * Copyright (c) 2002-2006, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.52 2006/04/25 14:11:54 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.53 2006/06/20 22:51:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -373,7 +373,7 @@ StorePreparedStatement(const char *stmt_name, entry->plan_list = plan_list; entry->argtype_list = argtype_list; entry->context = entrycxt; - entry->prepare_time = GetCurrentTimestamp(); + entry->prepare_time = GetCurrentStatementStartTimestamp(); entry->from_sql = from_sql; MemoryContextSwitchTo(oldcxt); -- cgit v1.2.3