explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RLUU

Settings
# exclusive inclusive rows x rows loops node
1. 14.796 8,589.473 ↑ 1.0 10,000 1

Limit (cost=0.86..84,240,999.10 rows=10,000 width=635) (actual time=0.462..8,589.473 rows=10,000 loops=1)

2. 14.898 8,574.677 ↑ 5.3 10,000 1

Append (cost=0.86..446,898,496.52 rows=53,050 width=635) (actual time=0.461..8,574.677 rows=10,000 loops=1)

3. 191.947 8,559.779 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.86..440,508,282.01 rows=52,292 width=469) (actual time=0.459..8,559.779 rows=10,000 loops=1)

  • Join Filter: (empresas_sucursales.id_tipo_inscripcion = empresas_tipo_inscripcion.id_tipo_inscripcion)
  • Rows Removed by Join Filter: 19998
4. 30.301 707.832 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.86..50,666.37 rows=52,292 width=449) (actual time=0.187..707.832 rows=10,000 loops=1)

  • Join Filter: (empresas_sucursales.type = empresas_sucursales_types.id)
5. 45.971 657.531 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.86..49,880.95 rows=52,292 width=442) (actual time=0.175..657.531 rows=10,000 loops=1)

6. 38.855 541.560 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.86..48,412.92 rows=52,292 width=388) (actual time=0.141..541.560 rows=10,000 loops=1)

7. 36.698 462.705 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.72..39,778.74 rows=52,292 width=377) (actual time=0.130..462.705 rows=10,000 loops=1)

8. 56.394 366.007 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.58..30,740.37 rows=52,292 width=341) (actual time=0.116..366.007 rows=10,000 loops=1)

  • Join Filter: (emp.id_categoria_empresa = empresas_categorias.id_categoria_empresa)
  • Rows Removed by Join Filter: 37366
9. 46.879 269.613 ↑ 5.2 10,000 1

Nested Loop Left Join (cost=0.58..27,601.80 rows=52,292 width=327) (actual time=0.088..269.613 rows=10,000 loops=1)

10. 45.542 162.734 ↑ 5.2 10,000 1

Nested Loop (cost=0.58..26,153.74 rows=52,292 width=312) (actual time=0.056..162.734 rows=10,000 loops=1)

11. 37.192 37.192 ↑ 5.2 10,000 1

Index Scan Backward using empresas_sucursales_nro_patronal_key on empresas_sucursales (cost=0.29..5,659.13 rows=52,295 width=239) (actual time=0.017..37.192 rows=10,000 loops=1)

  • Filter: (type = 1)
  • Rows Removed by Filter: 3018
12. 80.000 80.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.007..0.008 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. 60.000 60.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.004..0.006 rows=1 loops=10,000)

  • Index Cond: (emp.type = id)
14. 39.992 40.000 ↑ 1.0 4 10,000

Materialize (cost=0.00..1.06 rows=4 width=18) (actual time=0.001..0.004 rows=4 loops=10,000)

15. 0.008 0.008 ↑ 1.0 4 1

Seq Scan on empresas_categorias (cost=0.00..1.04 rows=4 width=18) (actual time=0.004..0.008 rows=4 loops=1)

16. 60.000 60.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.005..0.006 rows=1 loops=10,000)

  • Index Cond: (empresas_sucursales.city_id = id)
17. 40.000 40.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.003..0.004 rows=1 loops=10,000)

  • Index Cond: (empresas_sucursales.distrito_id = id)
18. 70.000 70.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.005..0.007 rows=1 loops=10,000)

  • Index Cond: (empresas_sucursales.id_activ_econ = id_activ_econ)
19. 19.995 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)

20. 0.005 0.005 ↑ 1.0 1 1

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

  • Filter: (id = 1)
  • Rows Removed by Filter: 2
21. 29.994 30.000 ↑ 1.0 3 10,000

Materialize (cost=0.00..1.04 rows=3 width=24) (actual time=0.001..0.003 rows=3 loops=10,000)

22. 0.006 0.006 ↑ 1.0 3 1

Seq Scan on empresas_tipo_inscripcion (cost=0.00..1.03 rows=3 width=24) (actual time=0.003..0.006 rows=3 loops=1)

23.          

SubPlan (forNested Loop Left Join)

24. 60.000 2,110.000 ↑ 1.0 1 10,000

Aggregate (cost=1,993.99..1,994.00 rows=1 width=8) (actual time=0.210..0.211 rows=1 loops=10,000)

25. 90.000 2,050.000 ↑ 20.3 3 10,000

Nested Loop (cost=0.72..1,993.83 rows=61 width=8) (actual time=0.062..0.205 rows=3 loops=10,000)

