explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TR66

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

Merge Join (cost=948,200.99..4,305,052.66 rows=66,324,695 width=562) (actual rows= loops=)

  • Merge Cond: (as_gestiones.id_gestion = as_gestiones_1.id_gestion)
2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=431,492.09..468,016.66 rows=8,144 width=526) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Merge Join (cost=431,491.67..464,189.82 rows=8,144 width=521) (actual rows= loops=)

  • Merge Cond: (as_gestiones.id_gestion = tabla.id_gestion)
4. 0.000 0.000 ↓ 0.0

Unique (cost=241,826.90..254,042.89 rows=1,628,799 width=8) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Sort (cost=241,826.90..245,898.90 rows=1,628,799 width=8) (actual rows= loops=)

  • Sort Key: as_gestiones.id_gestion, as_gestiones.fk_id_telefono
6. 0.000 0.000 ↓ 0.0

Seq Scan on as_gestiones (cost=0.00..51,501.99 rows=1,628,799 width=8) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Materialize (cost=189,664.77..189,664.78 rows=1 width=513) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Sort (cost=189,664.77..189,664.78 rows=1 width=513) (actual rows= loops=)

  • Sort Key: tabla.id_gestion
9. 0.000 0.000 ↓ 0.0

Subquery Scan on tabla (cost=189,664.74..189,664.76 rows=1 width=513) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

HashAggregate (cost=189,664.74..189,664.75 rows=1 width=513) (actual rows= loops=)

  • Group Key: (regexp_replace(split_part((obligacion.numero_producto)::text, '-'::text, 1), ' '::text, ''::text, 'g'::text)), deudor.nombre_completo, deudor.num_doc_id, obligacion.columna2, (to_char((obligacion.fecha_emis (...)
11. 0.000 0.000 ↓ 0.0

HashAggregate (cost=189,664.61..189,664.65 rows=1 width=279) (actual rows= loops=)

  • Group Key: regexp_replace(split_part((obligacion.numero_producto)::text, '-'::text, 1), ' '::text, ''::text, 'g'::text), deudor.nombre_completo, deudor.num_doc_id, obligacion.columna2, to_char((obligacion.fecha_e (...)
12. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=146,724.63..189,664.53 rows=1 width=279) (actual rows= loops=)

  • Hash Cond: (deudor.id_deudor = ges_1.fk_id_deudor)
  • Join Filter: (((gestion.observacion)::text !~~ '%(TRANSFER)%'::text) AND (gestion.fk_id_campana = 64))
13. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=95,980.63..138,917.62 rows=1 width=367) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=95,980.21..138,916.54 rows=1 width=346) (actual rows= loops=)

  • Join Filter: (obligacion_1.fk_id_deudor = deudor.id_deudor)
15. 0.000 0.000 ↓ 0.0

Nested Loop (cost=69,722.09..112,028.18 rows=1 width=342) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=69,721.96..112,028.01 rows=1 width=336) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=69,721.67..112,027.67 rows=1 width=333) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Nested Loop (cost=69,721.38..112,027.32 rows=1 width=316) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=69,721.23..112,027.15 rows=1 width=305) (actual rows= loops=)

  • Join Filter: (hist.fk_id_estado_clasificacion = clasi.id_estado_clasificacion)
20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=69,719.10..112,014.24 rows=1 width=281) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Nested Loop (cost=69,718.67..112,013.74 rows=1 width=281) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Nested Loop (cost=69,718.25..112,013.14 rows=1 width=273) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=69,718.10..112,012.97 rows=1 width=250) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=69,717.82..112,012.27 rows=1 width=246) (actual rows= loops=)

  • Join Filter: (obli.id_obligacion = obligacion.id_obligacion)
25. 0.000 0.000 ↓ 0.0

Nested Loop (cost=58,002.43..100,266.40 rows=1 width=246) (actual rows= loops=)

  • Join Filter: (deudor.id_deudor = obligacion.fk_id_deudor)
26. 0.000 0.000 ↓ 0.0

Nested Loop (cost=58,002.01..100,265.70 rows=1 width=165) (actual rows= loops=)

  • Join Filter: ((max(ges.fecha_creacion)) = gestion.fecha_creacion)
27. 0.000 0.000 ↓ 0.0

Hash Join (cost=58,001.58..58,717.17 rows=22,899 width=53) (actual rows= loops=)

  • Hash Cond: (ges.fk_id_deudor = deudor.id_deudor)
