explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WJ4X : Optimization for: plan #LVfZ

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 20.086 29,286.922 ↑ 1.0 10,000 1

Limit (cost=0.86..82,246,759.41 rows=10,000 width=635) (actual time=0.526..29,286.922 rows=10,000 loops=1)

2. 23.033 29,266.836 ↑ 5.3 10,000 1

Append (cost=0.86..437,149,747.22 rows=53,151 width=635) (actual time=0.523..29,266.836 rows=10,000 loops=1)

3. 354.559 29,243.803 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.86..431,108,102.72 rows=52,417 width=469) (actual time=0.521..29,243.803 rows=10,000 loops=1)

4. 74.825 2,219.244 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.86..49,070.92 rows=52,417 width=449) (actual time=0.248..2,219.244 rows=10,000 loops=1)

  • Join Filter: (empresas_sucursales.type = empresas_sucursales_types.id)
5. 91.320 2,124.419 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.86..48,283.63 rows=52,417 width=442) (actual time=0.234..2,124.419 rows=10,000 loops=1)

6. 79.219 1,813.099 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.86..46,812.16 rows=52,417 width=388) (actual time=0.161..1,813.099 rows=10,000 loops=1)

7. 61.894 1,593.880 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.72..38,157.36 rows=52,417 width=377) (actual time=0.150..1,593.880 rows=10,000 loops=1)

8. 67.448 1,381.986 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.58..29,097.42 rows=52,417 width=341) (actual time=0.131..1,381.986 rows=10,000 loops=1)

9. 107.533 1,224.538 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.58..27,645.92 rows=52,417 width=327) (actual time=0.097..1,224.538 rows=10,000 loops=1)

10. 73.955 797.005 ↑ 5.2 10,000 1

Nested Loop (cost=0.58..26,194.41 rows=52,417 width=312) (actual time=0.059..797.005 rows=10,000 loops=1)

11. 353.050 353.050 ↑ 5.2 10,000 1

Index Scan Backward using empresas_sucursales_nro_patronal_key on empresas_sucursales (cost=0.29..5,658.86 rows=52,420 width=239) (actual time=0.020..353.050 rows=10,000 loops=1)

  • Filter: (type = 1)
  • Rows Removed by Filter: 3019
12. 370.000 370.000 ↑ 1.0 1 10,000

Index Scan using empresas_pk on empresas emp (cost=0.29..0.38 rows=1 width=81) (actual time=0.035..0.037 rows=1 loops=10,000)

  • Index Cond: (id = empresas_sucursales.empresa_id)
  • Filter: (((document)::text <> '0'::text) AND ((document)::text <> ''::text) AND ((document)::text <> '-'::text))
13. 320.000 320.000 ↑ 1.0 1 10,000

Index Scan using empresas_types_id_idx on empresas_types (cost=0.00..0.02 rows=1 width=23) (actual time=0.030..0.032 rows=1 loops=10,000)

  • Index Cond: (emp.type = id)
14. 90.000 90.000 ↓ 0.0 0 10,000

Index Scan using empresas_categorias_id_categoria_empresa_idx on empresas_categorias (cost=0.00..0.02 rows=1 width=18) (actual time=0.008..0.009 rows=0 loops=10,000)

  • Index Cond: (emp.id_categoria_empresa = id_categoria_empresa)
15. 150.000 150.000 ↑ 1.0 1 10,000

Index Scan using city_id_distrito_id_idx on city (cost=0.14..0.16 rows=1 width=40) (actual time=0.014..0.015 rows=1 loops=10,000)

  • Index Cond: (empresas_sucursales.city_id = id)
16. 140.000 140.000 ↑ 1.0 1 10,000

Index Scan using distritos_pkey on distritos (cost=0.14..0.16 rows=1 width=19) (actual time=0.009..0.014 rows=1 loops=10,000)

  • Index Cond: (empresas_sucursales.distrito_id = id)
17. 220.000 220.000 ↑ 1.0 1 10,000

