explain.depesz.com

A tool for finding a real cause for slow queries.

Result: mgl

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 63.216 1343.623 ↑ 3.0 21334 1

Sort (cost=82029.85..82061.93 rows=64149 width=817) (actual time=1341.558..1343.623 rows=21334 loops=1)

  • Sort Key: e.id
  • Sort Method: quicksort Memory: 11771kB
2. 19.037 1280.407 ↑ 3.0 21334 1

Hash Left Join (cost=4497.00..81005.45 rows=64149 width=817) (actual time=373.137..1280.407 rows=21334 loops=1)

  • Hash Cond: (d.id_autor = p.id)
3. 26.069 1259.971 ↑ 3.0 21334 1

Hash Left Join (cost=4415.84..80683.72 rows=64149 width=797) (actual time=371.693..1259.971 rows=21334 loops=1)

  • Hash Cond: (d.id_archivo = a.id)
4. 14.326 1087.300 ↑ 3.0 21334 1

Hash Join (cost=2.39..76042.35 rows=64149 width=781) (actual time=225.035..1087.300 rows=21334 loops=1)

  • Hash Cond: (d.id_tipo_documento = td.id)
5. 16.897 1072.932 ↑ 3.1 21334 1

Hash Join (cost=1.14..75799.78 rows=65166 width=567) (actual time=224.981..1072.932 rows=21334 loops=1)

  • Hash Cond: (d.id_formato = fd.id)
6. 21.891 1056.027 ↑ 3.1 21563 1

Nested Loop (cost=0.12..75552.66 rows=67474 width=353) (actual time=224.956..1056.027 rows=21563 loops=1)

7. 8.896 947.884 ↑ 3.1 21563 1

Nested Loop (cost=0.12..68871.87 rows=67474 width=205) (actual time=224.940..947.884 rows=21563 loops=1)

8. 0.237 926.956 ↑ 16.6 256 1

Nested Loop Left Join (cost=0.12..36442.16 rows=4257 width=197) (actual time=224.925..926.956 rows=256 loops=1)

9. 0.242 925.951 ↑ 16.6 256 1

Nested Loop Left Join (cost=0.12..36043.55 rows=4257 width=177) (actual time=224.917..925.951 rows=256 loops=1)

10. 1.373 924.685 ↑ 16.6 256 1

Nested Loop Left Join (cost=0.12..35699.35 rows=4257 width=163) (actual time=224.909..924.685 rows=256 loops=1)

  • Join Filter: ((e.id_destinatario = p_dest.id) OR (e.id_destinatario_historico = p_dest.id))
11. 0.284 922.032 ↑ 16.6 256 1

Nested Loop Left Join (cost=0.00..18081.11 rows=4257 width=127) (actual time=224.883..922.032 rows=256 loops=1)

12. 0.622 920.724 ↑ 16.6 256 1

Nested Loop Left Join (cost=0.00..17500.33 rows=4257 width=114) (actual time=224.876..920.724 rows=256 loops=1)

13. 918.566 918.566 ↑ 16.6 256 1

Seq Scan on expedientes e (cost=0.00..16919.55 rows=4257 width=101) (actual time=224.857..918.566 rows=256 loops=1)

  • Filter: ((NOT desierto) AND (upper((numero_expediente)::text) = 'E80186/2011'::text))
14. 1.536 1.536 ↑ 1.0 1 256

Index Scan using idx1_id on personas p_origen_historico (cost=0.00..0.13 rows=1 width=29) (actual time=0.005..0.006 rows=1 loops=256)

  • Index Cond: (p_origen_historico.id = e.id_emisor_historico)
15. 1.024 1.024 ↑ 1.0 1 256

Index Scan using idx1_id on personas p_origen (cost=0.00..0.13 rows=1 width=29) (actual time=0.003..0.004 rows=1 loops=256)

  • Index Cond: (p_origen.id = e.id_emisor)
16. 0.512 1.280 ↑ 2.0 1 256

Bitmap Heap Scan on personas p_dest (cost=0.12..4.13 rows=2 width=44) (actual time=0.004..0.005 rows=1 loops=256)

  • Recheck Cond: ((e.id_destinatario = p_dest.id) OR (e.id_destinatario_historico = p_dest.id))
17. 0.256 0.768 ↓ 0.0 0 256

BitmapOr (cost=0.12..0.12 rows=2 width=0) (actual time=0.003..0.003 rows=0 loops=256)

18. 0.000 0.000 ↓ 0.0 0 256

Bitmap Index Scan on idx1_id (cost=0.00..0.06 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=256)

  • Index Cond: (e.id_destinatario = p_dest.id)
19. 0.512 0.512 ↑ 1.0 1 256

Bitmap Index Scan on idx1_id (cost=0.00..0.06 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=256)

  • Index Cond: (e.id_destinatario_historico = p_dest.id)
20. 1.024 1.024 ↑ 1.0 1 256

Index Scan using cargos_pkey on cargos c (cost=0.00..0.08 rows=1 width=30) (actual time=0.003..0.004 rows=1 loops=256)

  • Index Cond: (p_dest.id_cargo = c.id)
21. 0.768 0.768 ↑ 1.0 1 256

Index Scan using unidades_pkey on unidades u (cost=0.00..0.09 rows=1 width=36) (actual time=0.002..0.003 rows=1 loops=256)

  • Index Cond: (c.id_unidad_organizacional = u.id)
22. 12.032 12.032 ↓ 5.2 84 256

Index Scan using idx_idexpediente on documentos_expedientes de (cost=0.00..7.56 rows=16 width=16) (actual time=0.010..0.047 rows=84 loops=256)

  • Index Cond: (de.id_expediente = e.id)
23. 86.252 86.252 ↑ 1.0 1 21563

Index Scan using documentos_pkey on documentos d (cost=0.00..0.10 rows=1 width=156) (actual time=0.003..0.004 rows=1 loops=21563)

  • Index Cond: (d.id = de.id_documento)
24. 0.004 0.008 ↑ 1.0 3 1

Hash (cost=1.01..1.01 rows=3 width=222) (actual time=0.008..0.008 rows=3 loops=1)

25. 0.004 0.004 ↑ 1.0 3 1

Seq Scan on formatos_documentos fd (cost=0.00..1.01 rows=3 width=222) (actual time=0.003..0.004 rows=3 loops=1)

26. 0.019 0.042 ↑ 1.0 38 1

Hash (cost=1.11..1.11 rows=38 width=222) (actual time=0.042..0.042 rows=38 loops=1)

27. 0.023 0.023 ↑ 1.0 38 1

Seq Scan on tipos_documentos td (cost=0.00..1.11 rows=38 width=222) (actual time=0.015..0.023 rows=38 loops=1)

28. 78.258 146.602 ↑ 1.0 210743 1

Hash (cost=3672.28..3672.28 rows=211761 width=32) (actual time=146.602..146.602 rows=210743 loops=1)

29. 68.344 68.344 ↑ 1.0 210743 1

Seq Scan on archivos a (cost=0.00..3672.28 rows=211761 width=32) (actual time=0.007..68.344 rows=210743 loops=1)

30. 0.676 1.399 ↑ 1.0 1410 1

Hash (cost=76.23..76.23 rows=1410 width=36) (actual time=1.399..1.399 rows=1410 loops=1)

31. 0.723 0.723 ↑ 1.0 1410 1

Seq Scan on personas p (cost=0.00..76.23 rows=1410 width=36) (actual time=0.006..0.723 rows=1410 loops=1)