explain.depesz.com

PostgreSQL's explain analyze made readable

Result: c3WD

Settings
# exclusive inclusive rows x rows loops node
1. 38.446 1,843.989 ↓ 3.0 3 1

Hash Join (cost=126,538.55..158,244.57 rows=1 width=610) (actual time=1,268.567..1,843.989 rows=3 loops=1)

  • Hash Cond: (p.polpid = v.polpid)
2. 239.301 1,128.328 ↑ 1.0 583,922 1

Hash Left Join (cost=35,703.39..65,195.43 rows=584,183 width=27) (actual time=537.747..1,128.328 rows=583,922 loops=1)

  • Hash Cond: (pv.polpid_vs = pe.polpid_vs)
  • Filter: (pe.inactif_uid IS NULL)
3. 247.377 618.316 ↑ 1.0 583,922 1

Hash Left Join (cost=17,852.97..39,319.12 rows=584,193 width=23) (actual time=263.051..618.316 rows=583,922 loops=1)

  • Hash Cond: (p.polpid = pv.polpid)
  • Filter: (pv.inactif_uid IS NULL)
4. 111.675 111.675 ↑ 1.0 583,922 1

Seq Scan on rlm_patient p (cost=0.00..13,433.43 rows=584,198 width=19) (actual time=0.007..111.675 rows=583,922 loops=1)

  • Filter: (inactif_uid IS NULL)
  • Rows Removed by Filter: 13332
5. 144.433 259.264 ↓ 1.0 597,254 1