Index Scan using actividad_econ_id_activ_econ_idx on actividad_econ (cost=0.00..0.02 rows=1 width=58) (actual time=0.019..0.022 rows=1 loops=10,000)

  • Index Cond: (empresas_sucursales.id_activ_econ = id_activ_econ)
18. 19.993 20.000 ↑ 1.0 1 10,000

Materialize (cost=0.00..1.04 rows=1 width=23) (actual time=0.001..0.002 rows=1 loops=10,000)

19. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on empresas_sucursales_types (cost=0.00..1.04 rows=1 width=23) (actual time=0.005..0.007 rows=1 loops=1)

  • Filter: (id = 1)
  • Rows Removed by Filter: 2
20. 150.000 150.000 ↑ 1.0 1 10,000

Index Scan using empresas_tipo_inscripcion_id_tipo_inscripcion_idx on empresas_tipo_inscripcion (cost=0.00..0.02 rows=1 width=24) (actual time=0.011..0.015 rows=1 loops=10,000)

  • Index Cond: (empresas_sucursales.id_tipo_inscripcion = id_tipo_inscripcion)
21.          

SubPlan (forNested Loop Left Join)

22. 120.000 9,740.000 ↑ 1.0 1 10,000

Aggregate (cost=1,944.40..1,944.41 rows=1 width=8) (actual time=0.972..0.974 rows=1 loops=10,000)

23. 170.000 9,620.000 ↑ 20.0 3 10,000

Nested Loop (cost=0.72..1,944.25 rows=60 width=8) (actual time=0.267..0.962 rows=3 loops=10,000)

24. 170.000 170.000 ↑ 1.0 1 10,000

Index Only Scan using empresas_sucursales_nro_patronal_key on empresas_sucursales es (cost=0.29..2.31 rows=1 width=4) (actual time=0.014..0.017 rows=1 loops=10,000)

  • Index Cond: (nro_patronal = empresas_sucursales.nro_patronal)
  • Heap Fetches: 47
25. 1,475.328 9,280.000 ↑ 20.0 3 10,000

Index Scan using empleados_npatronal_idx on empleados (cost=0.43..1,941.35 rows=60 width=24) (actual time=0.244..0.928 rows=3 loops=10,000)

  • Index Cond: (npatronal = empresas_sucursales.nro_patronal)
  • Filter: (SubPlan 2)
  • Rows Removed by Filter: 2
26.          

SubPlan (forIndex Scan)

27. 181.504 7,804.672 ↑ 1.0 1 45,376

Limit (cost=14.14..14.15 rows=1 width=20) (actual time=0.171..0.172 rows=1 loops=45,376)

28. 499.136 7,623.168 ↑ 1.0 1 45,376

Sort (cost=14.14..14.15 rows=1 width=20) (actual time=0.168..0.168 rows=1 loops=45,376)

  • Sort Key: empleados_movimientos.fecha, empleados_movimientos.id
  • Sort Method: quicksort Memory: 25kB
29. 499.136 7,124.032 ↓ 2.0 2 45,376

Result (cost=0.43..14.13 rows=1 width=20) (actual time=0.109..0.157 rows=2 loops=45,376)

  • One-Time Filter: (empleados.empresa_id = emp.id)
30. 5,363.042 6,624.896 ↓ 2.0 2 45,376

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos (cost=0.43..14.13 rows=1 width=20) (actual time=0.103..0.146 rows=2 loops=45,376)

  • Index Cond: (empleado_id = empleados.id)
  • Filter: (NOT (SubPlan 1))
  • Rows Removed by Filter: 0
31.          

SubPlan (forIndex Scan)

32. 1,261.854 1,261.854 ↓ 0.0 0 70,103

Index Scan using multas_id_registro_multado_idx on multas (cost=0.00..4.02 rows=1 width=8) (actual time=0.018..0.018 rows=0 loops=70,103)

  • Index Cond: (id_registro_multado = empleados_movimientos.id)
  • Filter: ((estado IS NULL) AND (idtipo_multa = 11))
  • Rows Removed by Filter: 0
