explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1SRs

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 159.852 ↓ 0.0 0 1

Limit (cost=39,306.25..39,306.26 rows=1 width=12) (actual time=159.852..159.852 rows=0 loops=1)

2. 0.008 159.851 ↓ 0.0 0 1

Sort (cost=39,306.25..39,306.26 rows=1 width=12) (actual time=159.851..159.851 rows=0 loops=1)

  • Sort Key: diag_radschedules_summary_view.pres_date
  • Sort Method: quicksort Memory: 25kB
3. 0.002 159.843 ↓ 0.0 0 1

Subquery Scan on diag_radschedules_summary_view (cost=38,030.84..39,306.24 rows=1 width=12) (actual time=159.843..159.843 rows=0 loops=1)

4. 0.000 159.841 ↓ 0.0 0 1

Nested Loop (cost=38,030.84..39,306.23 rows=1 width=2,967) (actual time=159.841..159.841 rows=0 loops=1)

5. 0.000 159.841 ↓ 0.0 0 1

Nested Loop Left Join (cost=38,030.56..39,305.68 rows=1 width=38) (actual time=159.841..159.841 rows=0 loops=1)

6. 0.000 159.841 ↓ 0.0 0 1

Nested Loop Left Join (cost=38,030.13..39,304.47 rows=1 width=42) (actual time=159.841..159.841 rows=0 loops=1)

7. 0.015 159.841 ↓ 0.0 0 1

Nested Loop Left Join (cost=38,029.70..39,289.16 rows=1 width=28) (actual time=159.841..159.841 rows=0 loops=1)

  • -> Nested Loop Left Join (cost=38029.28..39281.74 rows=1 width=41) (actual time=159.839..159.839 rows=0 loops
  • Join Filter: (dom.outsource_dest_id = oh.outsource_dest_id)
  • -> Hash Right Join (cost=38029.28..39262.07 rows=1 width=45) (actual time=159.839..159.839 rows=0 loops
  • Hash Cond: (oh.prescribed_id = tp.prescribed_id)
  • -> Seq Scan on outsource_sample_details oh (cost=0.00..1032.66 rows=53366 width=8) (never execute
8. 159.826 159.826 ↓ 0.0 0 1

Hash (cost=38,029.26..38,029.26 rows=1 width=41) (actual time=159.826..159.826 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • -> Nested Loop Left Join (cost=37153.90..38029.26 rows=1 width=41) (actual time=159.825..15
  • Filter: (COALESCE(pr.center_id, isr.center_id) = 22)
  • -> Nested Loop Left Join (cost=37153.62..38015.44 rows=27 width=52) (actual time=159.
  • -> Merge Left Join (cost=37153.20..37802.79 rows=27 width=48) (actual time=159.
  • Merge Cond: (tp.prescribed_id = tcr.prescribed_id)
  • -> Nested Loop (cost=37142.16..37791.53 rows=27 width=48) (actual time=15
9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=37,142.16..37,790.01 rows=27 width=58) (actual rows= loops=)

  • Filter: ((tp.report_id = 0) OR (tp.report_id IS NULL) OR (tvr.s
10. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=37,141.74..37,142.28 rows=87 width=62) (actual rows= loops=)

11. 0.006 159.822 ↓ 0.0 0 1

Sort (cost=37,131.11..37,131.33 rows=87 width=62) (actual time=159.822..159.822 rows=0 loops=1)

  • Sort Key: tp.prescribed_id
  • Sort Method: quicksort Memory: 25kB
12. 0.001 159.816 ↓ 0.0 0 1

Nested Loop (cost=0.28..37,128.30 rows=87 width=62) (actual time=159.816..159.816 rows=0 loops=1)

13. 159.815 159.815 ↓ 0.0 0 1

Seq Scan on tests_prescribed tp (cost=0.00..36,781.96 rows=606 width=52) (actual time=159.815..159.815 rows=0 loops=1)

  • Filter: (((pres_date)::date >= '2019-09-20'::date) AND ((pres_date)::date <= '2019-09-21'::date) AND ((conducted)::text <> ALL ('{X,U,RBS,RAS,S}'::text[])))
  • Rows Removed by Filter: 686208
14. 0.000 0.000 ↓ 0.0 0

Index Scan using diagnostics_pkey on diagnostics d (cost=0.28..0.56 rows=1 width=22) (never executed)

  • Index Cond: ((test_id)::text = (tp.test_id)::text)
  • Filter: ((ddept_id)::text = 'DDept0010'::text)
15. 0.000 0.000 ↓ 0.0 0

Sort (cost=10.63..10.68 rows=20 width=8) (never executed)

  • Sort Key: thr.prescribed_id
16. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_histopathology_results thr (cost=0.00..10.20 rows=20 width=8) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Index Scan using test_visit_reports_pkey on test_visit_reports tvr (cost=0.42..7.43 rows=1 width=6) (never executed)

  • Index Cond: (tp.report_id = report_id)
18. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.18 rows=1 width=38) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Seq Scan on diagnostics_departments dd (cost=0.00..1.18 rows=1 width=38) (never executed)

  • Filter: (((ddept_id)::text = 'DDept0010'::text) AND ((category)::text = 'DEP_RAD'::text))
20. 0.000 0.000 ↓ 0.0 0

Sort (cost=11.04..11.11 rows=30 width=8) (never executed)

  • Sort Key: tcr.prescribed_id
21. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_cytology_results tcr (cost=0.00..10.30 rows=30 width=8) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.42..7.87 rows=1 width=20) (never executed)

  • Index Cond: ((patient_id)::text = (tp.pat_id)::text)
23. 0.000 0.000 ↓ 0.0 0

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.28..0.50 rows=1 width=20) (never executed)

  • Index Cond: ((tp.pat_id)::text = (incoming_visit_id)::text)
24. 0.000 0.000 ↓ 0.0 0

Seq Scan on diag_outsource_master dom (cost=0.00..14.30 rows=430 width=122) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sample_sno_index on sample_collection sc (cost=0.42..7.41 rows=1 width=13) (never executed)

  • Index Cond: (sample_sno = (tp.sample_no)::text)
  • Heap Fetches: 0
26. 0.000 0.000 ↓ 0.0 0

Index Scan using bac_activity_id_index on bill_activity_charge bac (cost=0.43..15.30 rows=1 width=20) (never executed)

  • Index Cond: ((activity_id)::text = ((tp.prescribed_id)::character varying)::text)
  • Filter: ((activity_code)::text = 'DIA'::text)
27. 0.000 0.000 ↓ 0.0 0

Index Scan using bill_charge_pkey on bill_charge bc (cost=0.43..1.20 rows=1 width=14) (never executed)

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

Index Scan using doctors_pkey on doctors condoc (cost=0.28..0.30 rows=1 width=8) (never executed)

  • Index Cond: ((doctor_id)::text = (COALESCE(bc.payee_doctor_id, bac.doctor_id))::text)
  • Filter: ((doctor_name)::text = 'Dr. Sudhi Shalwar'::text)
Planning time : 7.408 ms
Execution time : 160.301 ms