26. 50.000 50.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.004..0.005 rows=1 loops=10,000)

  • Index Cond: (nro_patronal = empresas_sucursales.nro_patronal)
  • Heap Fetches: 0
27. 279.812 1,910.000 ↑ 20.3 3 10,000

Index Scan using empleados_npatronal_id_idx on empleados (cost=0.43..1,990.92 rows=61 width=24) (actual time=0.054..0.191 rows=3 loops=10,000)

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

SubPlan (forIndex Scan)

29. 90.566 1,630.188 ↑ 1.0 1 45,283

Limit (cost=14.15..14.15 rows=1 width=20) (actual time=0.036..0.036 rows=1 loops=45,283)

30. 271.698 1,539.622 ↑ 1.0 1 45,283

Sort (cost=14.15..14.15 rows=1 width=20) (actual time=0.034..0.034 rows=1 loops=45,283)

  • Sort Key: empleados_movimientos.fecha, empleados_movimientos.id
  • Sort Method: quicksort Memory: 25kB
31. 226.415 1,267.924 ↓ 2.0 2 45,283

Result (cost=0.43..14.14 rows=1 width=20) (actual time=0.019..0.028 rows=2 loops=45,283)

  • One-Time Filter: (empleados.empresa_id = emp.id)
32. 761.837 1,041.509 ↓ 2.0 2 45,283

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos (cost=0.43..14.14 rows=1 width=20) (actual time=0.016..0.023 rows=2 loops=45,283)

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

SubPlan (forIndex Scan)

34. 279.672 279.672 ↓ 0.0 0 69,918

Index Scan using multas_id_registro_multado_idx on multas (cost=0.00..4.02 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=69,918)

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

Aggregate (cost=2,129.48..2,129.51 rows=1 width=16) (actual time=0.140..0.141 rows=1 loops=10,000)

36. 197.935 1,340.000 ↑ 25.0 3 10,000

Index Only Scan using empleados_empresa_id_id_idx on empleados emplea (cost=0.43..2,127.98 rows=75 width=16) (actual time=0.034..0.134 rows=3 loops=10,000)

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

SubPlan (forIndex Only Scan)

38. 99.310 1,142.065 ↑ 1.0 1 49,655

Limit (cost=14.15..14.15 rows=1 width=20) (actual time=0.023..0.023 rows=1 loops=49,655)

39. 297.930 1,042.755 ↑ 1.0 1 49,655

Sort (cost=14.15..14.15 rows=1 width=20) (actual time=0.021..0.021 rows=1 loops=49,655)

  • Sort Key: empleados_movimientos_1.fecha, empleados_movimientos_1.id
  • Sort Method: quicksort Memory: 25kB
40. 515.925 744.825 ↓ 2.0 2 49,655

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_1 (cost=0.43..14.14 rows=1 width=20) (actual time=0.011..0.015 rows=2 loops=49,655)

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

SubPlan (forIndex Scan)

42. 228.900 228.900 ↓ 0.0 0 76,300

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

  • Index Cond: (id_registro_multado = empleados_movimientos_1.id)
  • Filter: ((estado IS NULL) AND (idtipo_multa = 11))
  • Rows Removed by Filter: 0
43. 50.000 2,030.000 ↑ 1.0 1 10,000

Aggregate (cost=2,145.99..2,146.00 rows=1 width=8) (actual time=0.202..0.203 rows=1 loops=10,000)

44. 60.000 1,980.000 ↑ 16.0 2 10,000

Nested Loop (cost=1.15..2,145.91 rows=32 width=8) (actual time=0.067..0.198 rows=2 loops=10,000)

45. 40.000 40.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.003..0.004 rows=1 loops=10,000)

  • Index Cond: (nro_patronal = empresas_sucursales.nro_patronal)
  • Heap Fetches: 0
46. 118.467 1,880.000 ↑ 16.0 2 10,000

Nested Loop (cost=0.86..2,143.28 rows=32 width=16) (actual time=0.060..0.188 rows=2 loops=10,000)

47. 202.076 1,470.000 ↑ 20.3 3 10,000

Index Scan using empleados_npatronal_id_idx on empleados empleados_1 (cost=0.43..1,990.92 rows=61 width=24) (actual time=0.037..0.147 rows=3 loops=10,000)

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

SubPlan (forIndex Scan)

49. 135.849 1,267.924 ↑ 1.0 1 45,283

Limit (cost=14.15..14.15 rows=1 width=20) (actual time=0.027..0.028 rows=1 loops=45,283)

50. 271.698 1,132.075 ↑ 1.0 1 45,283

Sort (cost=14.15..14.15 rows=1 width=20) (actual time=0.025..0.025 rows=1 loops=45,283)

  • Sort Key: empleados_movimientos_2.fecha, empleados_movimientos_2.id
  • Sort Method: quicksort Memory: 25kB