33. 120.000 4,220.000 ↑ 1.0 1 10,000

Aggregate (cost=2,087.77..2,087.80 rows=1 width=16) (actual time=0.421..0.422 rows=1 loops=10,000)

34. 715.708 4,100.000 ↑ 24.7 3 10,000

Index Only Scan using empleados_empresa_id_id_idx on empleados emplea (cost=0.43..2,086.29 rows=74 width=16) (actual time=0.112..0.410 rows=3 loops=10,000)

  • Index Cond: (empresa_id = emp.id)
  • Filter: (SubPlan 5)
  • Rows Removed by Filter: 2
  • Heap Fetches: 66
35.          

SubPlan (forIndex Only Scan)

36. 199.076 3,384.292 ↑ 1.0 1 49,769

Limit (cost=14.14..14.14 rows=1 width=20) (actual time=0.068..0.068 rows=1 loops=49,769)

37. 547.459 3,185.216 ↑ 1.0 1 49,769

Sort (cost=14.14..14.14 rows=1 width=20) (actual time=0.064..0.064 rows=1 loops=49,769)

  • Sort Key: empleados_movimientos_1.fecha, empleados_movimientos_1.id
  • Sort Method: quicksort Memory: 25kB
38. 1,643.075 2,637.757 ↓ 2.0 2 49,769

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_1 (cost=0.43..14.13 rows=1 width=20) (actual time=0.040..0.053 rows=2 loops=49,769)

  • Index Cond: (empleado_id = emplea.id)
  • Filter: (NOT (SubPlan 4))
  • Rows Removed by Filter: 0
39.          

SubPlan (forIndex Scan)

40. 994.682 994.682 ↓ 0.0 0 76,514

Index Scan using multas_id_registro_multado_idx on multas multas_1 (cost=0.00..4.02 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=76,514)

  • Index Cond: (id_registro_multado = empleados_movimientos_1.id)
  • Filter: ((estado IS NULL) AND (idtipo_multa = 11))
  • Rows Removed by Filter: 0
41. 110.000 6,630.000 ↑ 1.0 1 10,000

Aggregate (cost=2,091.94..2,091.95 rows=1 width=8) (actual time=0.661..0.663 rows=1 loops=10,000)

42. 110.000 6,520.000 ↑ 15.5 2 10,000

Nested Loop (cost=1.15..2,091.86 rows=31 width=8) (actual time=0.222..0.652 rows=2 loops=10,000)

43. 130.000 130.000 ↑ 1.0 1 10,000

Index Only Scan using empresas_sucursales_nro_patronal_key on empresas_sucursales es_1 (cost=0.29..2.31 rows=1 width=4) (actual time=0.012..0.013 rows=1 loops=10,000)

  • Index Cond: (nro_patronal = empresas_sucursales.nro_patronal)
  • Heap Fetches: 47
44. 217.602 6,280.000 ↑ 15.5 2 10,000

Nested Loop (cost=0.86..2,089.25 rows=31 width=16) (actual time=0.202..0.628 rows=2 loops=10,000)

45. 669.168 4,390.000 ↑ 20.0 3 10,000

Index Scan using empleados_npatronal_idx on empleados empleados_1 (cost=0.43..1,941.35 rows=60 width=24) (actual time=0.121..0.439 rows=3 loops=10,000)

  • Index Cond: (npatronal = empresas_sucursales.nro_patronal)
  • Filter: (SubPlan 8)
  • Rows Removed by Filter: 2
46.          

SubPlan (forIndex Scan)

47. 181.504 3,720.832 ↑ 1.0 1 45,376

Limit (cost=14.14..14.15 rows=1 width=20) (actual time=0.082..0.082 rows=1 loops=45,376)

48. 635.264 3,539.328 ↑ 1.0 1 45,376

