pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PegoraroF10 <marcos@f10.com.br>
To: pgsql-general@postgresql.org
Subject: steps of a sql
Date: Fri, 27 Sep 2019 14:43:04 -0700 (MST)
Message-ID: <1569620584962-0.post@n3.nabble.com> (raw)

Some days ago one of my customers claimed that one of his queries were
spending too much time. Then on postgres log it appears really strange. That
query doesn´t usually appears as parse, sometimes only as execute, because
it tooks almost all times less than 500ms. But on that day something
happened, what was that, PARSE time of 10 minutes ?

Command_Tag  Message
PARSE              duration: 552607.263 ms  parse PRSTMTST13817971293: WITH
...
SELECT            duration: 1211.195 ms  execute
PRSTMTST13955596862/PORTALST13955596862: WITH  ...
PARSE              duration: 673398.585 ms  parse PRSTMTST13857292877: WITH
...
SELECT            duration: 2742.588 ms  execute
PRSTMTST13817971293/PORTALST13817971293: WITH  ...
SELECT            duration: 1318.766 ms  execute
PRSTMTST13844185613/PORTALST13844185613: WITH  ...

Then, I didn´t find in the docs what are the steps of execution of a query
and obviously why that SQL took so long. These 5 examples are the same
query, so it doesn´t make sense that I´ll wait 10 minutes do parse and just
1 or 2 seconds to execute. So, the quetion is, how can I know if I´m running
a simple query or a extended query, like the docs explain on
https://www.postgresql.org/docs/11/protocol-flow.html and what can I do to
find what happened and solve to never occur again.



--
Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html





view thread (2+ messages)  latest in thread

Message-ID: <1569620584962-0.post@n3.nabble.com>
Permalink:  ../1569620584962-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1569620584962-0.post@n3.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: marcos@f10.com.br
  Subject: Re: steps of a sql
  In-Reply-To: <1569620584962-0.post@n3.nabble.com>
  References: <1569620584962-0.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox