explain.depesz.com

PostgreSQL's explain analyze made readable

Result: D7GM

Settings
# exclusive inclusive rows x rows loops node
1. 1.524 398.683 ↓ 2.1 356 1

Sort (cost=1,243,591.48..1,243,591.92 rows=173 width=380) (actual time=398.661..398.683 rows=356 loops=1)

  • Sort Key: (nvl((a.ep_alias)::character varying, (a.ep_nombres)::character varying)), a.ep_ape_pat
  • Sort Method: quicksort Memory: 208kB
2. 1.158 397.159 ↓ 2.1 356 1

Nested Loop Anti Join (cost=0.55..1,243,585.05 rows=173 width=380) (actual time=0.663..397.159 rows=356 loops=1)

3. 1.107 395.289 ↓ 2.0 356 1

Index Scan using ep_fun_todos_ep_usuario_idx on ep_fun_todos a (cost=0.28..1,243,407.32 rows=174 width=316) (actual time=0.636..395.289 rows=356 loops=1)

  • Index Cond: (ep_usuario IS NOT NULL)
  • Filter: (((ep_vigente)::text = 'S'::text) AND (NOT (SubPlan 2)))
  • Rows Removed by Filter: 204
4.          

SubPlan (forIndex Scan)

5. 0.000 394.182 ↓ 0.0 0 359

Unique (cost=2,220.16..2,220.17 rows=2 width=4) (actual time=1.098..1.098 rows=0 loops=359)

6. 0.718 394.182 ↓ 0.0 0 359

Sort (cost=2,220.16..2,220.16 rows=2 width=4) (actual time=1.098..1.098 rows=0 loops=359)

  • Sort Key: (1)
  • Sort Method: quicksort Memory: 25kB
7. 0.359 393.464 ↓ 0.0 0 359

Append (cost=23.05..2,220.15 rows=2 width=4) (actual time=1.096..1.096 rows=0 loops=359)

8. 0.305 387.361 ↓ 0.0 0 359

Nested Loop (cost=23.05..2,188.16 rows=1 width=4) (actual time=1.079..1.079 rows=0 loops=359)

9. 0.000 387.002 ↓ 0.0 0 359

Subquery Scan on ANY_subquery (cost=22.63..2,173.26 rows=2 width=218) (actual time=1.078..1.078 rows=0 loops=359)

10. 42.362 387.002 ↓ 0.0 0 359

HashSetOp Intersect (cost=22.63..2,173.24 rows=2 width=222) (actual time=1.078..1.078 rows=0 loops=359)

11. 33.028 344.640 ↓ 1.0 1,097 359

Append (cost=22.63..2,170.63 rows=1,045 width=222) (actual time=0.024..0.960 rows=1,097 loops=359)

12. 0.000 10.052 ↑ 2.0 1 359

Subquery Scan on *SELECT* 1 (cost=22.63..38.27 rows=2 width=13) (actual time=0.024..0.028 rows=1 loops=359)

13. 0.359 10.052 ↑ 2.0 1 359

Append (cost=22.63..38.25 rows=2 width=9) (actual time=0.024..0.028 rows=1 loops=359)

14. 0.000 8.616 ↑ 1.0 1 359

Subquery Scan on vw_casos_open_1 (cost=22.63..22.64 rows=1 width=9) (actual time=0.024..0.024 rows=1 loops=359)

15. 1.077 8.616 ↑ 1.0 1 359

Sort (cost=22.63..22.63 rows=1 width=3,847) (actual time=0.023..0.024 rows=1 loops=359)

  • Sort Key: ntf_2.not_id
  • Sort Method: quicksort Memory: 25kB
16. 0.359 7.539 ↑ 1.0 1 359

Nested Loop (cost=1.41..22.62 rows=1 width=3,847) (actual time=0.020..0.021 rows=1 loops=359)

17. 0.359 6.103 ↑ 1.0 1 359

Nested Loop (cost=0.99..15.16 rows=1 width=21) (actual time=0.016..0.017 rows=1 loops=359)

18. 0.718 3.590 ↑ 1.0 1 359

Nested Loop (cost=0.71..14.76 rows=1 width=44) (actual time=0.009..0.010 rows=1 loops=359)

19. 1.795 1.795 ↑ 1.0 1 359

Index Scan using wfa_notificacion_n3 on cwfa_notificacion ntf_2 (cost=0.43..7.45 rows=1 width=26) (actual time=0.005..0.005 rows=1 loops=359)

  • Index Cond: (((not_estado)::text = 'OPEN'::text) AND (caso_id = '895541'::numeric))
20. 1.077 1.077 ↑ 1.0 1 359

Index Scan using wfa_actividades_wf_pk on cwfa_actividades_proceso pac_2 (cost=0.28..7.29 rows=1 width=28) (actual time=0.003..0.003 rows=1 loops=359)

  • Index Cond: (actividad_id = ntf_2.actividad_id)
