explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jx6v

Settings
# exclusive inclusive rows x rows loops node
1. 0.036 37,885.374 ↓ 5.0 5 1

WindowAgg (cost=129,403.00..203,323.53 rows=1 width=297) (actual time=37,885.366..37,885.374 rows=5 loops=1)

2. 0.009 37,885.338 ↓ 5.0 5 1

Nested Loop (cost=129,403.00..203,323.51 rows=1 width=270) (actual time=37,885.284..37,885.338 rows=5 loops=1)

3. 0.010 37,885.309 ↓ 5.0 5 1

Nested Loop (cost=129,402.72..203,322.44 rows=1 width=269) (actual time=37,885.268..37,885.309 rows=5 loops=1)

4. 0.014 37,885.284 ↓ 5.0 5 1

Nested Loop (cost=129,402.59..203,322.29 rows=1 width=250) (actual time=37,885.253..37,885.284 rows=5 loops=1)

5. 82.716 37,885.210 ↓ 5.0 5 1

Merge Join (cost=129,402.30..203,321.25 rows=1 width=202) (actual time=37,885.196..37,885.210 rows=5 loops=1)

  • Merge Cond: (evt_consumo.proceso_transaccion_id = proceso.id)
6. 479.936 2,396.933 ↓ 1.3 727,441 1

Group (cost=106,080.54..172,978.50 rows=561,678 width=84) (actual time=1,242.884..2,396.933 rows=727,441 loops=1)

  • Group Key: evt_consumo.proceso_transaccion_id, sede_efector.nombre_sede, p_efector.apellido_nombre, p_efector.cuil, prof_espe_efector.matricula, espe_efector.descripcion, p_efector.categoria
7. 0.000 1,916.997 ↓ 1.6 732,258 1

