explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rsdl

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

Unique (cost=90,653.39..91,222.40 rows=8,754 width=116) (actual time=340.194..340.194 rows=0 loops=1)

2. 0.016 340.194 ↓ 0.0 0 1

Sort (cost=90,653.39..90,675.28 rows=8,754 width=116) (actual time=340.194..340.194 rows=0 loops=1)

  • Sort Key: s.id, s.external_sejour_id, p.external_patient_id, s.entree_prevue, s.sortie_prevue, i.id, i.date_intervention, a.id, a.ccam, a.activite, a.phase, a.m1, a.m2, a.m3, a.m4, a.anp, a.rsc, m.nom, m.adeli, m.external_medecin_id, a.dho, ti.madate, rb.heure_debut, a.enfant, a.doc
  • Sort Method: quicksort Memory: 25kB
3. 1.963 340.178 ↓ 0.0 0 1

Nested Loop Left Join (cost=28,650.00..90,080.19 rows=8,754 width=116) (actual time=340.178..340.178 rows=0 loops=1)

  • Join Filter: ((a2.activite <> a.activite) AND (a.id <> a2.id))
  • Rows Removed by Join Filter: 2,796
  • Filter: CASE WHEN (ei.absence_anesthesiste = 0) THEN CASE WHEN (a2.valider = 0) THEN false ELSE true END ELSE true END
  • Rows Removed by Filter: 1,891
4. 1.761 331.979 ↑ 10.8 1,559 1

Nested Loop Left Join (cost=28,649.58..76,989.51 rows=16,801 width=114) (actual time=242.498..331.979 rows=1,559 loops=1)

5. 0.659 325.541 ↑ 10.8 1,559 1

Hash Left Join (cost=28,649.16..67,202.84 rows=16,801 width=112) (actual time=242.475..325.541 rows=1,559 loops=1)

  • Hash Cond: (i.id = ti.intervention_id)
6. 0.669 324.877 ↑ 10.8 1,559 1

Hash Join (cost=28,621.57..67,112.24 rows=16,801 width=104) (actual time=242.445..324.877 rows=1,559 loops=1)

  • Hash Cond: (s.um_id = se.id)
7. 0.898 324.185 ↑ 10.8 1,559 1

Hash Join (cost=28,619.76..67,061.13 rows=16,801 width=108) (actual time=242.414..324.185 rows=1,559 loops=1)

  • Hash Cond: (a.medecin_id = m.id)
8. 0.919 323.116 ↑ 10.7 1,563 1

Nested Loop (cost=28,599.94..66,996.81 rows=16,801 width=90) (actual time=242.235..323.116 rows=1,563 loops=1)

9. 1.979 315.945 ↑ 11.0 1,563 1

Nested Loop (cost=28,599.52..51,161.36 rows=17,121 width=88) (actual time=242.220..315.945 rows=1,563 loops=1)

10. 36.586 296.106 ↑ 5.4 4,465 1

Hash Right Join (cost=28,599.09..35,784.03 rows=24,064 width=57) (actual time=238.233..296.106 rows=4,465 loops=1)

  • Hash Cond: (rb.intervention_id = i.id)
11. 31.568 31.568 ↓ 1.0 168,430 1

Seq Scan on resa_bloc rb (cost=0.00..4,435.01 rows=168,201 width=10) (actual time=0.013..31.568 rows=168,430 loops=1)

12. 1.944 227.952 ↑ 5.4 4,465 1

Hash (cost=28,063.29..28,063.29 rows=24,064 width=51) (actual time=227.952..227.952 rows=4,465 loops=1)

  • Buckets: 16,384 Batches: 2 Memory Usage: 326kB
13. 19.663 226.008 ↑ 5.4 4,465 1

Hash Join (cost=8,204.86..28,063.29 rows=24,064 width=51) (actual time=112.439..226.008 rows=4,465 loops=1)

  • Hash Cond: (a.intervention_id = i.id)
14. 107.110 107.110 ↑ 6.0 4,838 1

Seq Scan on acte a (cost=0.00..18,447.15 rows=29,061 width=43) (actual time=0.010..107.110 rows=4,838 loops=1)

  • Filter: ((ccam IS NOT NULL) AND ((ccam)::text <> ''::text) AND (envoye = 0) AND (valider = 1) AND (date_validation < (now() - '00:00:00'::interval)))
  • Rows Removed by Filter: 437,868
15. 45.481 99.235 ↓ 1.0 169,472 1

Hash (cost=5,275.27..5,275.27 rows=168,527 width=12) (actual time=99.235..99.235 rows=169,472 loops=1)

  • Buckets: 32,768 Batches: 8 Memory Usage: 1,187kB
16. 53.754 53.754 ↓ 1.0 169,472 1

Seq Scan on intervention i (cost=0.00..5,275.27 rows=168,527 width=12) (actual time=0.008..53.754 rows=169,472 loops=1)

17. 17.860 17.860 ↓ 0.0 0 4,465

Index Scan using sejour_pkey on sejour s (cost=0.42..0.64 rows=1 width=35) (actual time=0.004..0.004 rows=0 loops=4,465)

  • Index Cond: (id = i.sejour_id)
  • Filter: (((external_sejour_id)::text <> ''::text) AND ((external_sejour_id)::text !~~ 'PA%'::text) AND ((external_sejour_id)::text !~~ 'MK%'::text) AND ((etat)::text <> ALL ('{PMSI,PMSIDIRECT,PMSIERREUR,DOUBLE,PAS_VENU,RECUSE}'::text[])))
  • Rows Removed by Filter: 1
18. 6.252 6.252 ↑ 1.0 1 1,563

Index Scan using patient_pkey on patient p (cost=0.42..0.92 rows=1 width=10) (actual time=0.004..0.004 rows=1 loops=1,563)

  • Index Cond: (id = s.patient_id)
  • Filter: ((external_patient_id)::text <> ''::text)
19. 0.080 0.171 ↑ 1.0 481 1

Hash (cost=13.81..13.81 rows=481 width=26) (actual time=0.171..0.171 rows=481 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
20. 0.091 0.091 ↑ 1.0 481 1

Seq Scan on medecin m (cost=0.00..13.81 rows=481 width=26) (actual time=0.007..0.091 rows=481 loops=1)

21. 0.008 0.023 ↑ 1.0 36 1

Hash (cost=1.36..1.36 rows=36 width=4) (actual time=0.023..0.023 rows=36 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
22. 0.015 0.015 ↑ 1.0 36 1

Seq Scan on service se (cost=0.00..1.36 rows=36 width=4) (actual time=0.011..0.015 rows=36 loops=1)

23. 0.000 0.005 ↓ 0.0 0 1

Hash (cost=27.50..27.50 rows=7 width=12) (actual time=0.005..0.005 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
24. 0.005 0.005 ↓ 0.0 0 1

Seq Scan on timing_intervention ti (cost=0.00..27.50 rows=7 width=12) (actual time=0.005..0.005 rows=0 loops=1)

  • Filter: (etape = 14)
25. 4.677 4.677 ↑ 1.0 1 1,559

Index Scan using execution_intervention_id_idx on execution_intervention ei (cost=0.42..0.57 rows=1 width=6) (actual time=0.003..0.003 rows=1 loops=1,559)

  • Index Cond: (intervention_id = i.id)
26. 6.236 6.236 ↑ 1.3 3 1,559

Index Scan using acte_intervention_id_idx on acte a2 (cost=0.42..0.70 rows=4 width=12) (actual time=0.003..0.004 rows=3 loops=1,559)

  • Index Cond: (intervention_id = i.id)
Planning time : 4.069 ms
Execution time : 340.429 ms