pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Eudald ValcĂ rcel Lacasa <eudald.valcarcel@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Issue executing query from container
Date: Tue, 14 Jul 2020 17:51:38 -0400
Message-ID: <2961873.1594763498@sss.pgh.pa.us> (raw)
In-Reply-To: <CANEx+AWsQETay6WmKUw=8HPZ3L9bvk1AveF5wrOQD+tAPyN3WA@mail.gmail.com>
References: <CANEx+AWsQETay6WmKUw=8HPZ3L9bvk1AveF5wrOQD+tAPyN3WA@mail.gmail.com>

=?UTF-8?Q?Eudald_Valc=C3=A0rcel_Lacasa?= <eudald.valcarcel@gmail.com> writes:
> I'm running a docker container that executes a php script running a
> sequence of queries.
> One of the queries gets stuck (takes more than 2 hours in execution,
> active in pg_stat_activity).
> The query is executed with a JOIN between a FOREIGN TABLE and a local table.

> Executing this query from the psql console takes less than 5 seconds to resolve.
> If I execute the query from the container created, manually, it
> resolves as well within 5 seconds.

> Can anyone guide me in a way I can troubleshoot what is causing the
> query to get stuck?

It's a very good bet that it's something about the query being
parameterized or not.  You could try installing auto_explain to
compare the plans that are generated.

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <2961873.1594763498@sss.pgh.pa.us>
Permalink:  ../2961873.1594763498@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2961873.1594763498@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, eudald.valcarcel@gmail.com
  Subject: Re: Issue executing query from container
  In-Reply-To: <2961873.1594763498@sss.pgh.pa.us>
  References: <CANEx+AWsQETay6WmKUw=8HPZ3L9bvk1AveF5wrOQD+tAPyN3WA@mail.gmail.com> <2961873.1594763498@sss.pgh.pa.us>

* 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