Sort (cost=14.14..14.15 rows=1 width=20) (actual time=0.078..0.078 rows=1 loops=45,376)

  • Sort Key: empleados_movimientos_2.fecha, empleados_movimientos_2.id
  • Sort Method: quicksort Memory: 25kB
49. 363.008 2,904.064 ↓ 2.0 2 45,376

Result (cost=0.43..14.13 rows=1 width=20) (actual time=0.044..0.064 rows=2 loops=45,376)

  • One-Time Filter: (empleados_1.empresa_id = emp.id)
50. 1,559.614 2,541.056 ↓ 2.0 2 45,376

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_2 (cost=0.43..14.13 rows=1 width=20) (actual time=0.040..0.056 rows=2 loops=45,376)

  • Index Cond: (empleado_id = empleados_1.id)
  • Filter: (NOT (SubPlan 7))
  • Rows Removed by Filter: 0
51.          

SubPlan (forIndex Scan)

52. 981.442 981.442 ↓ 0.0 0 70,103

Index Scan using multas_id_registro_multado_idx on multas multas_2 (cost=0.00..4.02 rows=1 width=8) (actual time=0.014..0.014 rows=0 loops=70,103)

  • Index Cond: (id_registro_multado = empleados_movimientos_2.id)
  • Filter: ((estado IS NULL) AND (idtipo_multa = 11))
  • Rows Removed by Filter: 0
53. 1,672.398 1,672.398 ↑ 1.0 1 26,546

Index Only Scan using persons_id_sexo_idx on persons (cost=0.43..2.46 rows=1 width=8) (actual time=0.062..0.063 rows=1 loops=26,546)

  • Index Cond: ((id = empleados_1.persona_id) AND (sexo = 'M'::text))
  • Heap Fetches: 216
54. 90.000 5,130.000 ↑ 1.0 1 10,000

Aggregate (cost=2,091.92..2,091.93 rows=1 width=8) (actual time=0.512..0.513 rows=1 loops=10,000)

55. 90.000 5,040.000 ↑ 29.0 1 10,000

Nested Loop (cost=1.15..2,091.84 rows=29 width=8) (actual time=0.261..0.504 rows=1 loops=10,000)

56. 140.000 140.000 ↑ 1.0 1 10,000

Index Only Scan using empresas_sucursales_nro_patronal_key on empresas_sucursales es_2 (cost=0.29..2.31 rows=1 width=4) (actual time=0.012..0.014 rows=1 loops=10,000)

  • Index Cond: (nro_patronal = empresas_sucursales.nro_patronal)
  • Heap Fetches: 47
57. 165.988 4,810.000 ↑ 29.0 1 10,000

Nested Loop (cost=0.86..2,089.25 rows=29 width=16) (actual time=0.240..0.481 rows=1 loops=10,000)

58. 566.048 4,060.000 ↑ 20.0 3 10,000

Index Scan using empleados_npatronal_idx on empleados empleados_2 (cost=0.43..1,941.35 rows=60 width=24) (actual time=0.116..0.406 rows=3 loops=10,000)

  • Index Cond: (npatronal = empresas_sucursales.nro_patronal)
  • Filter: (SubPlan 11)
  • Rows Removed by Filter: 2
59.          

SubPlan (forIndex Scan)

60. 181.504 3,493.952 ↑ 1.0 1 45,376

Limit (cost=14.14..14.15 rows=1 width=20) (actual time=0.076..0.077 rows=1 loops=45,376)

61. 589.888 3,312.448 ↑ 1.0 1 45,376

Sort (cost=14.14..14.15 rows=1 width=20) (actual time=0.073..0.073 rows=1 loops=45,376)

  • Sort Key: empleados_movimientos_3.fecha, empleados_movimientos_3.id
  • Sort Method: quicksort Memory: 25kB
62. 408.384 2,722.560 ↓ 2.0 2 45,376

Result (cost=0.43..14.13 rows=1 width=20) (actual time=0.043..0.060 rows=2 loops=45,376)

  • One-Time Filter: (empleados_2.empresa_id = emp.id)
