explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g2SU

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 54,575.329 ↓ 0.0 0 1

Nested Loop Left Join (cost=269,106.09..269,139.66 rows=1 width=619) (actual time=54,575.329..54,575.329 rows=0 loops=1)

2. 0.000 54,575.327 ↓ 0.0 0 1

Nested Loop Left Join (cost=269,105.96..269,139.46 rows=1 width=624) (actual time=54,575.327..54,575.327 rows=0 loops=1)

3. 0.001 54,575.327 ↓ 0.0 0 1

Nested Loop Left Join (cost=269,105.67..269,139.07 rows=1 width=616) (actual time=54,575.327..54,575.327 rows=0 loops=1)

4. 0.000 54,575.326 ↓ 0.0 0 1

Nested Loop Left Join (cost=269,105.53..269,130.91 rows=1 width=112) (actual time=54,575.326..54,575.326 rows=0 loops=1)

5. 0.000 54,575.326 ↓ 0.0 0 1

Nested Loop Left Join (cost=269,105.24..269,122.59 rows=1 width=102) (actual time=54,575.326..54,575.326 rows=0 loops=1)

6. 0.001 54,575.326 ↓ 0.0 0 1

Nested Loop (cost=269,104.95..269,114.27 rows=1 width=88) (actual time=54,575.326..54,575.326 rows=0 loops=1)

7. 948.524 54,575.325 ↓ 0.0 0 1

Nested Loop (cost=269,104.81..269,113.72 rows=1 width=77) (actual time=54,575.325..54,575.325 rows=0 loops=1)

  • Join Filter: ((bca.bill_no)::text = (b.bill_no)::text)
8. 41,239.323 53,626.801 ↓ 34,843.1 1,114,978 1

Sort (cost=269,104.38..269,104.46 rows=32 width=774) (actual time=49,181.425..53,626.801 rows=1,114,978 loops=1)

  • Sort Key: bca.bill_charge_adjustment_id
  • Sort Method: external merge Disk: 343784kB
9. 7,833.723 12,387.478 ↓ 34,843.1 1,114,978 1

Hash Join (cost=96,629.65..269,103.58 rows=32 width=774) (actual time=2,807.983..12,387.478 rows=1,114,978 loops=1)

  • Hash Cond: (((bca.charge_id)::text = (bc.charge_id)::text) AND ((bca.bill_no)::text = (bc.bill_no)::text))
10. 1,823.501 1,823.501 ↓ 1.0 1,123,259 1

Seq Scan on bill_charge_adjustment bca (cost=0.00..39,597.35 rows=1,123,235 width=244) (actual time=0.742..1,823.501 rows=1,123,259 loops=1)

11. 1,475.675 2,730.254 ↓ 1.0 709,375 1

Hash (cost=36,130.46..36,130.46 rows=709,146 width=548) (actual time=2,730.254..2,730.254 rows=709,375 loops=1)

  • Buckets: 1024 Batches: 512 Memory Usage: 246kB
12. 1,254.579 1,254.579 ↓ 1.0 709,375 1

Seq Scan on bill_charge bc (cost=0.00..36,130.46 rows=709,146 width=548) (actual time=0.009..1,254.579 rows=709,375 loops=1)

13. 0.000 0.000 ↓ 0.0 0 1,114,978

Materialize (cost=0.42..8.46 rows=1 width=31) (actual time=0.000..0.000 rows=0 loops=1,114,978)

14. 0.108 0.108 ↓ 0.0 0 1

Index Scan using bill_finalized_date_idx on bill b (cost=0.42..8.46 rows=1 width=31) (actual time=0.108..0.108 rows=0 loops=1)

  • Index Cond: ((date(finalized_date) >= '2019-01-04'::date) AND (date(finalized_date) <= '2019-01-04'::date))
  • Filter: (CASE WHEN (status = 'A'::bpchar) THEN 'Open'::text WHEN (status = 'F'::bpchar) THEN 'Finalized'::text WHEN (status = 'C'::bpchar) THEN 'Closed'::text ELSE 'Cancelled'::text END = 'C'::text)
  • Rows Removed by Filter: 68
15. 0.000 0.000 ↓ 0.0 0

Index Scan using chargehead_constants_pkey on chargehead_constants chc (cost=0.14..0.54 rows=1 width=23) (never executed)

  • Index Cond: ((chargehead_id)::text = (bca.charge_head)::text)
16. 0.000 0.000 ↓ 0.0 0

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.29..8.31 rows=1 width=26) (never executed)

  • Index Cond: ((patient_id)::text = (b.visit_id)::text)
17. 0.000 0.000 ↓ 0.0 0

Index Scan using pharmacy_retail_customers_pkey on store_retail_customers prc (cost=0.29..8.31 rows=1 width=19) (never executed)

  • Index Cond: ((customer_id)::text = (b.visit_id)::text)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.14..8.16 rows=1 width=564) (never executed)

  • Index Cond: ((incoming_visit_id)::text = (b.visit_id)::text)
19. 0.000 0.000 ↓ 0.0 0

Index Scan using patient_details_pkey on patient_details pd (cost=0.29..0.38 rows=1 width=36) (never executed)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
20. 0.000 0.000 ↓ 0.0 0

Index Scan using salutation_master_pkey on salutation_master smb (cost=0.13..0.15 rows=1 width=13) (never executed)

  • Index Cond: ((salutation_id)::text = (pd.salutation)::text)