51. 181.132 860.377 ↓ 2.0 2 45,283

Result (cost=0.43..14.14 rows=1 width=20) (actual time=0.013..0.019 rows=2 loops=45,283)

  • One-Time Filter: (empleados_1.empresa_id = emp.id)
52. 469.491 679.245 ↓ 2.0 2 45,283

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_2 (cost=0.43..14.14 rows=1 width=20) (actual time=0.010..0.015 rows=2 loops=45,283)

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

SubPlan (forIndex Scan)

54. 209.754 209.754 ↓ 0.0 0 69,918

Index Scan using multas_id_registro_multado_idx on multas multas_2 (cost=0.00..4.02 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=69,918)

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

Index Only Scan using persons_id_sexo_idx on persons (cost=0.43..2.49 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=26,503)

  • Index Cond: ((id = empleados_1.persona_id) AND (sexo = 'M'::text))
  • Heap Fetches: 4504
56. 40.000 1,850.000 ↑ 1.0 1 10,000

Aggregate (cost=2,145.95..2,145.96 rows=1 width=8) (actual time=0.185..0.185 rows=1 loops=10,000)

57. 50.000 1,810.000 ↑ 29.0 1 10,000

Nested Loop (cost=1.15..2,145.88 rows=29 width=8) (actual time=0.089..0.181 rows=1 loops=10,000)

58. 40.000 40.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.003..0.004 rows=1 loops=10,000)

  • Index Cond: (nro_patronal = empresas_sucursales.nro_patronal)
  • Heap Fetches: 0
59. 84.479 1,720.000 ↑ 29.0 1 10,000

Nested Loop (cost=0.86..2,143.28 rows=29 width=16) (actual time=0.082..0.172 rows=1 loops=10,000)

60. 182.076 1,450.000 ↑ 20.3 3 10,000

Index Scan using empleados_npatronal_id_idx on empleados empleados_2 (cost=0.43..1,990.92 rows=61 width=24) (actual time=0.037..0.145 rows=3 loops=10,000)

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

SubPlan (forIndex Scan)

62. 135.849 1,267.924 ↑ 1.0 1 45,283

Limit (cost=14.15..14.15 rows=1 width=20) (actual time=0.027..0.028 rows=1 loops=45,283)

63. 226.415 1,132.075 ↑ 1.0 1 45,283

Sort (cost=14.15..14.15 rows=1 width=20) (actual time=0.025..0.025 rows=1 loops=45,283)

  • Sort Key: empleados_movimientos_3.fecha, empleados_movimientos_3.id
  • Sort Method: quicksort Memory: 25kB
64. 226.415 905.660 ↓ 2.0 2 45,283

Result (cost=0.43..14.14 rows=1 width=20) (actual time=0.013..0.020 rows=2 loops=45,283)

  • One-Time Filter: (empleados_2.empresa_id = emp.id)
65. 469.491 679.245 ↓ 2.0 2 45,283

Index Scan using empleados_movimientos_empleado_id_tipo_idx on empleados_movimientos empleados_movimientos_3 (cost=0.43..14.14 rows=1 width=20) (actual time=0.010..0.015 rows=2 loops=45,283)

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

SubPlan (forIndex Scan)

67. 209.754 209.754 ↓ 0.0 0 69,918

Index Scan using multas_id_registro_multado_idx on multas multas_3 (cost=0.00..4.02 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=69,918)

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

Index Only Scan using persons_id_sexo_idx on persons persons_1 (cost=0.43..2.49 rows=1 width=8) (actual time=0.006..0.007 rows=0 loops=26,503)

  • Index Cond: ((id = empleados_2.persona_id) AND (sexo = 'F'::text))
  • Heap Fetches: 2272
69. 30.000 230.000 ↑ 1.0 1 10,000

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

70. 60.000 200.000 ↑ 2.0 1 10,000

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

  • Sort Key: cambio_situacion_empresa.fecha_creacion, cambio_situacion_empresa.id_cambio_situacion_empresa
  • Sort Method: quicksort Memory: 25kB
71. 49.980 140.000 ↑ 2.0 1 10,000

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

  • Hash Cond: (cambio_situacion_empresa.situacion_act = situacion_emp.id_situacion)
72. 90.000 90.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.007..0.009 rows=1 loops=10,000)

  • Index Cond: (nro_patronal = empresas_sucursales.nro_patronal)
73. 0.010 0.020 ↑ 1.0 7 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
74. 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.005..0.010 rows=7 loops=1)

75. 0.000 0.000 ↓ 0.0 0

Sort (cost=6,389,682.11..6,389,684.01 rows=758 width=471) (never executed)

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