63. 1,472.940 2,314.176 ↓ 2.0 2 45,376

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_3 (cost=0.43..14.13 rows=1 width=20) (actual time=0.038..0.051 rows=2 loops=45,376)

  • Index Cond: (empleado_id = empleados_2.id)
  • Filter: (NOT (SubPlan 10))
  • Rows Removed by Filter: 0
64.          

SubPlan (forIndex Scan)

65. 841.236 841.236 ↓ 0.0 0 70,103

Index Scan using multas_id_registro_multado_idx on multas multas_3 (cost=0.00..4.02 rows=1 width=8) (actual time=0.012..0.012 rows=0 loops=70,103)

  • Index Cond: (id_registro_multado = empleados_movimientos_3.id)
  • Filter: ((estado IS NULL) AND (idtipo_multa = 11))
  • Rows Removed by Filter: 0
66. 584.012 584.012 ↓ 0.0 0 26,546

Index Only Scan using persons_id_sexo_idx on persons persons_1 (cost=0.43..2.46 rows=1 width=8) (actual time=0.022..0.022 rows=0 loops=26,546)

  • Index Cond: ((id = empleados_2.persona_id) AND (sexo = 'F'::text))
  • Heap Fetches: 96
67. 50.000 800.000 ↑ 1.0 1 10,000

Limit (cost=7.53..7.53 rows=1 width=27) (actual time=0.079..0.080 rows=1 loops=10,000)

68. 140.000 750.000 ↑ 2.0 1 10,000

Sort (cost=7.53..7.53 rows=2 width=27) (actual time=0.075..0.075 rows=1 loops=10,000)

  • Sort Key: cambio_situacion_empresa.fecha_creacion, cambio_situacion_empresa.id_cambio_situacion_empresa
  • Sort Method: quicksort Memory: 25kB
69. 99.978 610.000 ↑ 2.0 1 10,000

Hash Join (cost=1.57..7.52 rows=2 width=27) (actual time=0.055..0.061 rows=1 loops=10,000)

  • Hash Cond: (cambio_situacion_empresa.situacion_act = situacion_emp.id_situacion)
70. 510.000 510.000 ↑ 2.0 1 10,000

Index Scan using cambio_situacion_empresa_nro_patronal_fecha_creacion_id_cam_idx on cambio_situacion_empresa (cost=0.42..6.33 rows=2 width=20) (actual time=0.048..0.051 rows=1 loops=10,000)

  • Index Cond: (nro_patronal = empresas_sucursales.nro_patronal)
71. 0.012 0.022 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=15) (actual time=0.022..0.022 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
72. 0.010 0.010 ↑ 1.0 7 1

Seq Scan on situacion_emp (cost=0.00..1.07 rows=7 width=15) (actual time=0.004..0.010 rows=7 loops=1)

73. 0.000 0.000 ↓ 0.0 0

Sort (cost=6,041,111.15..6,041,112.99 rows=734 width=471) (never executed)

  • Sort Key: empresas_sucursales_1.nro_patronal
74. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=14.41..6,041,076.22 rows=734 width=471) (never executed)

75. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=14.41..4,907.68 rows=734 width=451) (never executed)

76. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=14.41..4,877.50 rows=734 width=444) (never executed)

77. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=14.41..4,827.31 rows=734 width=390) (never executed)

  • Hash Cond: (empresas_sucursales_1.distrito_id = distritos_1.id)
78. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=13.00..4,815.81 rows=734 width=379) (never executed)

  • Hash Cond: (empresas_sucursales_1.city_id = city_1.id)
79. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.29..4,793.04 rows=734 width=343) (never executed)

80. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.29..4,772.71 rows=734 width=329) (never executed)

81. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.29..4,752.39 rows=734 width=314) (never executed)

82. 0.000 0.000 ↓ 0.0 0

