explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MkFy

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 2,921.008 ↑ 1.0 15 1

Limit (cost=2,173.20..4,345.41 rows=15 width=30) (actual time=2,920.133..2,921.008 rows=15 loops=1)

2. 0.037 2,921.003 ↑ 547.5 30 1

GroupAggregate (cost=0.99..2,378,575.58 rows=16,425 width=30) (actual time=1,868.958..2,921.003 rows=30 loops=1)

3. 0.061 2,920.966 ↑ 382.0 43 1

Nested Loop Left Join (cost=0.99..2,378,247.08 rows=16,425 width=30) (actual time=873.403..2,920.966 rows=43 loops=1)

  • Join Filter: ((pd.mr_no)::text = (uma.mr_no)::text)
  • Filter: ((pd.patient_group = 0) OR ((uma.emp_username)::text = current_setting('application.username'::text)))
4. 108.192 2,920.905 ↑ 382.0 43 1

Nested Loop (cost=0.99..2,189,712.77 rows=16,425 width=34) (actual time=873.376..2,920.905 rows=43 loops=1)

5. 224.308 224.308 ↑ 5.9 517,681 1

Index Scan Backward using patient_details_mr_no_original_mr_no_coalesce_idx on patient_details pd (cost=0.43..159,891.50 rows=3,030,023 width=22) (actual time=0.021..224.308 rows=517,681 loops=1)

6. 2,588.405 2,588.405 ↓ 0.0 0 517,681

Index Scan using patient_registration_mrno_visitid_visittype_centerid_idx on patient_registration pr (cost=0.56..0.66 rows=1 width=27) (actual time=0.005..0.005 rows=0 loops=517,681)

  • Index Cond: (((mr_no)::text = (pd.mr_no)::text) AND (patient_id IS NOT NULL) AND (visit_type = 'o'::bpchar) AND (center_id = 7))
7. 0.000 0.000 ↓ 0.0 0 43

Materialize (cost=0.00..17.65 rows=510 width=126) (actual time=0.000..0.000 rows=0 loops=43)

8. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on user_mrno_association uma (cost=0.00..15.10 rows=510 width=126) (actual time=0.001..0.001 rows=0 loops=1)