query-plan-1136

Change label
Query Plan as raw text
Summary
Time Node
Node (ms) Percent
3851.631 100.00%
 Nested Loop Left Join (cost=59164.01..150997.84 rows=3 width=222) (actual time=2370.672..3851.631 rows=3 loops=1)
3846.695 99.87%
   -> Nested Loop Left Join (cost=59164.01..150980.41 rows=3 width=144) (actual time=2366.476..3846.695 rows=3 loops=1)
3846.590 99.87%
         -> Hash Join (cost=59164.01..150962.65 rows=3 width=144) (actual time=2366.426..3846.590 rows=3 loops=1)
               Hash Cond: ("outer".application_id = "inner".application_id)
               Join Filter: ((("inner".customer_entity = 1) AND (("inner".person_id)::text = '130965-10016'::text)) OR ((("outer".guarantor_id)::text = '130965-10016'::text) AND ("outer".status_new = 60)))
795.530 20.65%
               -> Bitmap Heap Scan on application_history_archive h (cost=2563.12..43815.28 rows=355325 width=48) (actual time=119.882..795.530 rows=506572 loops=1)
                     Recheck Cond: ((status_new = 40) OR (status_new = 60) OR (status_new = 70) OR (status_new = 100) OR (status_new = 110))
                     Filter: ((status_old <> 40) AND (status_old <> 60) AND (status_old <> 70) AND (status_old <> 100) AND (status_old <> 110))
109.244 2.84%
                     -> BitmapOr (cost=2563.12..2563.12 rows=449176 width=0) (actual time=109.244..109.244 rows=0 loops=1)
14.225 0.37%
                           -> Bitmap Index Scan on application_history_archive__status_new_index (cost=0.0..228.83 rows=39950 width=0) (actual time=14.225..14.225 rows=64963 loops=1)
                                 Index Cond: (status_new = 40)
2.609 0.07%
                           -> Bitmap Index Scan on application_history_archive__status_new_index (cost=0.0..228.83 rows=39950 width=0) (actual time=2.609..2.609 rows=13546 loops=1)
                                 Index Cond: (status_new = 60)
33.280 0.86%
                           -> Bitmap Index Scan on application_history_archive__status_new_index (cost=0.0..228.83 rows=39950 width=0) (actual time=33.280..33.280 rows=112417 loops=1)
                                 Index Cond: (status_new = 70)
53.275 1.38%
                           -> Bitmap Index Scan on application_history_archive__status_new_index (cost=0.0..1647.82 rows=289376 width=0) (actual time=53.275..53.275 rows=289717 loops=1)
                                 Index Cond: (status_new = 100)
5.848 0.15%
                           -> Bitmap Index Scan on application_history_archive__status_new_index (cost=0.0..228.83 rows=39950 width=0) (actual time=5.848..5.848 rows=27640 loops=1)
                                 Index Cond: (status_new = 110)
2080.046 54.00%
               -> Hash (cost=55243.71..55243.71 rows=542871 width=104) (actual time=2080.046..2080.046 rows=542873 loops=1)
1301.719 33.80%
                     -> Seq Scan on application_archive a (cost=0.0..55243.71 rows=542871 width=104) (actual time=0.027..1301.719 rows=542873 loops=1)
0.081 0.00%
         -> Index Scan using system_user__user_id_index on system_user u (cost=0.0..5.91 rows=1 width=12) (actual time=0.026..0.027 rows=1 loops=3)
               Index Cond: (u.user_id = "outer".user_id)
0.063 0.00%
   -> Index Scan using shop__shop_id_index on shop s (cost=0.0..5.78 rows=1 width=86) (actual time=0.020..0.021 rows=1 loops=3)
         Index Cond: (s.shop_id = "outer".shop_id)
Run-time
3.863181 seconds (3863.181 ms)