postgresql long running query - Mailing list pgsql-admin

From liam saffioti
Subject postgresql long running query
Date
Msg-id CAGHjuaZkGZVRK6OC4ifBJVQ+=1Y=0CXdDnZ7sjHkdfY2wkACVg@mail.gmail.com
Whole thread Raw
Responses AW: postgresql long running query  ("Dischner, Anton" <Anton.Dischner@med.uni-muenchen.de>)
List pgsql-admin
Hello Team,

I have a problem with a query that consumes a long time. 
The query' execution plan is :


EXPLAIN ANALYZE SELECT x."HistoryId", x."SlaDefinition" FROM "T_CMN_SLAHISTORY" AS x WHERE x."DefinitionId" = '302';
                                                                        QUERY PLAN                                                                        
-----------------------------------------------------------------------------------------------------------------------------------------------------------
 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)
   Recheck Cond: ("DefinitionId" = 302)
   Heap Blocks: exact=2175
   ->  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)
         Index Cond: ("DefinitionId" = 302)
 Planning Time: 11.132 ms
 Execution Time: 120.320 ms



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?

Thank you so much.

pgsql-admin by date:

Previous
From: Jiankang Ji
Date:
Subject: Re: Are you working on both pentaho and postgresql?
Next
From: "Dischner, Anton"
Date:
Subject: AW: postgresql long running query