pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
steps of a sql
2+ messages / 2 participants
[nested] [flat]

* steps of a sql
@ 2019-09-27 21:43 PegoraroF10 <marcos@f10.com.br>
  2019-09-27 22:04 ` Re: steps of a sql Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: PegoraroF10 @ 2019-09-27 21:43 UTC (permalink / raw)
  To: 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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: steps of a sql
  2019-09-27 21:43 steps of a sql PegoraroF10 <marcos@f10.com.br>
@ 2019-09-27 22:04 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2019-09-27 22:04 UTC (permalink / raw)
  To: PegoraroF10 <marcos@f10.com.br>; +Cc: pgsql-general

PegoraroF10 <marcos@f10.com.br> writes:
> 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 ?

Something else sitting on an exclusive table lock, perhaps?

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-09-27 22:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 21:43 steps of a sql PegoraroF10 <marcos@f10.com.br>
2019-09-27 22:04 ` Tom Lane <tgl@sss.pgh.pa.us>

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