Seq Scan on empresas_sucursales empresas_sucursales_1 (cost=0.00..3,036.00 rows=734 width=302) (never executed)

  • Filter: ((type <> 1) AND (type <> 1))
83. 0.000 0.000 ↓ 0.0 0

Index Scan using empresas_pk on empresas emp_1 (cost=0.29..2.33 rows=1 width=20) (never executed)

  • Index Cond: (id = empresas_sucursales_1.empresa_id)
  • Filter: (((document)::text <> '0'::text) AND ((document)::text <> ''::text) AND ((document)::text <> '-'::text))
84. 0.000 0.000 ↓ 0.0 0

Index Scan using empresas_types_id_idx on empresas_types empresas_types_1 (cost=0.00..0.02 rows=1 width=23) (never executed)

  • Index Cond: (emp_1.type = id)
85. 0.000 0.000 ↓ 0.0 0

Index Scan using empresas_categorias_id_categoria_empresa_idx on empresas_categorias empresas_categorias_1 (cost=0.00..0.02 rows=1 width=18) (never executed)

  • Index Cond: (emp_1.id_categoria_empresa = id_categoria_empresa)
86. 0.000 0.000 ↓ 0.0 0

Hash (cost=9.54..9.54 rows=254 width=40) (never executed)

87. 0.000 0.000 ↓ 0.0 0

Seq Scan on city city_1 (cost=0.00..9.54 rows=254 width=40) (never executed)

88. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.18..1.18 rows=18 width=19) (never executed)

89. 0.000 0.000 ↓ 0.0 0

Seq Scan on distritos distritos_1 (cost=0.00..1.18 rows=18 width=19) (never executed)

90. 0.000 0.000 ↓ 0.0 0

Index Scan using actividad_econ_id_activ_econ_idx on actividad_econ actividad_econ_1 (cost=0.00..0.06 rows=1 width=58) (never executed)

  • Index Cond: (empresas_sucursales_1.id_activ_econ = id_activ_econ)
91. 0.000 0.000 ↓ 0.0 0

Index Scan using empresas_sucursales_types_id_idx on empresas_sucursales_types empresas_sucursales_types_1 (cost=0.00..0.03 rows=1 width=23) (never executed)

  • Index Cond: (empresas_sucursales_1.type = id)
92. 0.000 0.000 ↓ 0.0 0

Index Scan using empresas_tipo_inscripcion_id_tipo_inscripcion_idx on empresas_tipo_inscripcion empresas_tipo_inscripcion_1 (cost=0.00..0.03 rows=1 width=24) (never executed)

  • Index Cond: (empresas_sucursales_1.id_tipo_inscripcion = id_tipo_inscripcion)
93.          

SubPlan (forNested Loop Left Join)

94. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1,944.40..1,944.41 rows=1 width=8) (never executed)

95. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.72..1,944.25 rows=60 width=8) (never executed)

96. 0.000 0.000 ↓ 0.0 0

Index Only Scan using empresas_sucursales_nro_patronal_key on empresas_sucursales es_3 (cost=0.29..2.31 rows=1 width=4) (never executed)

  • Index Cond: (nro_patronal = empresas_sucursales_1.nro_patronal)
  • Heap Fetches: 0
97. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_npatronal_idx on empleados empleados_3 (cost=0.43..1,941.35 rows=60 width=24) (never executed)

  • Index Cond: (npatronal = empresas_sucursales_1.nro_patronal)
  • Filter: (SubPlan 15)
98.          

SubPlan (forIndex Scan)

99. 0.000 0.000 ↓ 0.0 0

Limit (cost=14.14..14.15 rows=1 width=20) (never executed)

100. 0.000 0.000 ↓ 0.0 0

Sort (cost=14.14..14.15 rows=1 width=20) (never executed)

  • Sort Key: empleados_movimientos_4.fecha, empleados_movimientos_4.id
101. 0.000 0.000 ↓ 0.0 0

Result (cost=0.43..14.13 rows=1 width=20) (never executed)

  • One-Time Filter: (empleados_3.empresa_id = emp_1.id)
102. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_4 (cost=0.43..14.13 rows=1 width=20) (never executed)

  • Index Cond: (empleado_id = empleados_3.id)
  • Filter: (NOT (SubPlan 14))
103.          

SubPlan (forIndex Scan)

104. 0.000 0.000 ↓ 0.0 0

Index Scan using multas_id_registro_multado_idx on multas multas_4 (cost=0.00..4.02 rows=1 width=8) (never executed)

  • Index Cond: (id_registro_multado = empleados_movimientos_4.id)
  • Filter: ((estado IS NULL) AND (idtipo_multa = 11))
105. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2,087.77..2,087.80 rows=1 width=16) (never executed)

106. 0.000 0.000 ↓ 0.0 0

Index Only Scan using empleados_empresa_id_id_idx on empleados emplea_1 (cost=0.43..2,086.29 rows=74 width=16) (never executed)

  • Index Cond: (empresa_id = emp_1.id)
  • Filter: (SubPlan 18)
  • Heap Fetches: 0
107.          

SubPlan (forIndex Only Scan)

108. 0.000 0.000 ↓ 0.0 0

Limit (cost=14.14..14.14 rows=1 width=20) (never executed)

109. 0.000 0.000 ↓ 0.0 0

Sort (cost=14.14..14.14 rows=1 width=20) (never executed)

  • Sort Key: empleados_movimientos_5.fecha, empleados_movimientos_5.id
110. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_5 (cost=0.43..14.13 rows=1 width=20) (never executed)

  • Index Cond: (empleado_id = emplea_1.id)
  • Filter: (NOT (SubPlan 17))
111.          

SubPlan (forIndex Scan)

112. 0.000 0.000 ↓ 0.0 0

Index Scan using multas_id_registro_multado_idx on multas multas_5 (cost=0.00..4.02 rows=1 width=8) (never executed)

  • Index Cond: (id_registro_multado = empleados_movimientos_5.id)
  • Filter: ((estado IS NULL) AND (idtipo_multa = 11))
113. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2,091.94..2,091.95 rows=1 width=8) (never executed)

114. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.15..2,091.86 rows=31 width=8) (never executed)

115. 0.000 0.000 ↓ 0.0 0

Index Only Scan using empresas_sucursales_nro_patronal_key on empresas_sucursales es_4 (cost=0.29..2.31 rows=1 width=4) (never executed)

  • Index Cond: (nro_patronal = empresas_sucursales_1.nro_patronal)
  • Heap Fetches: 0
116. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..2,089.25 rows=31 width=16) (never executed)

117. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_npatronal_idx on empleados empleados_4 (cost=0.43..1,941.35 rows=60 width=24) (never executed)

  • Index Cond: (npatronal = empresas_sucursales_1.nro_patronal)
  • Filter: (SubPlan 21)
118.          

SubPlan (forIndex Scan)

119. 0.000 0.000 ↓ 0.0 0

Limit (cost=14.14..14.15 rows=1 width=20) (never executed)

120. 0.000 0.000 ↓ 0.0 0

Sort (cost=14.14..14.15 rows=1 width=20) (never executed)

  • Sort Key: empleados_movimientos_6.fecha, empleados_movimientos_6.id
121. 0.000 0.000 ↓ 0.0 0

Result (cost=0.43..14.13 rows=1 width=20) (never executed)

  • One-Time Filter: (empleados_4.empresa_id = emp_1.id)
122. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_6 (cost=0.43..14.13 rows=1 width=20) (never executed)

  • Index Cond: (empleado_id = empleados_4.id)
  • Filter: (NOT (SubPlan 20))
123.          

SubPlan (forIndex Scan)

124. 0.000 0.000 ↓ 0.0 0

Index Scan using multas_id_registro_multado_idx on multas multas_6 (cost=0.00..4.02 rows=1 width=8) (never executed)

  • Index Cond: (id_registro_multado = empleados_movimientos_6.id)
  • Filter: ((estado IS NULL) AND (idtipo_multa = 11))
