explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XXES : Optimization for: 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; plan #IN2b

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 5.881 53.661 ↓ 262.9 4,470 1

Hash Join (cost=916.83..957.30 rows=17 width=128) (actual time=33.730..53.661 rows=4,470 loops=1)

  • Hash Cond: (g.init_goal_id = i.id)
2. 2.220 47.765 ↓ 262.9 4,470 1

Hash Left Join (cost=915.38..954.88 rows=17 width=124) (actual time=33.698..47.765 rows=4,470 loops=1)

  • Hash Cond: (g.care_regimen_id = c.id)
3. 4.976 45.534 ↓ 262.9 4,470 1

Nested Loop Left Join (cost=914.20..953.46 rows=17 width=124) (actual time=33.673..45.534 rows=4,470 loops=1)

4. 1.800 36.088 ↓ 262.9 4,470 1

Merge Join (cost=914.06..950.34 rows=17 width=126) (actual time=33.663..36.088 rows=4,470 loops=1)

  • Merge Cond: (o.org_id = g.org_id)
5. 0.022 0.022 ↑ 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.022 rows=3 loops=1)

  • Filter: (type_id = 7)
  • Rows Removed by Filter: 10
6. 2.530 34.266 ↓ 4.5 4,470 1

Sort (cost=913.64..916.14 rows=1,001 width=114) (actual time=33.640..34.266 rows=4,470 loops=1)

  • Sort Key: g.org_id
  • Sort Method: quicksort Memory: 1380kB
7. 31.736 31.736 ↓ 4.5 4,470 1

Index Scan using fin_bill_generate_bill_id_idx on fin_bill_generate g (cost=0.43..863.76 rows=1,001 width=114) (actual time=0.022..31.736 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. 4.470 4.470 ↑ 1.0 1 4,470

Index Scan using mc_payment_method_pk on mc_payment_method p (cost=0.14..0.17 rows=1 width=6) (actual time=0.001..0.001 rows=1 loops=4,470)

  • Index Cond: (id = g.payment_method_id)
9. 0.003 0.011 ↑ 1.0 8 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.008 0.008 ↑ 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.008 rows=8 loops=1)

11. 0.006 0.015 ↑ 1.0 20 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.009 0.009 ↑ 1.0 20 1

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

Planning time : 0.612 ms
Execution time : 54.116 ms