explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9t5k

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=67.46..141.31 rows=1 width=1,071) (actual rows= loops=)

  • Join Filter: ((bac.charge_id)::text = (bc_surgeon.charge_ref)::text)
2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=67.04..131.06 rows=1 width=1,061) (actual rows= loops=)

  • Join Filter: ((bac.charge_id)::text = (bc_sac.charge_ref)::text)
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=66.62..120.84 rows=1 width=1,032) (actual rows= loops=)

  • Join Filter: (bos.prescribed_id = bps.prescribed_id)
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14.40..64.39 rows=1 width=1,000) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=13.98..59.08 rows=1 width=976) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=13.56..51.81 rows=1 width=398) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=9.12..39.51 rows=1 width=389) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=8.85..31.21 rows=1 width=375) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=8.58..22.91 rows=1 width=355) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=8.30..14.61 rows=1 width=342) (actual rows= loops=)

  • Join Filter: ((tm.theatre_id)::text = (bps.theatre_name)::text)
11. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.30..13.34 rows=1 width=88) (actual rows= loops=)

  • Hash Cond: ((om.op_id)::text = (bps.operation_name)::text)
12. 0.000 0.000 ↓ 0.0

Seq Scan on operation_master om (cost=0.00..4.47 rows=147 width=33) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash (cost=8.29..8.29 rows=1 width=64) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan using bed_operation_schedule_patient_id_idx on bed_operation_schedule bps (cost=0.28..8.29 rows=1 width=64) (actual rows= loops=)

  • Index Cond: ((patient_id)::text = ''::text)
  • Filter: (package_ref IS NULL)
15. 0.000 0.000 ↓ 0.0

Seq Scan on theatre_master tm (cost=0.00..1.12 rows=12 width=256) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Index Scan using doctors_pkey on doctors sdoc (cost=0.27..8.29 rows=1 width=21) (actual rows= loops=)

  • Index Cond: ((doctor_id)::text = (bps.surgeon)::text)
17. 0.000 0.000 ↓ 0.0

Index Scan using doctors_pkey on doctors adoc (cost=0.27..8.29 rows=1 width=21) (actual rows= loops=)

  • Index Cond: ((doctor_id)::text = (bps.anaesthetist)::text)
18. 0.000 0.000 ↓ 0.0

Index Scan using doctors_pkey on doctors doc (cost=0.27..8.29 rows=1 width=21) (actual rows= loops=)

  • Index Cond: ((doctor_id)::text = (bps.consultant_doctor)::text)
19. 0.000 0.000 ↓ 0.0

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

  • Recheck Cond: ((activity_id)::text = (bps.prescribed_id)::text)
  • Filter: ((activity_code)::text = 'OPE'::text)
20. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((activity_id)::text = (bps.prescribed_id)::text)
21. 0.000 0.000 ↓ 0.0

Index Scan using bill_charge_charge_id_idx on bill_charge bc (cost=0.42..7.26 rows=1 width=578) (actual rows= loops=)

  • Index Cond: ((bac.charge_id)::text = (charge_id)::text)
22. 0.000 0.000 ↓ 0.0

Index Scan using bill_pkey on bill b (cost=0.42..5.30 rows=1 width=24) (actual rows= loops=)

  • Index Cond: ((bc.bill_no)::text = (bill_no)::text)
23. 0.000 0.000 ↓ 0.0

HashAggregate (cost=52.22..53.52 rows=130 width=28) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash Join (cost=6.31..19.39 rows=130 width=28) (actual rows= loops=)

  • Hash Cond: ((bos.operation_id)::text = (opm.op_id)::text)
25. 0.000 0.000 ↓ 0.0

Seq Scan on bed_operation_secondary bos (cost=0.00..11.30 rows=130 width=36) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Hash (cost=4.47..4.47 rows=147 width=33) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Seq Scan on operation_master opm (cost=0.00..4.47 rows=147 width=33) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Index Scan using bill_charge_bill_no_index on bill_charge bc_sac (cost=0.42..10.21 rows=1 width=40) (actual rows= loops=)

  • Index Cond: ((bc.bill_no)::text = (bill_no)::text)
  • Filter: ((charge_head)::text = 'SACOPE'::text)
29. 0.000 0.000 ↓ 0.0

Index Scan using bill_charge_bill_no_index on bill_charge bc_surgeon (cost=0.42..10.21 rows=1 width=40) (actual rows= loops=)

  • Index Cond: ((bc.bill_no)::text = (bill_no)::text)" Filter: ((charge_head)::text = 'SUOPE'::text)