21. 2.154 2.154 ↑ 1.0 1 359

Index Scan using wfa_actividades_v2_pk on cwfa_actividad act_2 (cost=0.28..0.40 rows=1 width=22) (actual time=0.006..0.006 rows=1 loops=359)

  • Index Cond: (((act_nombre)::text = (pac_2.act_nombre)::text) AND ((item_type)::text = (pac_2.item_type)::text))
  • Filter: (act_version = act_ult_version)
  • Rows Removed by Filter: 1
22. 1.077 1.077 ↑ 1.0 1 359

Index Scan using caso_pk on casos ca_2 (cost=0.42..7.44 rows=1 width=6) (actual time=0.003..0.003 rows=1 loops=359)

  • Index Cond: (caso_id = '895541'::numeric)
  • Filter: (caso_fecha_termino IS NULL)
23. 0.000 1.077 ↓ 0.0 0 359

Subquery Scan on *SELECT* 2_2 (cost=1.41..15.60 rows=1 width=9) (actual time=0.003..0.003 rows=0 loops=359)

24. 0.000 1.077 ↓ 0.0 0 359

Nested Loop (cost=1.41..15.59 rows=1 width=3,861) (actual time=0.003..0.003 rows=0 loops=359)

25. 0.000 1.077 ↓ 0.0 0 359

Nested Loop (cost=1.13..15.19 rows=1 width=32) (actual time=0.003..0.003 rows=0 loops=359)

26. 0.000 1.077 ↓ 0.0 0 359

Nested Loop (cost=0.85..14.89 rows=1 width=14) (actual time=0.003..0.003 rows=0 loops=359)

27. 1.077 1.077 ↓ 0.0 0 359

Index Scan using caso_pk on casos ca_3 (cost=0.42..7.44 rows=1 width=6) (actual time=0.003..0.003 rows=0 loops=359)

  • Index Cond: (caso_id = '895541'::numeric)
  • Filter: (caso_fecha_termino IS NOT NULL)
  • Rows Removed by Filter: 1
28. 0.000 0.000 ↓ 0.0 0

Index Scan using wfa_notificaciones_pk on cwfa_notificacion ntf_3 (cost=0.43..7.45 rows=1 width=20) (never executed)

  • Index Cond: (not_id = ca_3.caso_last_nid)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using wfa_actividades_wf_pk on cwfa_actividades_proceso pac_3 (cost=0.28..0.30 rows=1 width=28) (never executed)

  • Index Cond: (actividad_id = ntf_3.actividad_id)
30. 0.000 0.000 ↓ 0.0 0

Index Scan using wfa_actividades_v2_pk on cwfa_actividad act_3 (cost=0.28..0.40 rows=1 width=22) (never executed)

  • Index Cond: (((act_nombre)::text = (pac_3.act_nombre)::text) AND ((item_type)::text = (pac_3.item_type)::text))
  • Filter: (act_version = act_ult_version)
31. 46.311 301.560 ↓ 1.1 1,096 359

Subquery Scan on *SELECT* 2_1 (cost=36.51..2,132.36 rows=1,043 width=14) (actual time=0.196..0.840 rows=1,096 loops=359)

32. 202.476 255.249 ↓ 1.1 1,096 359

Bitmap Heap Scan on cwfa_roles_usuario wf_local_user_roles2 (cost=36.51..2,121.93 rows=1,043 width=10) (actual time=0.194..0.711 rows=1,096 loops=359)

  • Recheck Cond: ((usr_codigo)::text = a.ep_usuario)
  • Heap Blocks: exact=133664
33. 52.773 52.773 ↓ 1.1 1,096 359

Bitmap Index Scan on wfa_roles_usuarios_pk (cost=0.00..36.24 rows=1,043 width=0) (actual time=0.147..0.147 rows=1,096 loops=359)

  • Index Cond: ((usr_codigo)::text = a.ep_usuario)
34. 0.054 0.054 ↑ 1.0 1 3

Index Only Scan using wfa_roles_usuarios_pk on cwfa_roles_usuario wf_local_user_roles1 (cost=0.42..7.44 rows=1 width=10) (actual time=0.018..0.018 rows=1 loops=3)

  • Index Cond: ((usr_codigo = a.ep_usuario) AND (rol_nombre = ("ANY_subquery".recipient_role)::text))
  • Heap Fetches: 3
35. 0.000 5.744 ↓ 0.0 0 359

Result (cost=30.96..31.97 rows=1 width=4) (actual time=0.016..0.016 rows=0 loops=359)

  • One-Time Filter: $8
36.          

Initplan (forResult)

37. 0.359 5.744 ↓ 0.0 0 359

Append (cost=22.63..39.28 rows=2 width=0) (actual time=0.016..0.016 rows=0 loops=359)

38. 0.000 3.590 ↓ 0.0 0 359

