Re: postgresql long running query

From: Samed YILDIRIM <samed(at)reddoc(dot)net>
To: liam saffioti <liam(dot)saffiotti(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>, Julien Rouhaud <rjuju123(at)gmail(dot)com>
Subject: Re: postgresql long running query
Date: 2021-12-03 11:32:31
Message-ID: 1421201638531123@mail.yandex.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

<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" &lt;liam(dot)saffiotti(at)gmail(dot)com&gt;:</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 />   -&gt;  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>

Attachment Content-Type Size
unknown_filename text/html 1.9 KB

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Dischner, Anton 2021-12-03 11:39:38 AW: postgresql long running query
Previous Message liam saffioti 2021-12-03 11:24:15 postgresql long running query