28. 0.000 0.000 ↓ 0.0

Unique (cost=51,887.00..52,058.74 rows=22,899 width=12) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Sort (cost=51,887.00..51,944.25 rows=22,899 width=12) (actual rows= loops=)

  • Sort Key: ges.fk_id_deudor, (max(ges.fecha_creacion))
30. 0.000 0.000 ↓ 0.0

HashAggregate (cost=49,999.78..50,228.77 rows=22,899 width=12) (actual rows= loops=)

  • Group Key: ges.fk_id_deudor
  • -> Index Scan using fk_id_campana_index on as_gestiones ges (cost=0.43..47094.20 rows=581115 wid (...)
  • Index Cond: (fk_id_campana = 64)
  • Filter: ((observacion)::text !~~ '%(TRANSFER)%'::text)
31. 0.000 0.000 ↓ 0.0

Hash (cost=4,201.48..4,201.48 rows=153,048 width=41) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Seq Scan on as_deudor deudor (cost=0.00..4,201.48 rows=153,048 width=41) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Index Scan using idx_comp_campana_deudor_as_gest on as_gestiones gestion (cost=0.43..1.70 rows=9 width=120) (actual rows= loops=)

  • Index Cond: ((fk_id_campana = 64) AND (fk_id_deudor = deudor.id_deudor))
  • Filter: ((observacion)::text !~~ '%(TRANSFER)%'::text)
34. 0.000 0.000 ↓ 0.0

Index Scan using fk_id_deudor_obligacion_index on as_obligacion obligacion (cost=0.42..0.69 rows=1 width=93) (actual rows= loops=)

  • Index Cond: (fk_id_deudor = gestion.fk_id_deudor)
  • Filter: (fk_id_campana = 64)
35. 0.000 0.000 ↓ 0.0

HashAggregate (cost=11,715.39..11,724.77 rows=938 width=8) (actual rows= loops=)

  • Group Key: obli.id_obligacion
36. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..11,710.70 rows=938 width=8) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Seq Scan on as_actividades acti (cost=0.00..126.80 rows=5,380 width=8) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Index Only Scan using fk_id_campana_id_obli_index on as_obligacion obli (cost=0.42..2.14 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((id_obligacion = acti.fk_id_obligacion) AND (fk_id_campana = 64))
39. 0.000 0.000 ↓ 0.0

Index Scan using as_actividades_pkey on as_actividades actividades (cost=0.28..0.69 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (id_actividad = (max(acti.id_actividad)))
40. 0.000 0.000 ↓ 0.0

Index Scan using as_usuarios_pkey on as_usuarios usuario (cost=0.14..0.16 rows=1 width=31) (actual rows= loops=)

  • Index Cond: (id_usuario = gestion.fk_id_usuario_crea)
41. 0.000 0.000 ↓ 0.0

Index Scan using fk_id_gestiones_index on as_estado_contacto_deudor estcontacto (cost=0.43..0.59 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (fk_id_gestion = gestion.id_gestion)
42. 0.000 0.000 ↓ 0.0

Index Scan using as_estado_cliente_historico_fk_id_gestion_index on as_estado_cliente_historico hist (cost=0.43..0.49 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (fk_id_gestion = estcontacto.fk_id_gestion)
43. 0.000 0.000 ↓ 0.0

Hash Join (cost=2.13..12.43 rows=38 width=36) (actual rows= loops=)

  • Hash Cond: (cliente.fk_id_estado_clasificacion = clasi.id_estado_clasificacion)
44. 0.000 0.000 ↓ 0.0

Index Scan using fk_id_grupo_campana_codi_cliente_index on as_codifcacion_estado_cliente cliente (cost=0.28..10.05 rows=38 width=24) (actual rows= loops=)

  • Index Cond: (fk_id_grupo_campana = 13)
45. 0.000 0.000 ↓ 0.0

Hash (cost=1.38..1.38 rows=38 width=12) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Seq Scan on as_estado_clasificacion clasi (cost=0.00..1.38 rows=38 width=12) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Index Only Scan using fk_id_estado_fk_id_agru_camp on as_codificacion_estado_contacto contacto (cost=0.14..0.17 rows=1 width=19) (actual rows= loops=)

  • Index Cond: ((fk_id_grupo_campana = 13) AND (fk_id_estados = estcontacto.fk_id_estados))
48. 0.000 0.000 ↓ 0.0

Index Scan using fk_id_gestion_acuerdo_index on as_acuerdos acu (cost=0.29..0.33 rows=2 width=21) (actual rows= loops=)

  • Index Cond: (fk_id_gestion = gestion.id_gestion)
49. 0.000 0.000 ↓ 0.0

Index Scan using as_acuerdos_info_pkey on as_acuerdos_info info_acu (cost=0.29..0.33 rows=1 width=11) (actual rows= loops=)

  • Index Cond: (id_acuerdos_info = acu.fk_id_acuerdos_info)
50. 0.000 0.000 ↓ 0.0

Index Scan using as_canal_contacto_pkey on as_canal_contacto canal (cost=0.14..0.15 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (id_canal_contacto = gestion.fk_id_canal_contacto)
51. 0.000 0.000 ↓ 0.0

HashAggregate (cost=26,258.12..26,452.04 rows=19,392 width=8) (actual rows= loops=)

  • Group Key: obligacion_1.fk_id_deudor
52. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..26,161.16 rows=19,392 width=8) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..3,549.68 rows=21,857 width=8) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Seq Scan on as_campanas (cost=0.00..2.83 rows=1 width=4) (actual rows= loops=)

  • Filter: (id_campana = 64)
55. 0.000 0.000 ↓ 0.0

Index Scan using fk_id_cliente_correos_index on as_correos correo_1 (cost=0.42..3,229.90 rows=31,696 width=12) (actual rows= loops=)

  • Index Cond: (fk_id_cliente = as_campanas.fk_id_cliente)
56. 0.000 0.000 ↓ 0.0

Index Scan using fk_id_deudor_obligacion_index on as_obligacion obligacion_1 (cost=0.42..1.02 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (fk_id_deudor = correo_1.fk_id_deudor)
  • Filter: (fk_id_campana = 64)
57. 0.000 0.000 ↓ 0.0

Index Scan using as_correos_pkey on as_correos correo (cost=0.42..1.08 rows=1 width=29) (actual rows= loops=)

  • Index Cond: (id_correo = (max(correo_1.id_correo)))
58. 0.000 0.000 ↓ 0.0

Hash (cost=50,457.76..50,457.76 rows=22,899 width=12) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

HashAggregate (cost=49,999.78..50,228.77 rows=22,899 width=8) (actual rows= loops=)

  • Group Key: ges_1.fk_id_deudor
60. 0.000 0.000 ↓ 0.0

Index Scan using fk_id_campana_index on as_gestiones ges_1 (cost=0.43..47,094.20 rows=581,115 width=8) (actual rows= loops=)

  • Index Cond: (fk_id_campana = 64)
  • Filter: ((observacion)::text !~~ '%(TRANSFER)%'::text)
61. 0.000 0.000 ↓ 0.0

Index Scan using as_telefono_deudores_pkey on as_telefono_deudores tel (cost=0.42..0.46 rows=1 width=13) (actual rows= loops=)

  • Index Cond: (id_telefono = as_gestiones.fk_id_telefono)
62. 0.000 0.000 ↓ 0.0

Materialize (cost=516,708.90..524,852.89 rows=1,628,799 width=48) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Sort (cost=516,708.90..520,780.89 rows=1,628,799 width=48) (actual rows= loops=)

  • Sort Key: as_gestiones_1.id_gestion
64. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=247,648.52..298,548.49 rows=1,628,799 width=48) (actual rows= loops=)

  • Hash Cond: (as_gestiones_1.fk_id_direccion = dir.id_direccion)
65. 0.000 0.000 ↓ 0.0

Unique (cost=241,826.90..254,042.89 rows=1,628,799 width=8) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

Sort (cost=241,826.90..245,898.90 rows=1,628,799 width=8) (actual rows= loops=)

  • Sort Key: as_gestiones_1.id_gestion, as_gestiones_1.fk_id_direccion
67. 0.000 0.000 ↓ 0.0

Seq Scan on as_gestiones as_gestiones_1 (cost=0.00..51,501.99 rows=1,628,799 width=8) (actual rows= loops=)

68. 0.000 0.000 ↓ 0.0

Hash (cost=3,855.72..3,855.72 rows=157,272 width=48) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Seq Scan on as_dir_deudores dir (cost=0.00..3,855.72 rows=157,272 width=48) (actual rows= loops=)