explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 4.721 43.875 ↑ 1.2 4,470 1

Hash Join (cost=5,139.67..5,671.11 rows=5,549 width=128) (actual time=34.151..43.875 rows=4,470 loops=1)

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

Hash Left Join (cost=5,138.22..5,350.59 rows=5,549 width=124) (actual time=34.122..39.140 rows=4,470 loops=1)

  • Hash Cond: (g.care_regimen_id = c.id)
3. 1.562 37.658 ↑ 1.2 4,470 1

Hash Left Join (cost=5,137.04..5,273.11 rows=5,549 width=124) (actual time=34.109..37.658 rows=4,470 loops=1)

  • Hash Cond: (g.payment_method_id = p.id)
4. 1.607 36.072 ↑ 1.2 4,470 1

Merge Right Join (cost=5,134.07..5,193.85 rows=5,549 width=126) (actual time=34.070..36.072 rows=4,470 loops=1)

  • Merge Cond: (o.org_id = g.org_id)
5. 0.025 0.025 ↑ 131.3 3 1

Index Scan using fk_pim_org_code_to_org on pim_org_code o (cost=0.42..12,256.31 rows=394 width=16) (actual time=0.011..0.025 rows=3 loops=1)

  • Filter: (type_id = 7)
  • Rows Removed by Filter: 10
6. 2.405 34.440 ↑ 1.2 4,470 1

Sort (cost=5,133.66..5,147.53 rows=5,549 width=114) (actual time=34.047..34.440 rows=4,470 loops=1)

  • Sort Key: g.org_id
  • Sort Method: quicksort Memory: 1380kB
7. 32.035 32.035 ↑ 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.022..32.035 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
8. 0.010 0.024 ↑ 1.0 43 1

Hash (cost=2.43..2.43 rows=43 width=6) (actual time=0.024..0.024 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
9. 0.014 0.014 ↑ 1.0 43 1

Seq Scan on mc_payment_method p (cost=0.00..2.43 rows=43 width=6) (actual time=0.004..0.014 rows=43 loops=1)

10. 0.003 0.008 ↑ 1.0 8 1

Hash (cost=1.08..1.08 rows=8 width=8) (actual time=0.008..0.008 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.005 0.005 ↑ 1.0 8 1

Seq Scan on mc_care_regimen c (cost=0.00..1.08 rows=8 width=8) (actual time=0.004..0.005 rows=8 loops=1)

12. 0.007 0.014 ↑ 1.0 20 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.007 0.007 ↑ 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.007 rows=20 loops=1)

Planning time : 0.647 ms
Execution time : 44.185 ms