explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gkz

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 26.479 ↑ 1.0 1 1

Nested Loop Left Join (cost=68.83..1,585.76 rows=1 width=241) (actual time=26.471..26.479 rows=1 loops=1)

  • Total runtime: 26.712 ms
2. 0.004 26.461 ↑ 1.0 1 1

Nested Loop Left Join (cost=68.55..1,578.44 rows=1 width=237) (actual time=26.454..26.461 rows=1 loops=1)

3. 0.003 26.447 ↑ 1.0 1 1

Nested Loop Left Join (cost=68.13..1,576.11 rows=1 width=224) (actual time=26.440..26.447 rows=1 loops=1)

4. 0.007 26.443 ↑ 1.0 1 1

Nested Loop Left Join (cost=67.86..1,574.34 rows=1 width=204) (actual time=26.437..26.443 rows=1 loops=1)

5. 0.004 26.425 ↑ 1.0 1 1

Nested Loop Left Join (cost=67.44..1,571.43 rows=1 width=162) (actual time=26.419..26.425 rows=1 loops=1)

6. 0.003 26.417 ↑ 1.0 1 1

Nested Loop (cost=67.17..1,564.13 rows=1 width=148) (actual time=26.413..26.417 rows=1 loops=1)

7. 0.004 26.408 ↑ 1.0 1 1

Nested Loop (cost=67.03..1,563.95 rows=1 width=122) (actual time=26.404..26.408 rows=1 loops=1)

8. 0.040 26.391 ↑ 1.0 1 1

Nested Loop Left Join (cost=66.75..1,556.64 rows=1 width=85) (actual time=26.388..26.391 rows=1 loops=1)

  • Join Filter: ((tp.package_ref IS NULL) AND ((pm.package_id)::text = (tp.test_id)::text))
  • Rows Removed by Join Filter: 118
9. 11.649 26.306 ↑ 1.0 1 1

Hash Right Join (cost=66.75..1,551.19 rows=1 width=80) (actual time=26.303..26.306 rows=1 loops=1)

  • Hash Cond: ((prev_tp.prescribed_id)::numeric = tp.reference_pres)
10. 14.615 14.615 ↓ 1.0 42,363 1

Seq Scan on tests_prescribed prev_tp (cost=0.00..1,272.62 rows=42,362 width=8) (actual time=0.002..14.615 rows=42,363 loops=1)

11. 0.002 0.042 ↑ 1.0 1 1

Hash (cost=66.74..66.74 rows=1 width=76) (actual time=0.042..0.042 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
12. 0.003 0.040 ↑ 1.0 1 1

Nested Loop (cost=4.73..66.74 rows=1 width=76) (actual time=0.039..0.040 rows=1 loops=1)

13. 0.016 0.016 ↑ 4.0 1 1

Index Scan using pat_id_index on tests_prescribed tp (cost=0.29..17.51 rows=4 width=67) (actual time=0.015..0.016 rows=1 loops=1)

  • Index Cond: ((pat_id)::text = 'OP121174'::text)
14. 0.008 0.021 ↑ 1.0 1 1

Bitmap Heap Scan on bill_activity_charge bac (cost=4.44..12.30 rows=1 width=15) (actual time=0.021..0.021 rows=1 loops=1)

  • Recheck Cond: ((activity_id)::text = (tp.prescribed_id)::text)
  • Filter: ((activity_code)::text = 'DIA'::text)
  • Rows Removed by Filter: 1
15. 0.013 0.013 ↑ 1.0 2 1

Bitmap Index Scan on bac_activity_id_index (cost=0.00..4.44 rows=2 width=0) (actual time=0.013..0.013 rows=2 loops=1)

  • Index Cond: ((activity_id)::text = (tp.prescribed_id)::text)
16. 0.045 0.045 ↑ 1.0 118 1

Seq Scan on pack_master pm (cost=0.00..3.37 rows=119 width=5) (actual time=0.005..0.045 rows=118 loops=1)

  • Filter: ((NOT multi_visit_package) OR (multi_visit_package IS NULL))
  • Rows Removed by Filter: 18
17. 0.013 0.013 ↑ 1.0 1 1

Index Scan using diagnostics_pkey on diagnostics d (cost=0.28..7.30 rows=1 width=45) (actual time=0.012..0.013 rows=1 loops=1)

  • Index Cond: ((test_id)::text = (tp.test_id)::text)
18. 0.006 0.006 ↑ 1.0 1 1

Index Scan using diagnostics_departments_pkey on diagnostics_departments ddept (cost=0.14..0.17 rows=1 width=36) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: ((ddept_id)::text = (d.ddept_id)::text)
19. 0.004 0.004 ↓ 0.0 0 1

Index Scan using doctors_pkey on doctors pd (cost=0.27..7.29 rows=1 width=21) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((tp.pres_doctor)::text = (doctor_id)::text)
20. 0.011 0.011 ↑ 1.0 1 1

Index Scan using bill_charge_charge_id_idx on bill_charge bc (cost=0.42..2.90 rows=1 width=51) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: ((bac.charge_id)::text = (charge_id)::text)
21. 0.001 0.001 ↓ 0.0 0 1

Index Scan using doctors_pkey on doctors dc (cost=0.27..1.75 rows=1 width=21) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: ((doctor_id)::text = (bc.payee_doctor_id)::text)
22. 0.010 0.010 ↑ 1.0 1 1

Index Scan using bill_pkey on bill b (cost=0.42..2.33 rows=1 width=23) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: ((bc.bill_no)::text = (bill_no)::text)
23. 0.001 0.001 ↓ 0.0 0 1

Index Scan using package_prescribed_pkey on package_prescribed pp (cost=0.28..7.29 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (prescription_id = tp.package_ref)