steps of a sql

From: PegoraroF10 <marcos(at)f10(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: steps of a sql
Date: 2019-09-27 21:43:04
Message-ID: 1569620584962-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message PegoraroF10 2019-09-27 21:44:20 Re: Operator is not unique
Previous Message Adrian Klaver 2019-09-27 19:52:39 Re: "Failed to connect to Postgres database"