Hash (cost=10,387.43..10,387.43 rows=597,243 width=12) (actual time=259.264..259.264 rows=597,254 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 31523kB
6. 114.831 114.831 ↓ 1.0 597,254 1

Seq Scan on rlm_patient_ver pv (cost=0.00..10,387.43 rows=597,243 width=12) (actual time=0.007..114.831 rows=597,254 loops=1)

7. 158.325 270.711 ↓ 1.0 596,563 1

Hash (cost=10,393.52..10,393.52 rows=596,552 width=16) (actual time=270.711..270.711 rows=596,563 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 33887kB
8. 112.386 112.386 ↓ 1.0 596,563 1

Seq Scan on rlm_patient_id_ext pe (cost=0.00..10,393.52 rows=596,552 width=16) (actual time=0.009..112.386 rows=596,563 loops=1)

9. 0.010 677.056 ↓ 3.0 3 1

Hash (cost=90,835.15..90,835.15 rows=1 width=83) (actual time=677.056..677.056 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.007 677.046 ↓ 3.0 3 1

Nested Loop Left Join (cost=3.57..90,835.15 rows=1 width=83) (actual time=51.329..677.046 rows=3 loops=1)

  • Filter: (ve.inactif_uid IS NULL)
11. 0.006 677.027 ↓ 3.0 3 1

Nested Loop (cost=3.14..90,834.65 rows=1 width=87) (actual time=51.318..677.027 rows=3 loops=1)

12. 0.029 676.997 ↓ 3.0 3 1

Nested Loop (cost=2.71..90,834.13 rows=1 width=91) (actual time=51.298..676.997 rows=3 loops=1)

  • Join Filter: (v.polvid = dyn.polvid)
13. 0.003 676.872 ↓ 4.0 4 1

Nested Loop (cost=2.13..90,831.43 rows=1 width=42) (actual time=51.237..676.872 rows=4 loops=1)

14. 0.006 676.849 ↓ 4.0 4 1

Nested Loop (cost=1.70..90,827.07 rows=1 width=32) (actual time=51.225..676.849 rows=4 loops=1)

15. 0.011 676.791 ↑ 2.0 4 1

Nested Loop (cost=1.14..90,821.40 rows=8 width=16) (actual time=51.192..676.791 rows=4 loops=1)

16. 676.760 676.760 ↑ 2.0 4 1

Index Scan using lm_status_origin_idx on lm_status_a sta (cost=0.57..90,752.64 rows=8 width=8) (actual time=51.173..676.760 rows=4 loops=1)

  • Index Cond: (origin >= '2019-02-01 00:00:00'::timestamp without time zone)
  • Filter: ((status = 2) AND (polhid = 242366) AND ((origin - '23:59:59'::interval) <= '2019-02-03 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 1746189
17. 0.020 0.020 ↑ 1.0 1 4

Index Scan using lm_action_pkey on lm_action_e act (cost=0.57..8.59 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=4)

  • Index Cond: (pkey = sta.action_key)
18. 0.052 0.052 ↑ 1.0 1 4

Index Scan using di_entry_pkey on lm_entry lm (cost=0.57..0.70 rows=1 width=24) (actual time=0.013..0.013 rows=1 loops=4)

  • Index Cond: (pkey = act.entry_key)
  • Filter: ((((code)::text >= 'KINE_400'::text) AND ((code)::text <= 'KINE_412'::text)) OR (((code)::text >= 'KINE_414'::text) AND ((code)::text <= 'KINE_422'::text)) OR (((code)::text >= 'MULT_500'::text) AND ((code)::text <= 'MULT_524'::text)) OR (((code)::text >= 'MULT_539'::text) AND ((code)::text <= 'MULT_581'::text)) OR (((code)::text >= 'LOG_402'::text) AND ((code)::text <= 'LOG_419'::text)) OR (((code)::text >= 'PSY_402'::text) AND ((code)::text <= 'PSY_418'::text)) OR (((code)::text >= 'NPSY_402'::text) AND ((code)::text <= 'NPSY_410'::text)))
19. 0.020 0.020 ↑ 1.0 1 4

Index Scan using rlm_visit_polvid_idx on rlm_visit v (cost=0.43..4.35 rows=1 width=10) (actual time=0.004..0.005 rows=1 loops=4)

  • Index Cond: (polvid = lm.polvid)
  • Filter: (inactif_uid IS NULL)
20. 0.096 0.096 ↑ 1.0 1 4

Index Scan using di_dyn_data__link on di_dyn_data dyn (cost=0.57..2.69 rows=1 width=49) (actual time=0.022..0.024 rows=1 loops=4)

  • Index Cond: ((link)::text = concat('LMA', act.pkey))
  • Filter: (actif AND ((code)::text = '70019225'::text))
  • Rows Removed by Filter: 5
21. 0.024 0.024 ↑ 1.0 1 3

Index Scan using rl_visit_ver_polvid_vs_idx on rlm_visit_ver vv (cost=0.43..0.51 rows=1 width=10) (actual time=0.008..0.008 rows=1 loops=3)

  • Index Cond: (polvid = v.polvid)
  • Filter: ((inactif_uid IS NULL) AND (((v.visit_state <> 3) AND (visit_state <> 3)) OR ((v.visit_state = 3) AND (visit_state = 3))))
  • Rows Removed by Filter: 1
22. 0.012 0.012 ↑ 1.0 1 3

Index Scan using rl_visit_ext_polvid_vs_idx on rlm_visit_id_ext ve (cost=0.43..0.49 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=3)

  • Index Cond: (vv.polvid_vs = polvid_vs)
23.          

SubPlan (forHash Join)

24. 0.009 0.159 ↑ 1.0 1 3

Limit (cost=19.26..23.28 rows=1 width=14) (actual time=0.053..0.053 rows=1 loops=3)

25. 0.021 0.150 ↑ 1.0 1 3

Bitmap Heap Scan on di_dyn_data di (cost=19.26..23.28 rows=1 width=14) (actual time=0.050..0.050 rows=1 loops=3)

  • Recheck Cond: (((link)::text = concat('LMA', act.pkey)) AND (polvid = lm.polvid))
  • Filter: (actif AND ((code)::text = '70019249'::text))
  • Rows Removed by Filter: 5
  • Heap Blocks: exact=8
26. 0.021 0.129 ↓ 0.0 0 3

BitmapAnd (cost=19.26..19.26 rows=1 width=0) (actual time=0.043..0.043 rows=0 loops=3)

27. 0.060 0.060 ↑ 12.4 8 3

Bitmap Index Scan on di_dyn_data__link (cost=0.00..5.32 rows=99 width=0) (actual time=0.020..0.020 rows=8 loops=3)

  • Index Cond: ((link)::text = concat('LMA', act.pkey))
28. 0.048 0.048 ↑ 7.5 91 3

Bitmap Index Scan on idx_di_dyn_data_polvid (cost=0.00..13.69 rows=683 width=0) (actual time=0.016..0.016 rows=91 loops=3)

  • Index Cond: (polvid = lm.polvid)
Planning time : 100.146 ms
Execution time : 1,844.436 ms