From 6a642f8f6060018115be1bf66826fc1c4676a015 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 28 Oct 2021 13:32:17 +0200 Subject: add logging for DB perf analysis --- src/pq/pq.c | 5 +++++ src/pq/pq_exec.c | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'src/pq') diff --git a/src/pq/pq.c b/src/pq/pq.c index b260aa1db..876d4fcf6 100644 --- a/src/pq/pq.c +++ b/src/pq/pq.c @@ -95,6 +95,11 @@ GNUNET_PQ_exec_prepared (struct GNUNET_PQ_Context *db, param_lengths, param_formats, 1); + GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, + "pq", + "Execution of prepared SQL statement `%s' finished (%d)\n", + name, + PGRES_COMMAND_OK == PQresultStatus (res)); if ( (PGRES_COMMAND_OK != PQresultStatus (res)) && (CONNECTION_OK != (status = PQstatus (db->conn))) ) { diff --git a/src/pq/pq_exec.c b/src/pq/pq_exec.c index 464fff4b4..dcde331b6 100644 --- a/src/pq/pq_exec.c +++ b/src/pq/pq_exec.c @@ -86,6 +86,11 @@ GNUNET_PQ_exec_statements (struct GNUNET_PQ_Context *db, db); result = PQexec (db->conn, es[i].sql); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Running statement `%s' on %p finished (%d)\n", + es[i].sql, + db, + PGRES_COMMAND_OK == PQresultStatus (result)); if ((GNUNET_NO == es[i].ignore_errors) && (PGRES_COMMAND_OK != PQresultStatus (result))) { -- cgit v1.2.3