Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2ywW-0003SL-KB for pgsql-general@arkaria.postgresql.org; Wed, 28 Aug 2019 14:29:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i2ywV-0002n8-Bb for pgsql-general@arkaria.postgresql.org; Wed, 28 Aug 2019 14:28:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2ywV-0002n1-1b for pgsql-general@lists.postgresql.org; Wed, 28 Aug 2019 14:28:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2ywT-0001Gc-04 for pgsql-general@postgresql.org; Wed, 28 Aug 2019 14:28:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x7SESpES009125; Wed, 28 Aug 2019 10:28:51 -0400 From: Tom Lane To: Adrian Klaver cc: francis picabia , pgsql-general@postgresql.org Subject: Re: How to log 'user time' in postgres logs In-reply-to: <94ac4f4a-452e-02cd-a91c-4db3afbd4a2b@aklaver.com> References: <94ac4f4a-452e-02cd-a91c-4db3afbd4a2b@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Wed, 28 Aug 2019 07:07:26 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9123.1567002531.1@sss.pgh.pa.us> Date: Wed, 28 Aug 2019 10:28:51 -0400 Message-ID: <9124.1567002531@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver writes: > On 8/28/19 5:36 AM, francis picabia wrote: >> I had no clue the database was the issue because I >> had the minimal >> log_duration = on >> log_line_prefix = '<%t>' >> With those settings all queries seen were roughly 1ms >> >> I need this log to show the true time it takes to get a result back. > I'm having a hard time believing autovacuum was involved in this, given > you say the queries took only 1ms on average. Also: the time logged by log_duration IS the time it took, so far as the server can tell. Perhaps there's monstrous network delays involved, but what I'm suspicious of is inefficient client-side processing. regards, tom lane