Re: Issue executing query from container

2020-10-30 Thread Peter J. Holzer
On 2020-10-27 17:46:59 +0100, Eudald Valcàrcel Lacasa wrote: > I've run the automated script several times, and the duration of the > query is widely variable. > [0.005 s vs. 1500 s for the same plan] > As you can see, they don't seem to differ between each other, but the > duration is abismaly

Re: Issue executing query from container

2020-10-27 Thread Tom Lane
=?UTF-8?Q?Eudald_Valc=C3=A0rcel_Lacasa?= writes: > I've run the automated script several times, and the duration of the > query is widely variable. Interesting. You might try using auto_explain to log the query plans and see if the plan is changing. regards, tom lane

Re: Issue executing query from container

2020-10-27 Thread Eudald Valcàrcel Lacasa
Hello Tom, Sorry to bump this conversation, but I'm still dealing with this issue. I come back because I've found something different that throws away all the hypotheses (or at least it's what I think). I've run the automated script several times, and the duration of the query is widely variable.

Re: Issue executing query from container

2020-07-15 Thread Eudald Valcàrcel Lacasa
Hello Tom, I've noticed something that may be a factor on this problem. In the automated script, 5 or 6 seconds before this query happens, the foreign table is created. If I create the foreign table manually and skip its creation in the automated script, and then I run the automated script, the qu

Re: Issue executing query from container

2020-07-15 Thread Tom Lane
=?UTF-8?Q?Eudald_Valc=C3=A0rcel_Lacasa?= writes: > After running the query both manually and with the script, I've the > following logs: > MANUALLY: > Update on import_temp_2 tmp (cost=116.73..17352.10 rows=5557 width=293) > -> Hash Join (cost=116.73..17352.10 rows=5557 width=293) >

Re: Issue executing query from container

2020-07-15 Thread Eudald Valcàrcel Lacasa
Hello Tom, Thanks for your answer! I didn't know about this plugin and configured postgresql with it. After running the query both manually and with the script, I've the following logs: MANUALLY: 2020-07-15 00:56:08.735 CEST [20457] cefron@kontriki LOG: statement: UPDATE import_temp_2 AS tmp SET

Re: Issue executing query from container

2020-07-14 Thread Tom Lane
=?UTF-8?Q?Eudald_Valc=C3=A0rcel_Lacasa?= 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

Issue executing query from container

2020-07-14 Thread Eudald Valcàrcel Lacasa
Hello! 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 t