explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 20.068 468.098 ↑ 1.2 4,470 1

Hash Join (cost=1.89..136,858.99 rows=5,549 width=146) (actual time=0.171..468.098 rows=4,470 loops=1)

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

Nested Loop (cost=0.43..11,031.19 rows=5,549 width=142) (actual time=0.047..59.127 rows=4,470 loops=1)

3. 43.013 43.013 ↑ 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.026..43.013 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
4. 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)

5. 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)
6. 0.005 0.013 ↑ 1.0 20 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.008 0.008 ↑ 1.0 20 1

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

8.          

SubPlan (for Hash Join)

9. 13.410 357.600 ↑ 1.0 1 4,470

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

  • Recheck Cond: ((org_id = g.org_id) AND (type_id = 7))
  • Heap Blocks: exact=4470
10. 4.470 344.190 ↓ 0.0 0 4,470

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

11. 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)
12. 312.900 312.900 ↓ 1.7 688 4,470

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

  • Index Cond: (type_id = 7)
13. 8.940 31.290 ↑ 1.0 1 4,470

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

14. 22.350 22.350 ↑ 1.0 1 4,470

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

  • Filter: (id = g.payment_method_id)
  • Rows Removed by Filter: 30
Planning time : 0.400 ms
Execution time : 468.822 ms