explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hOoo

Settings
# exclusive inclusive rows x rows loops node
1. 0.214 1.381 ↑ 2.6 50 1

Nested Loop Left Join (cost=30.41..2,313.11 rows=132 width=630) (actual time=0.352..1.381 rows=50 loops=1)

2.          

CTE grau

3. 0.007 0.007 ↑ 1.0 1 1

Index Scan using tb_parametro_in01 on tb_parametro (cost=0.28..4.29 rows=1 width=15) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: ((nm_variavel)::text = 'aplicacaoSistema'::text)
4.          

CTE tribunal

5. 0.002 0.002 ↑ 1.0 1 1

Seq Scan on tb_tribunal (cost=0.00..1.01 rows=1 width=14) (actual time=0.002..0.002 rows=1 loops=1)

6.          

Initplan (forNested Loop Left Join)

7. 0.004 0.004 ↑ 1.0 1 1

CTE Scan on tribunal (cost=0.00..0.02 rows=1 width=19) (actual time=0.004..0.004 rows=1 loops=1)

8. 0.010 0.010 ↑ 1.0 1 1

CTE Scan on grau (cost=0.00..0.02 rows=1 width=32) (actual time=0.009..0.010 rows=1 loops=1)

9. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on grau grau_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1)

10. 0.000 0.602 ↑ 2.6 50 1

Nested Loop (cost=24.62..499.35 rows=132 width=542) (actual time=0.277..0.602 rows=50 loops=1)

11. 0.024 0.555 ↑ 1.3 50 1

Hash Join (cost=23.19..461.75 rows=66 width=293) (actual time=0.248..0.555 rows=50 loops=1)

  • Hash Cond: ((doc.id_tipo_processo_documento)::integer = (tpd.id_tipo_processo_documento)::integer)
12. 0.006 0.328 ↑ 1.3 50 1

Nested Loop (cost=1.13..438.78 rows=66 width=259) (actual time=0.034..0.328 rows=50 loops=1)

13. 0.122 0.122 ↑ 1.3 50 1

Index Scan using tb_processo_documento_in05 on tb_processo_documento doc (cost=0.56..135.68 rows=66 width=93) (actual time=0.025..0.122 rows=50 loops=1)

  • Index Cond: ((id_processo)::integer = 10896)
  • Filter: ((dt_juntada IS NOT NULL) AND ((in_ativo)::bpchar = 'S'::bpchar) AND ((in_documento_sigiloso)::bpchar = 'N'::bpchar) AND (($5 = '3'::text) OR ((ds_instancia)::text = '3'::text) OR ((ds_instancia)::text = $6)))
  • Rows Removed by Filter: 9
14. 0.200 0.200 ↑ 1.0 1 50

Index Scan using tb_processo_documento_bin_pk on tb_processo_documento_bin docbin (cost=0.56..4.58 rows=1 width=166) (actual time=0.004..0.004 rows=1 loops=50)

  • Index Cond: ((id_processo_documento_bin)::integer = (doc.id_processo_documento_bin)::integer)
15. 0.099 0.203 ↑ 1.0 625 1

Hash (cost=14.25..14.25 rows=625 width=38) (actual time=0.203..0.203 rows=625 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 53kB
16. 0.104 0.104 ↑ 1.0 625 1

Seq Scan on tb_tipo_processo_documento tpd (cost=0.00..14.25 rows=625 width=38) (actual time=0.005..0.104 rows=625 loops=1)

17. 0.021 0.050 ↑ 2.0 1 50

Materialize (cost=1.43..35.95 rows=2 width=253) (actual time=0.001..0.001 rows=1 loops=50)

18. 0.002 0.029 ↑ 2.0 1 1

Nested Loop (cost=1.43..35.94 rows=2 width=253) (actual time=0.026..0.029 rows=1 loops=1)

19. 0.000 0.013 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.71..12.79 rows=1 width=107) (actual time=0.013..0.013 rows=1 loops=1)

20. 0.001 0.013 ↑ 1.0 1 1

Nested Loop (cost=0.57..8.62 rows=1 width=75) (actual time=0.013..0.013 rows=1 loops=1)

21. 0.009 0.009 ↑ 1.0 1 1

Index Scan using tb_processo_trf_pk on tb_processo_trf ptrf (cost=0.42..4.45 rows=1 width=39) (actual time=0.009..0.009 rows=1 loops=1)

  • Index Cond: ((id_processo_trf)::integer = 10896)
  • Filter: ((cd_processo_status = 'D'::bpchar) AND ((in_segredo_justica)::bpchar = 'N'::bpchar))
22. 0.003 0.003 ↑ 1.0 1 1

Index Scan using tb_orgao_julgador_pk on tb_orgao_julgador oj (cost=0.14..4.16 rows=1 width=40) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: ((id_orgao_julgador)::integer = (ptrf.id_orgao_julgador)::integer)
23. 0.000 0.000 ↓ 0.0 0 1

Index Scan using tb_orgao_julgador_colgiado_pk on tb_orgao_julgador_colgiado ojc (cost=0.14..4.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: ((id_orgao_julgador_colegiado)::integer = (ptrf.id_orgao_julgador_colegiado)::integer)
24. 0.000 0.014 ↑ 2.0 1 1

Nested Loop (cost=0.71..23.13 rows=2 width=150) (actual time=0.011..0.014 rows=1 loops=1)

25. 0.009 0.009 ↑ 2.0 1 1

Index Scan using tb_processo_assunto_uk on tb_processo_assunto pa (cost=0.43..14.52 rows=2 width=8) (actual time=0.006..0.009 rows=1 loops=1)

  • Index Cond: ((id_processo_trf)::integer = 10896)
  • Filter: (in_assunto_principal = 'S'::bpchar)
  • Rows Removed by Filter: 1
26. 0.005 0.005 ↑ 1.0 1 1

Index Scan using tb_assunto_trf_pk on tb_assunto_trf a (cost=0.28..4.30 rows=1 width=150) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (id_assunto_trf = (pa.id_assunto_trf)::integer)
27. 0.150 0.150 ↑ 1.0 1 50

Index Scan using tb_pte_status_documento_indexado_pk on tb_pte_status_documento_indexado pte (cost=0.43..4.45 rows=1 width=6) (actual time=0.003..0.003 rows=1 loops=50)

  • Index Cond: (id_processo_documento = (doc.id_processo_documento)::integer)
28.          

SubPlan (forNested Loop Left Join)

29. 0.100 0.350 ↑ 1.0 1 50

Aggregate (cost=4.59..4.60 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=50)

30. 0.250 0.250 ↑ 1.0 1 50

Index Scan using tb_proc_dc_bin_pess_assin_in01 on tb_proc_doc_bin_pess_assin assin (cost=0.56..4.58 rows=1 width=23) (actual time=0.004..0.005 rows=1 loops=50)

  • Index Cond: ((id_processo_documento_bin)::integer = (docbin.id_processo_documento_bin)::integer)
31. 0.050 0.050 ↓ 0.0 0 50

Index Scan using tb_processo_documento_in04 on tb_processo_documento doc2 (cost=0.56..4.58 rows=1 width=36) (actual time=0.001..0.001 rows=0 loops=50)

  • Index Cond: ((id_processo_documento)::integer = (doc.id_documento_principal)::integer)
Planning time : 2.416 ms
Execution time : 1.708 ms