explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hZDf

Settings
# exclusive inclusive rows x rows loops node
1. 19.139 1,279.514 ↓ 1.9 245,070 1

Result (cost=106,275.31..113,022.02 rows=129,741 width=14) (actual time=1,129.207..1,279.514 rows=245,070 loops=1)

  • One-Time Filter: (0 < $2)
2.          

Initplan (forResult)

3. 0.000 322.924 ↑ 1.0 1 1

Finalize Aggregate (cost=50,294.76..50,294.77 rows=1 width=8) (actual time=322.924..322.924 rows=1 loops=1)

4. 10.164 323.028 ↓ 1.5 3 1

Gather (cost=50,294.55..50,294.76 rows=2 width=8) (actual time=322.759..323.028 rows=3 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 0.008 312.864 ↑ 1.0 1 3

Partial Aggregate (cost=49,294.55..49,294.56 rows=1 width=8) (actual time=312.864..312.864 rows=1 loops=3)

6. 0.177 312.856 ↑ 1,726.0 9 3

Nested Loop (cost=72.46..49,255.71 rows=15,534 width=0) (actual time=205.576..312.856 rows=9 loops=3)

7. 75.340 312.657 ↑ 1,726.0 9 3

Hash Semi Join (cost=72.03..41,577.83 rows=15,534 width=14) (actual time=205.558..312.657 rows=9 loops=3)

  • Hash Cond: ((t.usuario)::text = (doc_roles_usuarios.rol_privacidad)::text)
8. 237.237 237.237 ↑ 1.3 727,747 3

Parallel Seq Scan on doc_documentos_privacidad t (cost=0.00..38,940.08 rows=911,584 width=26) (actual time=0.022..237.237 rows=727,747 loops=3)

  • Filter: (((vigencia)::text = 'S'::text) AND ((sel)::text = 'S'::text))
  • Rows Removed by Filter: 35515
9. 0.009 0.080 ↑ 11.0 2 3

Hash (cost=71.75..71.75 rows=22 width=21) (actual time=0.079..0.080 rows=2 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.001 0.071 ↑ 11.0 2 3

Append (cost=4.50..71.75 rows=22 width=21) (actual time=0.068..0.071 rows=2 loops=3)

11. 0.002 0.048 ↓ 0.0 0 3

Bitmap Heap Scan on doc_roles_usuarios (cost=4.50..69.53 rows=20 width=20) (actual time=0.048..0.048 rows=0 loops=3)

  • Recheck Cond: (((usuario)::text = 'aciero'::text) AND ((vigencia)::text = 'S'::text))
12. 0.046 0.046 ↓ 0.0 0 3

Bitmap Index Scan on index3 (cost=0.00..4.49 rows=20 width=0) (actual time=0.046..0.046 rows=0 loops=3)

  • Index Cond: (((usuario)::text = 'aciero'::text) AND ((vigencia)::text = 'S'::text))
13. 0.020 0.020 ↑ 1.0 1 3

Seq Scan on dual (cost=0.00..1.01 rows=1 width=32) (actual time=0.019..0.020 rows=1 loops=3)

14. 0.002 0.002 ↑ 1.0 1 3

Seq Scan on dual dual_1 (cost=0.00..1.01 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=3)

15. 0.022 0.022 ↑ 1.0 1 26

Index Only Scan using doc_documentos_acceso_pk on doc_documentos_acceso e_1 (cost=0.43..0.49 rows=1 width=14) (actual time=0.022..0.022 rows=1 loops=26)

  • Index Cond: (numero_docto = (t.numero_docto)::text)
  • Heap Fetches: 26
16. 110.764 937.451 ↓ 1.9 245,070 1

Hash Join (cost=106,275.31..113,022.02 rows=129,741 width=14) (actual time=806.275..937.451 rows=245,070 loops=1)

  • Hash Cond: ((a.numero_docto)::text = (e.numero_docto)::text)
17. 24.739 24.739 ↑ 1.0 286,868 1

Seq Scan on doc_adjuntos a (cost=0.00..5,993.68 rows=286,868 width=28) (actual time=0.010..24.739 rows=286,868 loops=1)

18. 238.955 801.948 ↓ 1.0 968,278 1

Hash (cost=43,962.00..43,962.00 rows=961,483 width=14) (actual time=801.948..801.948 rows=968,278 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 51689kB
19. 562.993 562.993 ↓ 1.0 968,278 1

Seq Scan on doc_documentos_acceso e (cost=0.00..43,962.00 rows=961,483 width=14) (actual time=0.023..562.993 rows=968,278 loops=1)

  • Filter: (privacidad = ANY ('{2,3}'::numeric[]))
  • Rows Removed by Filter: 1157642