From: Samed YILDIRIM <samed@reddoc.net>
To: liam saffioti <liam.saffiotti@gmail.com>
To: pgsql-admin <pgsql-admin@lists.postgresql.org>
To: Julien Rouhaud <rjuju123@gmail.com>
Subject: Re: postgresql long running query
Date: Fri, 03 Dec 2021 14:32:31 +0300
Message-ID: <1421201638531123@mail.yandex.com.tr> (raw)
In-Reply-To: <CAGHjuaZkGZVRK6OC4ifBJVQ+=1Y=0CXdDnZ7sjHkdfY2wkACVg@mail.gmail.com>
References: <CAGHjuaZkGZVRK6OC4ifBJVQ+=1Y=0CXdDnZ7sjHkdfY2wkACVg@mail.gmail.com>
<div><div>Hello Liam,</div><div> </div><div>- Have you checked logs to see what happened in the morning?</div><div>- Is the log_lock_waits parameter enabled?</div><div>- What postgres version do you use?</div><div>- Is 43 min 11 seconds total duration or max duration?</div></div><div> </div><div>Best regards.</div><div>Samed YILDIRIM</div><div> </div><div> </div><div> </div><div>03.12.2021, 14:24, "liam saffioti" <liam.saffiotti@gmail.com>:</div><blockquote><div><div>Hello Team,<div> </div><div>I have a problem with a query that consumes a long time. </div><div>The query' execution plan is :</div><div> </div><div> </div><div>EXPLAIN ANALYZE SELECT x."HistoryId", x."SlaDefinition" FROM "T_CMN_SLAHISTORY" AS x WHERE x."DefinitionId" = '302';<br /> QUERY PLAN <br />-----------------------------------------------------------------------------------------------------------------------------------------------------------<br /> Bitmap Heap Scan on "T_CMN_SLAHISTORY" x (cost=2144.77..35086.42 rows=139012 width=8) (actual time=58.806..116.874 rows=135498 loops=1)<br /> Recheck Cond: ("DefinitionId" = 302)<br /> Heap Blocks: exact=2175<br /> -> Bitmap Index Scan on "Index-20180712-192739" (cost=0.00..2110.02 rows=139012 width=0) (actual time=57.043..57.045 rows=135498 loops=1)<br /> Index Cond: ("DefinitionId" = 302)<br /> Planning Time: 11.132 ms<br /> Execution Time: 120.320 ms</div><div> </div><div> </div><div> </div><div>But, the query execution time was 43min 11seconds in the morning in pgbadger report. I don't understand why the query is taking so long. Can you guide me?</div><div> </div><div>Thank you so much.</div><div> </div></div></div></blockquote>
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: samed@reddoc.net, liam.saffiotti@gmail.com, pgsql-admin@lists.postgresql.org, rjuju123@gmail.com
Subject: Re: postgresql long running query
In-Reply-To: <1421201638531123@mail.yandex.com.tr>
* 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