explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vdo6

Settings
# exclusive inclusive rows x rows loops node
1. 32,761.955 151,598.075 ↓ 146.1 34,047 1

Subquery Scan on vw_ia_demanda_repetitiva (cost=1,089,914.48..1,089,926.71 rows=233 width=76) (actual time=118,798.968..151,598.075 rows=34,047 loops=1)

  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 20045
2. 26,132.491 118,830.756 ↓ 116.1 54,092 1

HashAggregate (cost=1,089,295.13..1,089,299.79 rows=466 width=104) (actual time=118,776.903..118,830.756 rows=54,092 loops=1)

  • 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
3. 10.234 92,698.265 ↓ 116.1 54,092 1

Append (cost=137,390.30..1,089,285.81 rows=466 width=104) (actual time=2,387.349..92,698.265 rows=54,092 loops=1)

4. 20.355 46,764.590 ↓ 149.6 52,957 1

Subquery Scan on *SELECT* 1 (cost=137,390.30..479,989.28 rows=354 width=143) (actual time=2,387.347..46,764.590 rows=52,957 loops=1)

5. 118.126 46,744.235 ↓ 149.6 52,957 1

Hash Right Join (cost=137,390.30..479,984.85 rows=354 width=139) (actual time=2,387.345..46,744.235 rows=52,957 loops=1)

  • Hash Cond: (pp.fk_processo = autos.id)
6. 44,239.847 44,239.847 ↑ 7.0 58,273 1

Seq Scan on perfil_processos pp (cost=0.00..341,064.10 rows=407,869 width=12) (actual time=1.062..44,239.847 rows=58,273 loops=1)

  • Filter: fun_pega_perfil_pai((fk_perfil)::integer, 2)
  • Rows Removed by Filter: 1165339
7. 31.915 2,386.262 ↓ 144.9 51,281 1

Hash (cost=137,385.87..137,385.87 rows=354 width=99) (actual time=2,386.262..2,386.262 rows=51,281 loops=1)

  • Buckets: 65536 (originally 1024) Batches: 2 (originally 1) Memory Usage: 3585kB
8. 19.542 2,354.347 ↓ 144.9 51,281 1

Nested Loop (cost=44,864.28..137,385.87 rows=354 width=99) (actual time=292.029..2,354.347 rows=51,281 loops=1)

9. 106.912 1,975.509 ↓ 6.2 51,328 1

Nested Loop (cost=44,863.86..128,495.72 rows=8,284 width=95) (actual time=291.995..1,975.509 rows=51,328 loops=1)

10. 316.113 779.528 ↓ 5.3 363,023 1

Hash Join (cost=44,863.43..79,414.09 rows=68,786 width=16) (actual time=291.942..779.528 rows=363,023 loops=1)

  • Hash Cond: (pa.fk_autos = p1.fk_processo)
11. 171.738 171.738 ↓ 1.0 1,893,246 1

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

12. 11.480 291.677 ↑ 1.0 52,210 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 2552kB
13. 280.197 280.197 ↑ 1.0 52,210 1

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

  • Filter: (fklotacao = ANY ('{1007905,1007908}'::integer[]))
  • Rows Removed by Filter: 1404827
14. 1,089.069 1,089.069 ↓ 0.0 0 363,023

Index Scan using anexo_geral_repid on anexo_geral ag (cost=0.43..0.71 rows=1 width=83) (actual time=0.003..0.003 rows=0 loops=363,023)

  • Index Cond: (id = pa.fk_anexo_geral)
  • Filter: ((arquivo IS NOT NULL) AND (fk_anexo_grupo_item = 37))
  • Rows Removed by Filter: 1
15. 359.296 359.296 ↑ 1.0 1 51,328

Index Scan using autos_repid on autos (cost=0.43..1.07 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=51,328)

  • Index Cond: (id = pa.fk_autos)
  • Filter: (fk_tipo_processo_acao = 18)
  • Rows Removed by Filter: 0
16. 24.003 45,923.441 ↓ 10.1 1,135 1

Hash Right Join (cost=266,701.50..609,295.41 rows=112 width=90) (actual time=1,340.050..45,923.441 rows=1,135 loops=1)

  • Hash Cond: (pp_1.fk_processo = autos_1.id)
17. 44,566.046 44,566.046 ↑ 7.0 58,273 1

Seq Scan on perfil_processos pp_1 (cost=0.00..341,064.10 rows=407,869 width=12) (actual time=0.159..44,566.046 rows=58,273 loops=1)

  • Filter: fun_pega_perfil_pai((fk_perfil)::integer, 2)
  • Rows Removed by Filter: 1165339
18. 0.797 1,333.392 ↓ 9.9 1,114 1

Hash (cost=266,700.10..266,700.10 rows=112 width=50) (actual time=1,333.392..1,333.392 rows=1,114 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 117kB
19. 1.367 1,332.595 ↓ 9.9 1,114 1

Nested Loop (cost=44,863.85..266,700.10 rows=112 width=50) (actual time=299.901..1,332.595 rows=1,114 loops=1)

20. 18.313 1,322.292 ↑ 2.3 1,117 1

Hash Join (cost=44,863.43..255,186.91 rows=2,623 width=46) (actual time=299.843..1,322.292 rows=1,117 loops=1)

  • Hash Cond: (a.fk_processo = p1_1.fk_processo)
21. 1,014.689 1,014.689 ↓ 1.1 79,789 1

Seq Scan on anexo a (cost=0.00..210,133.99 rows=72,191 width=38) (actual time=0.052..1,014.689 rows=79,789 loops=1)

  • Filter: ((anexo_pdf IS NOT NULL) AND (fk_anexo_grupo_item = 37))
  • Rows Removed by Filter: 5005025
22. 10.380 289.290 ↑ 1.0 52,210 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 2552kB
23. 278.910 278.910 ↑ 1.0 52,210 1

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

  • Filter: (fklotacao = ANY ('{1007905,1007908}'::integer[]))
  • Rows Removed by Filter: 1404827
24. 8.936 8.936 ↑ 1.0 1 1,117

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

  • Index Cond: (id = a.fk_processo)
  • Filter: (fk_tipo_processo_acao = 18)
  • Rows Removed by Filter: 0
25.          

SubPlan (forSubquery Scan)

26. 5.364 5.364 ↑ 1.0 19,068 1

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

Planning time : 1.868 ms
Execution time : 151,604.777 ms