125. 0.000 0.000 ↓ 0.0 0

Index Only Scan using persons_id_sexo_idx on persons persons_2 (cost=0.43..2.46 rows=1 width=8) (never executed)

  • Index Cond: ((id = empleados_4.persona_id) AND (sexo = 'M'::text))
  • Heap Fetches: 0
126. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2,091.92..2,091.93 rows=1 width=8) (never executed)

127. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.15..2,091.84 rows=29 width=8) (never executed)

128. 0.000 0.000 ↓ 0.0 0

Index Only Scan using empresas_sucursales_nro_patronal_key on empresas_sucursales es_5 (cost=0.29..2.31 rows=1 width=4) (never executed)

  • Index Cond: (nro_patronal = empresas_sucursales_1.nro_patronal)
  • Heap Fetches: 0
129. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..2,089.25 rows=29 width=16) (never executed)

130. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_npatronal_idx on empleados empleados_5 (cost=0.43..1,941.35 rows=60 width=24) (never executed)

  • Index Cond: (npatronal = empresas_sucursales_1.nro_patronal)
  • Filter: (SubPlan 24)
131.          

SubPlan (forIndex Scan)

132. 0.000 0.000 ↓ 0.0 0

Limit (cost=14.14..14.15 rows=1 width=20) (never executed)

133. 0.000 0.000 ↓ 0.0 0

Sort (cost=14.14..14.15 rows=1 width=20) (never executed)

  • Sort Key: empleados_movimientos_7.fecha, empleados_movimientos_7.id
134. 0.000 0.000 ↓ 0.0 0

Result (cost=0.43..14.13 rows=1 width=20) (never executed)

  • One-Time Filter: (empleados_5.empresa_id = emp_1.id)
135. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_7 (cost=0.43..14.13 rows=1 width=20) (never executed)

  • Index Cond: (empleado_id = empleados_5.id)
  • Filter: (NOT (SubPlan 23))
136.          

SubPlan (forIndex Scan)

137. 0.000 0.000 ↓ 0.0 0

Index Scan using multas_id_registro_multado_idx on multas multas_7 (cost=0.00..4.02 rows=1 width=8) (never executed)

  • Index Cond: (id_registro_multado = empleados_movimientos_7.id)
  • Filter: ((estado IS NULL) AND (idtipo_multa = 11))
138. 0.000 0.000 ↓ 0.0 0

Index Only Scan using persons_id_sexo_idx on persons persons_3 (cost=0.43..2.46 rows=1 width=8) (never executed)

  • Index Cond: ((id = empleados_5.persona_id) AND (sexo = 'F'::text))
  • Heap Fetches: 0
139. 0.000 0.000 ↓ 0.0 0

Limit (cost=7.53..7.53 rows=1 width=27) (never executed)

140. 0.000 0.000 ↓ 0.0 0

Sort (cost=7.53..7.53 rows=2 width=27) (never executed)

  • Sort Key: cambio_situacion_empresa_1.fecha_creacion, cambio_situacion_empresa_1.id_cambio_situacion_empresa
141. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1.57..7.52 rows=2 width=27) (never executed)

  • Hash Cond: (cambio_situacion_empresa_1.situacion_act = situacion_emp_1.id_situacion)
142. 0.000 0.000 ↓ 0.0 0

Index Scan using cambio_situacion_empresa_nro_patronal_fecha_creacion_id_cam_idx on cambio_situacion_empresa cambio_situacion_empresa_1 (cost=0.42..6.33 rows=2 width=20) (never executed)

  • Index Cond: (nro_patronal = empresas_sucursales_1.nro_patronal)
143. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.07..1.07 rows=7 width=15) (never executed)

144. 0.000 0.000 ↓ 0.0 0

Seq Scan on situacion_emp situacion_emp_1 (cost=0.00..1.07 rows=7 width=15) (never executed)