Gather Merge (cost=106,080.54..164,787.38 rows=468,064 width=84) (actual time=1,242.881..1,916.997 rows=732,258 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 497.685 4,386.255 ↓ 1.0 244,394 3

Group (cost=105,080.51..109,761.15 rows=234,032 width=84) (actual time=1,222.815..1,462.085 rows=244,394 loops=3)

  • Group Key: evt_consumo.proceso_transaccion_id, sede_efector.nombre_sede, p_efector.apellido_nombre, p_efector.cuil, prof_espe_efector.matricula, espe_efector.descripcion, p_efector.categoria
9. 1,447.194 3,888.570 ↓ 1.1 249,077 3

Sort (cost=105,080.51..105,665.59 rows=234,032 width=84) (actual time=1,222.807..1,296.190 rows=249,077 loops=3)

  • Sort Key: evt_consumo.proceso_transaccion_id, sede_efector.nombre_sede, p_efector.apellido_nombre, p_efector.cuil, prof_espe_efector.matricula, espe_efector.descripcion, p_efector.categoria
  • Sort Method: external merge Disk: 24352kB
  • Worker 0: Sort Method: external merge Disk: 22352kB
  • Worker 1: Sort Method: external merge Disk: 22608kB
10. 321.339 2,441.376 ↓ 1.1 254,973 3

Hash Join (cost=7,478.50..84,209.14 rows=234,032 width=84) (actual time=125.081..813.792 rows=254,973 loops=3)

  • Hash Cond: (prof_espe_efector.especialidad_medica_id = espe_efector.id)
11. 347.433 2,119.749 ↓ 1.1 254,973 3

Hash Join (cost=7,474.56..83,560.60 rows=234,032 width=71) (actual time=124.942..706.583 rows=254,973 loops=3)

  • Hash Cond: (prof_espe_efector.profesional_id = p_efector.id)
12. 346.812 1,762.485 ↓ 1.1 254,973 3

Hash Join (cost=7,320.72..82,791.70 rows=234,032 width=40) (actual time=121.632..587.495 rows=254,973 loops=3)

  • Hash Cond: (evt_consumo.profesional_especialidad_medica_id = prof_espe_efector.id)
13. 288.261 1,407.828 ↓ 1.1 254,973 3

Hash Join (cost=7,167.57..82,023.89 rows=234,032 width=32) (actual time=118.988..469.276 rows=254,973 loops=3)

  • Hash Cond: (evt_consumo.ips_sede_id = sede_efector.id)
14. 1,030.429 1,118.061 ↑ 1.3 254,973 3

Parallel Bitmap Heap Scan on evento_transaccion evt_consumo (cost=7,141.35..81,154.98 rows=319,455 width=12) (actual time=118.454..372.687 rows=254,973 loops=3)

  • Recheck Cond: (tipo_evento_transaccion_id = 11)
  • Filter: ((NOT es_anulado) OR (id IS NULL))
  • Rows Removed by Filter: 1982
  • Heap Blocks: exact=22991
15. 87.632 87.632 ↑ 1.0 770,866 1

Bitmap Index Scan on ix_evento_transaccion_tipo_evento_transaccion (cost=0.00..6,949.68 rows=773,498 width=0) (actual time=87.632..87.632 rows=770,866 loops=1)

  • Index Cond: (tipo_evento_transaccion_id = 11)
16. 0.642 1.506 ↑ 1.0 632 3

Hash (cost=18.32..18.32 rows=632 width=28) (actual time=0.502..0.502 rows=632 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 47kB
17. 0.864 0.864 ↑ 1.0 632 3

Seq Scan on ips_sede sede_efector (cost=0.00..18.32 rows=632 width=28) (actual time=0.037..0.288 rows=632 loops=3)

18. 3.579 7.845 ↑ 1.0 4,051 3

Hash (cost=102.51..102.51 rows=4,051 width=16) (actual time=2.614..2.615 rows=4,051 loops=3)

  • Buckets: 4096 Batches: 1 Memory Usage: 231kB
19. 4.266 4.266 ↑ 1.0 4,051 3

Seq Scan on profesional_especialidad_medica prof_espe_efector (cost=0.00..102.51 rows=4,051 width=16) (actual time=0.024..1.422 rows=4,051 loops=3)

20. 4.137 9.831 ↑ 1.0 3,682 3

Hash (cost=107.82..107.82 rows=3,682 width=39) (actual time=3.277..3.277 rows=3,682 loops=3)

  • Buckets: 4096 Batches: 1 Memory Usage: 297kB
21. 5.694 5.694 ↑ 1.0 3,682 3

Seq Scan on profesional p_efector (cost=0.00..107.82 rows=3,682 width=39) (actual time=0.020..1.898 rows=3,682 loops=3)

22. 0.111 0.288 ↑ 1.0 86 3

Hash (cost=2.86..2.86 rows=86 width=21) (actual time=0.096..0.096 rows=86 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
23. 0.177 0.177 ↑ 1.0 86 3

Seq Scan on especialidad_medica espe_efector (cost=0.00..2.86 rows=86 width=21) (actual time=0.032..0.059 rows=86 loops=3)

24. 0.030 35,405.561 ↓ 5.0 5 1

Sort (cost=23,321.76..23,321.77 rows=1 width=130) (actual time=35,405.560..35,405.561 rows=5 loops=1)

  • Sort Key: evt.proceso_transaccion_id
  • Sort Method: quicksort Memory: 26kB
25. 0.009 35,405.531 ↓ 5.0 5 1

Nested Loop (cost=47.86..23,321.75 rows=1 width=130) (actual time=18,904.246..35,405.531 rows=5 loops=1)

26. 0.015 35,405.507 ↓ 5.0 5 1

Nested Loop (cost=47.73..23,321.60 rows=1 width=134) (actual time=18,904.234..35,405.507 rows=5 loops=1)

27. 0.009 35,405.442 ↓ 5.0 5 1

Nested Loop (cost=47.31..23,320.37 rows=1 width=101) (actual time=18,904.199..35,405.442 rows=5 loops=1)

  • Join Filter: (item_consumo.evento_transaccion_item_id = item_estado.evento_transaccion_item_id)
28. 0.011 35,405.403 ↓ 5.0 5 1

Nested Loop (cost=46.88..23,319.08 rows=1 width=109) (actual time=18,904.181..35,405.403 rows=5 loops=1)

  • Join Filter: (item_consumo.evento_transaccion_item_id = item_proce.evento_transaccion_item_id)
29. 0.011 35,405.347 ↓ 5.0 5 1

Nested Loop (cost=46.45..23,317.80 rows=1 width=101) (actual time=18,904.163..35,405.347 rows=5 loops=1)

30. 1,019.511 35,405.316 ↓ 5.0 5 1

Nested Loop (cost=46.31..23,317.64 rows=1 width=105) (actual time=18,904.143..35,405.316 rows=5 loops=1)

  • Join Filter: (item.evento_transaccion_id = tk.evento_transaccion_id)
  • Rows Removed by Join Filter: 2466021
31. 872.803 34,385.805 ↓ 847.4 1,233,013 1

Hash Join (cost=46.31..23,096.61 rows=1,455 width=105) (actual time=0.621..34,385.805 rows=1,233,013 loops=1)

  • Hash Cond: (evt.ips_sede_id = sede.id)
32. 964.049 33,512.762 ↓ 659.8 1,310,339 1

Nested Loop (cost=23.18..23,068.25 rows=1,986 width=109) (actual time=0.362..33,512.762 rows=1,310,339 loops=1)

33. 601.692 25,997.018 ↓ 659.8 1,310,339 1

Nested Loop (cost=22.75..20,501.24 rows=1,986 width=101) (actual time=0.331..25,997.018 rows=1,310,339 loops=1)

34. 2,651.674 17,444.061 ↓ 621.2 1,590,253 1

Nested Loop (cost=22.33..17,232.50 rows=2,560 width=85) (actual time=0.255..17,444.061 rows=1,590,253 loops=1)

35. 745.998 5,774.643 ↓ 326.8 2,254,436 1

Nested Loop (cost=21.90..7,897.54 rows=6,898 width=64) (actual time=0.239..5,774.643 rows=2,254,436 loops=1)

36. 2.665 22.173 ↓ 206.3 1,238 1

Nested Loop (cost=3.18..37.58 rows=6 width=45) (actual time=0.192..22.173 rows=1,238 loops=1)

37. 2.621 12.165 ↓ 209.8 1,049 1

Nested Loop (cost=2.90..32.59 rows=5 width=41) (actual time=0.180..12.165 rows=1,049 loops=1)

38. 0.612 2.201 ↓ 209.8 1,049 1

Nested Loop (cost=2.62..27.50 rows=5 width=4) (actual time=0.165..2.201 rows=1,049 loops=1)

39. 0.062 0.062 ↑ 1.0 1 1

Index Scan using facturador_codigo_idx on facturador f (cost=0.28..4.29 rows=1 width=4) (actual time=0.060..0.062 rows=1 loops=1)

  • Index Cond: (codigo = 700)
40. 1.455 1.527 ↓ 69.9 1,049 1

Bitmap Heap Scan on facturador_profesional fp (cost=2.34..23.06 rows=15 width=8) (actual time=0.093..1.527 rows=1,049 loops=1)

  • Recheck Cond: (facturador_id = f.id)
  • Filter: (NOT deleted)
  • Rows Removed by Filter: 22
  • Heap Blocks: exact=45
41. 0.072 0.072 ↓ 66.9 1,071 1

Bitmap Index Scan on ix_facturador_profesional_facturador (cost=0.00..2.34 rows=16 width=0) (actual time=0.072..0.072 rows=1,071 loops=1)

  • Index Cond: (facturador_id = f.id)
42. 7.343 7.343 ↑ 1.0 1 1,049

Index Scan using pk_profesional on profesional p (cost=0.28..1.02 rows=1 width=37) (actual time=0.007..0.007 rows=1 loops=1,049)

  • Index Cond: (id = fp.profesional_id)
43. 7.343 7.343 ↑ 1.0 1 1,049

Index Scan using ix_profesional_especialidad_medica_profesional on profesional_especialidad_medica prof_espe (cost=0.28..0.99 rows=1 width=16) (actual time=0.006..0.007 rows=1 loops=1,049)

  • Index Cond: (profesional_id = fp.profesional_id)
44. 4,610.312 5,006.472 ↑ 1.6 1,821 1,238

Bitmap Heap Scan on evento_transaccion evt (cost=18.72..1,280.46 rows=2,953 width=27) (actual time=0.567..4.044 rows=1,821 loops=1,238)

  • Recheck Cond: (profesional_especialidad_medica_id = prof_espe.id)
  • Filter: ((NOT deleted) AND (NOT es_anulado))
  • Rows Removed by Filter: 33
  • Heap Blocks: exact=1538497
45. 396.160 396.160 ↑ 1.6 1,854 1,238

Bitmap Index Scan on ix_evento_transaccion_profesional_especialidad_medica (cost=0.00..17.98 rows=2,990 width=0) (actual time=0.320..0.320 rows=1,854 loops=1,238)

  • Index Cond: (profesional_especialidad_medica_id = prof_espe.id)
46. 9,017.744 9,017.744 ↑ 3.0 1 2,254,436

Index Scan using ix_evento_transaccion_item_evento_transaccion_id on evento_transaccion_item item (cost=0.43..1.32 rows=3 width=21) (actual time=0.004..0.004 rows=1 loops=2,254,436)

  • Index Cond: (evento_transaccion_id = evt.id)
47. 7,951.265 7,951.265 ↑ 1.0 1 1,590,253

Index Scan using ix_consumo_item_evento_transaccion_item on consumo_item item_consumo (cost=0.43..1.27 rows=1 width=16) (actual time=0.004..0.005 rows=1 loops=1,590,253)

  • Index Cond: (evento_transaccion_item_id = item.id)
  • Filter: (NOT es_anulado)
  • Rows Removed by Filter: 0
48. 6,551.695 6,551.695 ↑ 1.0 1 1,310,339

Index Scan using pk_proceso_transaccion on proceso_transaccion proceso (cost=0.43..1.29 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1,310,339)

  • Index Cond: (id = evt.proceso_transaccion_id)
49. 0.109 0.240 ↑ 1.0 632 1

Hash (cost=15.23..15.23 rows=632 width=4) (actual time=0.239..0.240 rows=632 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
50. 0.131 0.131 ↑ 1.0 632 1

Index Only Scan using pk_ips_sede on ips_sede sede (cost=0.28..15.23 rows=632 width=4) (actual time=0.041..0.131 rows=632 loops=1)

  • Heap Fetches: 0
51. 0.000 0.000 ↑ 4.5 2 1,233,013

Materialize (cost=0.00..24.63 rows=9 width=8) (actual time=0.000..0.000 rows=2 loops=1,233,013)

52. 0.004 0.072 ↑ 4.5 2 1

Append (cost=0.00..24.59 rows=9 width=8) (actual time=0.048..0.072 rows=2 loops=1)

53. 0.005 0.005 ↓ 0.0 0 1

Seq Scan on ticket tk (cost=0.00..0.00 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=1)

  • Filter: (numero_comprobante = 1403186)
54. 0.001 0.006 ↓ 0.0 0 1

Bitmap Heap Scan on ticket_2015 tk_1 (cost=2.16..5.29 rows=2 width=8) (actual time=0.006..0.006 rows=0 loops=1)

  • Recheck Cond: (numero_comprobante = 1403186)
55. 0.005 0.005 ↓ 0.0 0 1

Bitmap Index Scan on ix_ticket_2015_numero_comprobante (cost=0.00..2.15 rows=2 width=0) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (numero_comprobante = 1403186)
56. 0.009 0.009 ↓ 0.0 0 1

Index Scan using ix_ticket_2016_numero_comprobante on ticket_2016 tk_2 (cost=0.29..4.30 rows=1 width=8) (actual time=0.009..0.009 rows=0 loops=1)

  • Index Cond: (numero_comprobante = 1403186)
57. 0.011 0.011 ↓ 0.0 0 1

Index Scan using ix_ticket_2017_numero_comprobante on ticket_2017 tk_3 (cost=0.43..5.02 rows=2 width=8) (actual time=0.011..0.011 rows=0 loops=1)

  • Index Cond: (numero_comprobante = 1403186)
58. 0.014 0.014 ↑ 1.0 1 1

Index Scan using ix_ticket_2018_numero_comprobante on ticket_2018 tk_4 (cost=0.43..4.44 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: (numero_comprobante = 1403186)
59. 0.014 0.014 ↑ 1.0 1 1

Index Scan using ix_ticket_2019_numero_comprobante on ticket_2019 tk_5 (cost=0.42..4.44 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: (numero_comprobante = 1403186)
60. 0.009 0.009 ↓ 0.0 0 1

Seq Scan on ticket_otros tk_6 (cost=0.00..1.05 rows=1 width=8) (actual time=0.009..0.009 rows=0 loops=1)

  • Filter: (numero_comprobante = 1403186)
  • Rows Removed by Filter: 4
61. 0.020 0.020 ↑ 1.0 1 5

Index Only Scan using pk_especialidad_medica on especialidad_medica espe (cost=0.14..0.16 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=5)

  • Index Cond: (id = prof_espe.especialidad_medica_id)
  • Heap Fetches: 0
62. 0.045 0.045 ↑ 1.0 1 5

Index Scan using ix_evento_transaccion_item_procedimiento_evento_transaccion_ite on evento_transaccion_item_procedimiento item_proce (cost=0.43..1.27 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=5)

  • Index Cond: (evento_transaccion_item_id = item.id)
63. 0.030 0.030 ↑ 1.0 1 5

Index Scan using ix_evento_transaccion_item_estado_parcial_evento_transaccion_it on evento_transaccion_item_estado_parcial item_estado (cost=0.43..1.27 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=5)

  • Index Cond: (evento_transaccion_item_id = item_proce.evento_transaccion_item_id)
  • Filter: (estado_solicitud_item_id = 7)
64. 0.050 0.050 ↑ 1.0 1 5

Index Scan using pk_beneficiario on beneficiario bene (cost=0.42..1.23 rows=1 width=41) (actual time=0.010..0.010 rows=1 loops=5)

  • Index Cond: (id = proceso.beneficiario_id)
  • Filter: ((apellido_nombre)::text !~~* '%prueba%'::text)
65. 0.015 0.015 ↑ 1.0 1 5

Index Only Scan using pk_tipo_documento on tipo_documento td (cost=0.14..0.15 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=5)

  • Index Cond: (id = bene.tipo_documento_id)
  • Heap Fetches: 0
66. 0.060 0.060 ↑ 1.0 1 5

Index Scan using pk_procedimiento on procedimiento proce (cost=0.28..1.03 rows=1 width=56) (actual time=0.012..0.012 rows=1 loops=5)

  • Index Cond: (id = item_proce.procedimiento_id)
  • Filter: (NOT es_consulta)
67. 0.015 0.015 ↑ 1.0 1 5

Index Scan using nomenclador_pkey on nomenclador nom (cost=0.13..0.14 rows=1 width=27) (actual time=0.003..0.003 rows=1 loops=5)

  • Index Cond: (id = proce.nomenclador_id)
68. 0.020 0.020 ↑ 1.0 1 5

Index Scan using pk_diagnostico on diagnostico diag (cost=0.29..1.07 rows=1 width=9) (actual time=0.004..0.004 rows=1 loops=5)

  • Index Cond: (id = item.diagnostico_id)