Nested Loop Left Join (cost=14.41..6,389,645.86 rows=758 width=471) (never executed)

  • Join Filter: (empresas_sucursales_1.id_tipo_inscripcion = empresas_tipo_inscripcion_1.id_tipo_inscripcion)
77. 0.000 0.000 ↓ 0.0 0

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

  • Join Filter: (empresas_sucursales_1.type = empresas_sucursales_types_1.id)
78. 0.000 0.000 ↓ 0.0 0

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

79. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

  • Join Filter: (emp_1.id_categoria_empresa = empresas_categorias_1.id_categoria_empresa)
82. 0.000 0.000 ↓ 0.0 0

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

83. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.29..4,791.96 rows=758 width=314) (never executed)

84. 0.000 0.000 ↓ 0.0 0

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

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

Index Scan using empresas_pk on empresas emp_1 (cost=0.29..2.31 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))
86. 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)
87. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.06 rows=4 width=18) (never executed)

88. 0.000 0.000 ↓ 0.0 0

Seq Scan on empresas_categorias empresas_categorias_1 (cost=0.00..1.04 rows=4 width=18) (never executed)

89. 0.000 0.000 ↓ 0.0 0

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

90. 0.000 0.000 ↓ 0.0 0

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

91. 0.000 0.000 ↓ 0.0 0

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

92. 0.000 0.000 ↓ 0.0 0

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

93. 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)
94. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.04 rows=3 width=23) (never executed)

95. 0.000 0.000 ↓ 0.0 0

Seq Scan on empresas_sucursales_types empresas_sucursales_types_1 (cost=0.00..1.03 rows=3 width=23) (never executed)

96. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.04 rows=3 width=24) (never executed)

97. 0.000 0.000 ↓ 0.0 0

Seq Scan on empresas_tipo_inscripcion empresas_tipo_inscripcion_1 (cost=0.00..1.03 rows=3 width=24) (never executed)

98.          

SubPlan (forNested Loop Left Join)

99. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1,993.99..1,994.00 rows=1 width=8) (never executed)

100. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.72..1,993.83 rows=61 width=8) (never executed)

101. 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
102. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_npatronal_id_idx on empleados empleados_3 (cost=0.43..1,990.92 rows=61 width=24) (never executed)

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

SubPlan (forIndex Scan)

104. 0.000 0.000 ↓ 0.0 0

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

105. 0.000 0.000 ↓ 0.0 0

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

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

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

  • One-Time Filter: (empleados_3.empresa_id = emp_1.id)
107. 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.14 rows=1 width=20) (never executed)

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

SubPlan (forIndex Scan)

109. 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))
110. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2,129.48..2,129.51 rows=1 width=16) (never executed)

111. 0.000 0.000 ↓ 0.0 0

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

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

SubPlan (forIndex Only Scan)

113. 0.000 0.000 ↓ 0.0 0

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

114. 0.000 0.000 ↓ 0.0 0

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

  • Sort Key: empleados_movimientos_5.fecha, empleados_movimientos_5.id
115. 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.14 rows=1 width=20) (never executed)

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

SubPlan (forIndex Scan)

117. 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))
118. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2,145.99..2,146.00 rows=1 width=8) (never executed)

119. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.15..2,145.91 rows=32 width=8) (never executed)

120. 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
121. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..2,143.28 rows=32 width=16) (never executed)

122. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_npatronal_id_idx on empleados empleados_4 (cost=0.43..1,990.92 rows=61 width=24) (never executed)

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

SubPlan (forIndex Scan)

124. 0.000 0.000 ↓ 0.0 0

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

125. 0.000 0.000 ↓ 0.0 0

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

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

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

  • One-Time Filter: (empleados_4.empresa_id = emp_1.id)
127. 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.14 rows=1 width=20) (never executed)

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

SubPlan (forIndex Scan)

129. 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))
130. 0.000 0.000 ↓ 0.0 0

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

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

Aggregate (cost=2,145.95..2,145.96 rows=1 width=8) (never executed)

132. 0.000 0.000 ↓ 0.0 0

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

133. 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
134. 0.000 0.000 ↓ 0.0 0

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

135. 0.000 0.000 ↓ 0.0 0

Index Scan using empleados_npatronal_id_idx on empleados empleados_5 (cost=0.43..1,990.92 rows=61 width=24) (never executed)

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

SubPlan (forIndex Scan)

137. 0.000 0.000 ↓ 0.0 0

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

138. 0.000 0.000 ↓ 0.0 0

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

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

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

  • One-Time Filter: (empleados_5.empresa_id = emp_1.id)
140. 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.14 rows=1 width=20) (never executed)

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

SubPlan (forIndex Scan)

142. 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))
143. 0.000 0.000 ↓ 0.0 0

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

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

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

145. 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
146. 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)
147. 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)
148. 0.000 0.000 ↓ 0.0 0

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

149. 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)