Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftCSG-0002Kh-HO for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Aug 2018 13:48:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ftCSE-0003FE-Io for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Aug 2018 13:48:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftCSE-0003F6-8K for pgsql-hackers@lists.postgresql.org; Fri, 24 Aug 2018 13:48:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftCS7-0007le-Jz for pgsql-hackers@postgresql.org; Fri, 24 Aug 2018 13:48:45 +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 w7ODmY1N025775; Fri, 24 Aug 2018 09:48:34 -0400 From: Tom Lane To: "Iwata, Aya" cc: "pgsql-hackers@postgresql.org" Subject: Re: libpq debug log In-reply-to: <71E660EB361DF14299875B198D4CE5423DE3FBA4@g01jpexmbkw25> References: <71E660EB361DF14299875B198D4CE5423DE3FBA4@g01jpexmbkw25> Comments: In-reply-to "Iwata, Aya" message dated "Fri, 24 Aug 2018 04:38:22 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25773.1535118514.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 24 Aug 2018 09:48:34 -0400 Message-ID: <25774.1535118514@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Iwata, Aya" writes: > I'm going to propose libpq debug log for analysis of queries on the appl= ication side. > I think that it is useful to determine whether the cause is on the appli= cation side or the server side when a slow query occurs. = Hm, how will you tell that really? And what's the advantage over the existing server-side query logging capability? > The provided information is "date and time" at which execution of proces= sing is started, "query", "application side processing", which is picked u= p information from PQtrace(), and "connection id", which is for uniquely i= dentifying the connection. = PQtrace() is utterly useless for anything except debugging libpq internals, and it's not tremendously useful even for that. Don't bother with that part. Where will you get a "unique connection id" from? How will you deal with asynchronously-executed queries --- either the PQgetResult style, or the single-row-at-a-time style? regards, tom lane