explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZXcR

Settings
# exclusive inclusive rows x rows loops node
1. 20.481 1,300.946 ↓ 1.9 245,070 1

Result (cost=106,274.75..113,021.46 rows=129,741 width=14) (actual time=1,143.472..1,300.946 rows=245,070 loops=1)

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

Initplan (forResult)

3. 0.000 321.894 ↑ 1.0 1 1

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

4. 8.900 322.003 ↓ 1.5 3 1

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

  • Workers Planned: 2
  • Workers Launched: 2
5. 0.007 313.103 ↑ 1.0 1 3

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

6. 0.148 313.096 ↑ 1,726.0 9 3

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

7. 74.945 312.930 ↑ 1,726.0 9 3

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

  • Hash Cond: ((t.usuario)::text = (doc_roles_usuarios.rol_privacidad)::text)
8. 237.911 237.911 ↑ 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.023..237.911 rows=727,747 loops=3)

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

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

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

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

11. 0.002 0.042 ↓ 0.0 0 3

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

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

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

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

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

14. 0.005 0.005 ↑ 1.0 1 3

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

15. 0.018 0.018 ↑ 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.018..0.018 rows=1 loops=26)

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

Hash Join (cost=106,274.75..113,021.46 rows=129,741 width=14) (actual time=821.573..958.571 rows=245,070 loops=1)

  • Hash Cond: ((a.numero_docto)::text = (e.numero_docto)::text)
17. 25.518 25.518 ↑ 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..25.518 rows=286,868 loops=1)

18. 240.789 820.352 ↓ 1.0 968,278 1

Hash (cost=43,961.61..43,961.61 rows=961,469 width=14) (actual time=820.352..820.352 rows=968,278 loops=1)

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

Seq Scan on doc_documentos_acceso e (cost=0.00..43,961.61 rows=961,469 width=14) (actual time=0.017..579.563 rows=968,278 loops=1)

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