Subquery Scan on vw_casos_open (cost=22.63..22.64 rows=1 width=0) (actual time=0.010..0.010 rows=0 loops=359)

39. 0.718 3.590 ↓ 0.0 0 359

Sort (cost=22.63..22.63 rows=1 width=4,056) (actual time=0.010..0.010 rows=0 loops=359)

  • Sort Key: ntf.not_id
  • Sort Method: quicksort Memory: 25kB
40. 0.359 2.872 ↓ 0.0 0 359

Nested Loop (cost=1.41..22.62 rows=1 width=4,056) (actual time=0.008..0.008 rows=0 loops=359)

41. 0.000 2.513 ↓ 0.0 0 359

Nested Loop (cost=0.99..15.17 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=359)

42. 0.000 2.513 ↓ 0.0 0 359

Nested Loop (cost=0.71..14.76 rows=1 width=35) (actual time=0.007..0.007 rows=0 loops=359)

43. 2.513 2.513 ↓ 0.0 0 359

Index Scan using wfa_notificacion_n3 on cwfa_notificacion ntf (cost=0.43..7.45 rows=1 width=17) (actual time=0.007..0.007 rows=0 loops=359)

  • Index Cond: (((not_estado)::text = 'OPEN'::text) AND (caso_id = '895541'::numeric))
  • Filter: ((not_rol_receptor)::text = a.ep_usuario)
  • Rows Removed by Filter: 1
44. 0.000 0.000 ↓ 0.0 0

Index Scan using wfa_actividades_wf_pk on cwfa_actividades_proceso pac (cost=0.28..7.29 rows=1 width=28) (never executed)

  • Index Cond: (actividad_id = ntf.actividad_id)
45. 0.000 0.000 ↓ 0.0 0

Index Scan using wfa_actividades_v2_pk on cwfa_actividad act (cost=0.28..0.40 rows=1 width=22) (never executed)

  • Index Cond: (((act_nombre)::text = (pac.act_nombre)::text) AND ((item_type)::text = (pac.item_type)::text))
  • Filter: (act_version = act_ult_version)
46. 0.000 0.000 ↓ 0.0 0

Index Scan using caso_pk on casos ca (cost=0.42..7.44 rows=1 width=6) (never executed)

  • Index Cond: (caso_id = '895541'::numeric)
  • Filter: (caso_fecha_termino IS NULL)
47. 0.359 1.795 ↓ 0.0 0 359

Subquery Scan on *SELECT* 2 (cost=1.41..16.64 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=359)

48. 0.000 1.436 ↓ 0.0 0 359

Nested Loop (cost=1.41..16.63 rows=1 width=4,070) (actual time=0.004..0.004 rows=0 loops=359)

49. 0.000 1.436 ↓ 0.0 0 359

Nested Loop (cost=1.13..16.22 rows=1 width=23) (actual time=0.004..0.004 rows=0 loops=359)

50. 0.359 1.436 ↓ 0.0 0 359

Nested Loop (cost=0.85..15.04 rows=1 width=5) (actual time=0.004..0.004 rows=0 loops=359)

51. 1.077 1.077 ↓ 0.0 0 359

Index Scan using caso_pk on casos ca_1 (cost=0.42..7.44 rows=1 width=6) (actual time=0.003..0.003 rows=0 loops=359)

  • Index Cond: (caso_id = '895541'::numeric)
  • Filter: (caso_fecha_termino IS NOT NULL)
  • Rows Removed by Filter: 1
52. 0.000 0.000 ↓ 0.0 0

Index Scan using wfa_notificaciones_pk on cwfa_notificacion ntf_1 (cost=0.43..7.45 rows=1 width=11) (never executed)

  • Index Cond: (not_id = ca_1.caso_last_nid)
  • Filter: ((not_rol_receptor)::text = a.ep_usuario)
53. 0.000 0.000 ↓ 0.0 0

Index Scan using wfa_actividades_wf_pk on cwfa_actividades_proceso pac_1 (cost=0.28..1.18 rows=1 width=28) (never executed)

  • Index Cond: (actividad_id = ntf_1.actividad_id)
54. 0.000 0.000 ↓ 0.0 0

Index Scan using wfa_actividades_v2_pk on cwfa_actividad act_1 (cost=0.28..0.40 rows=1 width=22) (never executed)

  • Index Cond: (((act_nombre)::text = (pac_1.act_nombre)::text) AND ((item_type)::text = (pac_1.item_type)::text))
  • Filter: (act_version = act_ult_version)
55. 0.000 0.000 ↓ 0.0 0

Seq Scan on dual (cost=30.96..31.97 rows=1 width=4) (never executed)

56. 0.712 0.712 ↓ 0.0 0 356

Index Only Scan using wfa_usuarios_apoyo_pk on wfa_usuarios_apoyo b (cost=0.28..1.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=356)

  • Index Cond: ((caso_id = '895541'::numeric) AND (wup_user = a.ep_usuario))
  • Heap Fetches: 0