explain.depesz.com

PostgreSQL's explain analyze made readable

Result: epXB

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=1,089,914.48..1,089,915.01 rows=10 width=76) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Subquery Scan on vw_ia_demanda_repetitiva (cost=1,089,914.48..1,089,926.71 rows=233 width=76) (actual rows= loops=)

  • Filter: (NOT (hashed SubPlan 1))
3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,089,295.13..1,089,299.79 rows=466 width=104) (actual rows= loops=)

  • Group Key: "*SELECT* 1".fk_perfil, "*SELECT* 1".arquivo, (("*SELECT* 1".id_tabela)::bigint), ('anexo_geral'::text), "*SELECT* 1".data_cadastro, "*SELECT* 1".fk_tipo_processo_acao, "*SELECT* 1".fk_rito, "*SELECT* 1".fk_autos
4. 0.000 0.000 ↓ 0.0

Append (cost=137,390.30..1,089,285.81 rows=466 width=104) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=137,390.30..479,989.28 rows=354 width=143) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=137,390.30..479,984.85 rows=354 width=139) (actual rows= loops=)

  • Hash Cond: (pp.fk_processo = autos.id)
7. 0.000 0.000 ↓ 0.0

Seq Scan on perfil_processos pp (cost=0.00..341,064.10 rows=407,869 width=12) (actual rows= loops=)

  • Filter: fun_pega_perfil_pai((fk_perfil)::integer, 2)
8. 0.000 0.000 ↓ 0.0

Hash (cost=137,385.87..137,385.87 rows=354 width=99) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=44,864.28..137,385.87 rows=354 width=99) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=44,863.86..128,495.72 rows=8,284 width=95) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash Join (cost=44,863.43..79,414.09 rows=68,786 width=16) (actual rows= loops=)

  • Hash Cond: (pa.fk_autos = p1.fk_processo)
12. 0.000 0.000 ↓ 0.0

Seq Scan on peticao_anexos pa (cost=0.00..29,581.00 rows=1,893,200 width=8) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash (cost=44,201.74..44,201.74 rows=52,935 width=8) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Seq Scan on processo_1g p1 (cost=0.00..44,201.74 rows=52,935 width=8) (actual rows= loops=)

  • Filter: (fklotacao = ANY ('{1007905,1007908}'::integer[]))
15. 0.000 0.000 ↓ 0.0

Index Scan using anexo_geral_repid on anexo_geral ag (cost=0.43..0.71 rows=1 width=83) (actual rows= loops=)

  • Index Cond: (id = pa.fk_anexo_geral)
  • Filter: ((arquivo IS NOT NULL) AND (fk_anexo_grupo_item = 37))
16. 0.000 0.000 ↓ 0.0

Index Scan using autos_repid on autos (cost=0.43..1.07 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = pa.fk_autos)
  • Filter: (fk_tipo_processo_acao = 18)
17. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=266,701.50..609,295.41 rows=112 width=90) (actual rows= loops=)

  • Hash Cond: (pp_1.fk_processo = autos_1.id)
18. 0.000 0.000 ↓ 0.0

Seq Scan on perfil_processos pp_1 (cost=0.00..341,064.10 rows=407,869 width=12) (actual rows= loops=)

  • Filter: fun_pega_perfil_pai((fk_perfil)::integer, 2)
19. 0.000 0.000 ↓ 0.0

Hash (cost=266,700.10..266,700.10 rows=112 width=50) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=44,863.85..266,700.10 rows=112 width=50) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash Join (cost=44,863.43..255,186.91 rows=2,623 width=46) (actual rows= loops=)

  • Hash Cond: (a.fk_processo = p1_1.fk_processo)
22. 0.000 0.000 ↓ 0.0

Seq Scan on anexo a (cost=0.00..210,133.99 rows=72,191 width=38) (actual rows= loops=)

  • Filter: ((anexo_pdf IS NOT NULL) AND (fk_anexo_grupo_item = 37))
23. 0.000 0.000 ↓ 0.0

Hash (cost=44,201.74..44,201.74 rows=52,935 width=8) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Seq Scan on processo_1g p1_1 (cost=0.00..44,201.74 rows=52,935 width=8) (actual rows= loops=)

  • Filter: (fklotacao = ANY ('{1007905,1007908}'::integer[]))
25. 0.000 0.000 ↓ 0.0

Index Scan using autos_repid on autos autos_1 (cost=0.43..4.39 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = a.fk_processo)
  • Filter: (fk_tipo_processo_acao = 18)
26.          

SubPlan (forSubquery Scan)

27. 0.000 0.000 ↓ 0.0

Seq Scan on ia_pdf_para_txt (cost=0.00..571.68 rows=19,068 width=19) (actual rows= loops=)