explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pAxf : Optimization for: Optimization for: Optimization for: Optimization for: 1; plan #DTLq; plan #j7pc; plan #N5av; plan #R6O

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 21.415 545.194 ↑ 1.2 4,470 1

Hash Join (cost=1.89..136,969.97 rows=5,549 width=144) (actual time=0.250..545.194 rows=4,470 loops=1)

  • Hash Cond: (g.init_goal_id = i.id)
2. 5.428 103.580 ↑ 1.2 4,470 1

Nested Loop (cost=0.43..25,222.76 rows=5,549 width=140) (actual time=0.084..103.580 rows=4,470 loops=1)

3. 5.215 84.742 ↑ 1.2 4,470 1

Nested Loop (cost=0.43..18,980.13 rows=5,549 width=112) (actual time=0.073..84.742 rows=4,470 loops=1)

4. 43.767 43.767 ↑ 1.2 4,470 1

Index Scan using fin_bill_generate_bill_id_idx on fin_bill_generate g (cost=0.43..4,788.56 rows=5,549 width=114) (actual time=0.038..43.767 rows=4,470 loops=1)

  • Index Cond: (bill_id = 842)
  • Filter: ((NOT is_sifted) AND ((region_data ->> 'is_tariff_service'::text))::boolean)
  • Rows Removed by Filter: 29552
5. 8.940 35.760 ↑ 1.0 1 4,470

Limit (cost=0.00..2.54 rows=1 width=2) (actual time=0.008..0.008 rows=1 loops=4,470)

6. 26.820 26.820 ↑ 1.0 1 4,470

Seq Scan on mc_payment_method (cost=0.00..2.54 rows=1 width=2) (actual time=0.006..0.006 rows=1 loops=4,470)

  • Filter: (id = g.payment_method_id)
  • Rows Removed by Filter: 30
7. 4.470 13.410 ↑ 1.0 1 4,470

Limit (cost=0.00..1.10 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=4,470)

8. 8.940 8.940 ↑ 1.0 1 4,470

Seq Scan on mc_care_regimen (cost=0.00..1.10 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=4,470)

  • Filter: (id = g.care_regimen_id)
9. 0.009 0.019 ↑ 1.0 20 1

Hash (cost=1.20..1.20 rows=20 width=8) (actual time=0.019..0.019 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.010 0.010 ↑ 1.0 20 1

Seq Scan on mc_case_init_goal i (cost=0.00..1.20 rows=20 width=8) (actual time=0.003..0.010 rows=20 loops=1)

11.          

SubPlan (for Hash Join)

12. 13.410 420.180 ↑ 1.0 1 4,470

Bitmap Heap Scan on pim_org_code (cost=16.09..20.10 rows=1 width=12) (actual time=0.094..0.094 rows=1 loops=4,470)

  • Recheck Cond: ((org_id = g.org_id) AND (type_id = 7))
  • Heap Blocks: exact=4470
13. 8.940 406.770 ↓ 0.0 0 4,470

BitmapAnd (cost=16.09..16.09 rows=1 width=0) (actual time=0.091..0.091 rows=0 loops=4,470)

14. 26.820 26.820 ↓ 1.2 7 4,470

Bitmap Index Scan on fk_pim_org_code_to_org (cost=0.00..4.46 rows=6 width=0) (actual time=0.006..0.006 rows=7 loops=4,470)

  • Index Cond: (org_id = g.org_id)
15. 371.010 371.010 ↓ 1.7 688 4,470

Bitmap Index Scan on fkc6856cb3ec5d17fa (cost=0.00..11.37 rows=394 width=0) (actual time=0.083..0.083 rows=688 loops=4,470)

  • Index Cond: (type_id = 7)
Planning time : 0.710 ms
Execution time : 545.988 ms