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 1g1ezY-0005NC-Q7 for pgsql-performance@arkaria.postgresql.org; Sun, 16 Sep 2018 21:54:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g1ezV-0000EV-9u for pgsql-performance@arkaria.postgresql.org; Sun, 16 Sep 2018 21:54:05 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1g1ezV-0000EM-0q for pgsql-performance@lists.postgresql.org; Sun, 16 Sep 2018 21:54:05 +0000 Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g1ezS-0004Jk-17 for pgsql-performance@lists.postgresql.org; Sun, 16 Sep 2018 21:54:04 +0000 Received: by mail-yb1-xb34.google.com with SMTP id w7-v6so451683ybm.7 for ; Sun, 16 Sep 2018 14:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1Srvc1VeKrB/KclrkNTfF1Fn8yaNvsC2I6jElF77yYE=; b=kZSd3Yd/HS9bdkexS1EMFcvE+JLz0FIkPvt9FvX69L8/upSy9i3km5g5R4vSkQeFeZ SDVFujOyTSwjJeU4V3hdHFPi98/UyVyLhb7VTfZlZFofQN9LfXXMOk0Ls+be3w/2HkTR /rLThvb5WToCUZvo0u4jLYqNrIUj6pYanBecp1wcErdmwlij4QrTBPGAl2sC+qOFcq7G 9LIRqkGfSQtzv3Qf2jWjqbbd7gUp1jcI60IJuBym9agw4kK3ZLU3t4URWfwZoC9gVOZT XvKpxB1CT2w9YHWeN3LVm4cOscBinXEKqJkr2PfKfslkRmwcmFcPXqzvh2Uc76LfAu3t D2Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1Srvc1VeKrB/KclrkNTfF1Fn8yaNvsC2I6jElF77yYE=; b=DYoZY9wXNMmoYn4IkwdqQWryJSBRrUdoEiwWy9FloBWyjtNit00ayYuvtNtvVOMhFz XBa1zouKbQWY798Kb8SbzykuLIv52pHgpyx0H8LhpziXDZqTaVKkI2n+MuvEAmRQzDsb YpwWxJTL5OdSl4Szv1cYGZq4pL5+/gET1wuoDNm3uVh+Xv/XYaQJ4pDgOT4lURZVcjMi b8jMcAXCNQaP6bGRUt+HnBnE/empWvpsSanuGTZ7UX+QSkkPJdT4TuFNZ7JbZUHnZoAJ b/JbybS4Mrm43zRgqkmDMAgiQiu+e4t8qxBow/ArvHwqpWdz/JhseTfu1pbN4qOwMPxU UU7A== X-Gm-Message-State: APzg51AsS8i5OggK6ltZiH6xc1R2/PGtFwuj1VxHFzaU4MusKtx6PbO5 XkJeeAEbcs55wOlHAV6z+zg= X-Google-Smtp-Source: ANB0VdYvMst2UWCw8XqrDAQCzHIDFr45I5Umz+mHIMAGk5F6s+1Ix6F6djjbyr8UyTC7XEq5Kh2EYQ== X-Received: by 2002:a25:2044:: with SMTP id g65-v6mr9080878ybg.402.1537134840108; Sun, 16 Sep 2018 14:54:00 -0700 (PDT) Received: from ?IPv6:2602:30a:2c7e:8950:3cea:958a:a80e:52bc? ([2602:30a:2c7e:8950:3cea:958a:a80e:52bc]) by smtp.gmail.com with ESMTPSA id w207-v6sm17431404yww.17.2018.09.16.14.53.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Sep 2018 14:53:59 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-E3C21594-9C9D-4F5F-AB2E-19702F28DE96 Mime-Version: 1.0 (1.0) Subject: Re: How Do You Associate a Query With its Invoking Procedure? From: Fred Habash X-Mailer: iPhone Mail (16A366) In-Reply-To: Date: Sun, 16 Sep 2018 17:53:58 -0400 Cc: pgsql-performance@lists.postgresql.org Content-Transfer-Encoding: 7bit Message-Id: References: <5b9abf54.1c69fb81.8e0e4.9e2d@mx.google.com> To: Patrick Molgaard List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-E3C21594-9C9D-4F5F-AB2E-19702F28DE96 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable All great ideas. I was thinking something similar to some other RDBMS engines where SQL is au= tomatically tied to the invoking PROGRAM_ID with zero setup on the client s= ide. I thought there could be something similar in PG somewhere in the catal= og.=20 As always, great support. This level of support helps a lot in our migration= to Postgres.=20 =E2=80=94=E2=80=94=E2=80=94=E2=80=94- Thank you.=20 > On Sep 15, 2018, at 5:24 AM, Patrick Molgaard wrote: >=20 > You might find application-level tracing a more practical answer - e.g. ch= eck out Datadog APM for a (commercial) plug and play approach or Jaeger for a= self-hostable option. >=20 > Patrick >> On Fri, Sep 14, 2018 at 4:38 PM Fred Habash wrote: >> Any ideas, please?=20 >>=20 >>> On Thu, Sep 13, 2018, 3:49 PM Fd Habash wrote: >>> In API function may invoke 10 queries. Ideally, I would like to know wha= t queries are invoked by it and how long each took. >>>=20 >>> =20 >>>=20 >>> I=E2=80=99m using pg_stat_statement. I can see the API function statemen= t, but how do I deterministically identify all queries invoked by it? >>>=20 >>> =20 >>>=20 >>> =20 >>>=20 >>> ---------------- >>> Thank you >>>=20 >>> =20 --Apple-Mail-E3C21594-9C9D-4F5F-AB2E-19702F28DE96 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable All great ideas.

I was thinkin= g something similar to some other RDBMS engines where SQL is automatically t= ied to the invoking PROGRAM_ID  with zero setup on the client side. I t= hought there could be something similar in PG somewhere in the catalog. = ;

As always, great support. This level of support h= elps a lot in our migration to Postgres. 

=E2=80=94=E2=80=94=E2=80=94=E2=80=94-
=
Thank you. 

On Sep 15, 2018, at 5:= 24 AM, Patrick Molgaard <draaglom@g= mail.com> wrote:

You might find application-level tracing a more practic= al answer - e.g. check out Datadog APM for a (commercial) plug and play appr= oach or Jaeger for a self-hostable option.

Patrick
On Fri, Sep 14, 2018 at 4:38 PM Fred Habash <fmhabash@gmail.com> wrote:
Any ideas, please? 

On Thu, Sep 13, 2018, 3:49 PM Fd Habash <fmhabash@gmail.com&g= t; wrote:

In API function may invoke 10 queries. Ideally, I would like to k= now what queries are invoked by it and how long each took.

 

I=E2=80=99m using p= g_stat_statement. I can see the API function statement, but how do I determi= nistically identify all queries invoked by it?

=  

 

----------------
Thank you

 

= --Apple-Mail-E3C21594-9C9D-4F5F-AB2E-19702F28DE96--