explain.depesz.com

PostgreSQL's explain analyze made readable

Result: L7Av

Settings
# exclusive inclusive rows x rows loops node
1. 2,098.164 89,314.507 ↓ 122,787.0 122,787 1

Sort (cost=739,790.31..739,790.31 rows=1 width=614) (actual time=89,107.593..89,314.507 rows=122,787 loops=1)

  • Sort Key: bca.bill_charge_adjustment_id
  • Sort Method: external merge Disk: 12216kB
2. 285.996 87,216.343 ↓ 122,787.0 122,787 1

Nested Loop Left Join (cost=366,997.06..739,790.30 rows=1 width=614) (actual time=16,149.631..87,216.343 rows=122,787 loops=1)

  • Join Filter: ((smb.salutation_id)::text = (pd.salutation)::text)
  • Rows Removed by Join Filter: 985561
3. 91.181 86,807.560 ↓ 122,787.0 122,787 1

Nested Loop Left Join (cost=366,997.06..739,789.07 rows=1 width=619) (actual time=16,149.578..86,807.560 rows=122,787 loops=1)

4. 88.283 85,488.509 ↓ 122,787.0 122,787 1

Nested Loop Left Join (cost=366,996.63..739,780.90 rows=1 width=608) (actual time=16,149.506..85,488.509 rows=122,787 loops=1)

5. 9.382 85,400.226 ↓ 122,787.0 122,787 1

Nested Loop Left Join (cost=366,996.50..739,777.14 rows=1 width=101) (actual time=16,149.470..85,400.226 rows=122,787 loops=1)

6. 25.252 84,899.696 ↓ 122,787.0 122,787 1

Nested Loop Left Join (cost=366,996.08..739,768.97 rows=1 width=94) (actual time=16,149.436..84,899.696 rows=122,787 loops=1)

7. 1,062.180 83,769.361 ↓ 122,787.0 122,787 1

Nested Loop (cost=366,995.65..739,760.80 rows=1 width=84) (actual time=16,149.348..83,769.361 rows=122,787 loops=1)

  • Join Filter: ((bca.charge_head)::text = (chc.chargehead_id)::text)
  • Rows Removed by Join Filter: 8787141
8. 1,112.414 82,088.436 ↓ 123,749.0 123,749 1

Nested Loop (cost=366,995.65..739,756.18 rows=1 width=72) (actual time=16,149.283..82,088.436 rows=123,749 loops=1)

9. 6,261.958 14,938.834 ↓ 124,130.1 4,716,942 1

Hash Join (cost=366,995.22..739,444.73 rows=38 width=64) (actual time=2,538.051..14,938.834 rows=4,716,942 loops=1)

  • Hash Cond: (((bca.charge_id)::text = (bc.charge_id)::text) AND ((bca.bill_no)::text = (bc.bill_no)::text))
10. 6,151.780 6,151.780 ↓ 1.0 4,717,022 1

Seq Scan on bill_charge_adjustment bca (cost=0.00..169,791.50 rows=4,715,750 width=48) (actual time=12.627..6,151.780 rows=4,717,022 loops=1)

11. 1,248.727 2,525.096 ↓ 1.0 4,799,740 1

Hash (cost=258,267.89..258,267.89 rows=4,766,089 width=34) (actual time=2,525.096..2,525.096 rows=4,799,740 loops=1)

  • Buckets: 2048 Batches: 512 Memory Usage: 639kB
12. 1,276.369 1,276.369 ↓ 1.0 4,799,740 1

Seq Scan on bill_charge bc (cost=0.00..258,267.89 rows=4,766,089 width=34) (actual time=0.027..1,276.369 rows=4,799,740 loops=1)

13. 66,037.188 66,037.188 ↓ 0.0 0 4,716,942

Index Scan using bill_pkey on bill b (cost=0.43..8.19 rows=1 width=26) (actual time=0.014..0.014 rows=0 loops=4,716,942)

  • Index Cond: ((bill_no)::text = (bc.bill_no)::text)
  • Filter: ((date(finalized_date) >= '2019-07-01'::date) AND (date(finalized_date) <= '2019-07-31'::date))
  • Rows Removed by Filter: 1
14. 618.745 618.745 ↑ 1.0 72 123,749

Seq Scan on chargehead_constants chc (cost=0.00..3.72 rows=72 width=23) (actual time=0.000..0.005 rows=72 loops=123,749)

15. 1,105.083 1,105.083 ↑ 1.0 1 122,787

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.42..8.17 rows=1 width=19) (actual time=0.009..0.009 rows=1 loops=122,787)

  • Index Cond: ((patient_id)::text = (b.visit_id)::text)
16. 491.148 491.148 ↓ 0.0 0 122,787

Index Scan using pharmacy_retail_customers_pkey on store_retail_customers prc (cost=0.42..8.15 rows=1 width=16) (actual time=0.004..0.004 rows=0 loops=122,787)

  • Index Cond: ((customer_id)::text = (b.visit_id)::text)
17. 0.000 0.000 ↓ 0.0 0 122,787

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.14..3.76 rows=1 width=564) (actual time=0.000..0.000 rows=0 loops=122,787)

  • Index Cond: ((incoming_visit_id)::text = (b.visit_id)::text)
18. 1,227.870 1,227.870 ↑ 1.0 1 122,787

Index Scan using patient_details_pkey on patient_details pd (cost=0.42..8.16 rows=1 width=31) (actual time=0.010..0.010 rows=1 loops=122,787)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
19. 122.787 122.787 ↑ 1.0 9 122,787

Seq Scan on salutation_master smb (cost=0.00..1.09 rows=9 width=13) (actual time=0.000..0.001 rows=9 loops=122,787)