explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6Jhl

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.003 99.825 ↓ 0.0 0 1

WindowAgg (cost=58,535.69..58,537.00 rows=58 width=142) (actual time=99.825..99.825 rows=0 loops=1)

2.          

Initplan (for WindowAgg)

3. 0.000 0.000 ↓ 0.0 0

Seq Scan on lotacao_orgao_julgador (cost=0.00..1.36 rows=1 width=8) (never executed)

  • Filter: (lotacao_id = 123)
4. 0.028 99.822 ↓ 0.0 0 1

Sort (cost=58,534.33..58,534.47 rows=58 width=113) (actual time=99.822..99.822 rows=0 loops=1)

  • Sort Key: d.situacao, d.data_insercao
  • Sort Method: quicksort Memory: 25kB
5. 0.000 99.794 ↓ 0.0 0 1

Nested Loop Left Join (cost=52,790.40..58,532.63 rows=58 width=113) (actual time=99.794..99.794 rows=0 loops=1)

6. 0.002 99.794 ↓ 0.0 0 1

Hash Left Join (cost=52,789.99..58,400.36 rows=58 width=94) (actual time=99.794..99.794 rows=0 loops=1)

  • Hash Cond: (d.id = obs.digitalizacao_id)
7. 0.001 99.792 ↓ 0.0 0 1

Nested Loop (cost=52,445.35..58,054.52 rows=58 width=83) (actual time=99.792..99.792 rows=0 loops=1)

8. 0.021 99.791 ↓ 0.0 0 1

Hash Right Join (cost=52,444.93..57,572.71 rows=58 width=64) (actual time=99.791..99.791 rows=0 loops=1)

  • Hash Cond: ((responsavel_digitalizacao.digitalizacao_id = d.id) AND ((responsavel_digitalizacao.situacao)::text = (d.situacao)::text))
9. 0.000 0.000 ↓ 0.0 0

Seq Scan on responsavel_digitalizacao_situacao responsavel_digitalizacao (cost=0.00..4,458.01 rows=89,301 width=35) (never executed)

10. 0.001 99.770 ↓ 0.0 0 1

Hash (cost=52,444.06..52,444.06 rows=58 width=56) (actual time=99.770..99.770 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
11. 99.769 99.769 ↓ 0.0 0 1

Seq Scan on digitalizacao d (cost=0.00..52,444.06 rows=58 width=56) (actual time=99.769..99.769 rows=0 loops=1)

  • Filter: (((situacao)::text = ANY ('{a,s,n,x}'::text[])) AND ((lotacao_id = 1) OR (lotacao_orgao_julgador_id = $0)))
  • Rows Removed by Filter: 52544
12. 0.000 0.000 ↓ 0.0 0

Index Scan using usuario_pkey on usuario u (cost=0.42..8.30 rows=1 width=35) (never executed)

  • Index Cond: (id = d.usuario_ultima_atualizacao_id)
13. 0.000 0.000 ↓ 0.0 0

Hash (cost=286.57..286.57 rows=4,645 width=19) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Seq Scan on digitalizacao_observacao obs (cost=0.00..286.57 rows=4,645 width=19) (never executed)

  • Filter: ((tipo_observacao)::text = 'RETORNO'::text)
15. 0.000 0.000 ↓ 0.0 0

Index Scan using usuario_pkey on usuario responsavel (cost=0.42..2.27 rows=1 width=35) (never executed)

  • Index Cond: (id = responsavel_digitalizacao.usuario_responsavel_id)