explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AM2d : Optimization for: plan #6Jhl

Settings

Optimization path:

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

WindowAgg (cost=53,139.71..53,140.58 rows=39 width=142) (actual time=79.758..79.758 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.008 79.755 ↓ 0.0 0 1

Sort (cost=53,138.34..53,138.44 rows=39 width=113) (actual time=79.755..79.755 rows=0 loops=1)

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

Nested Loop Left Join (cost=346.67..53,137.31 rows=39 width=113) (actual time=79.747..79.747 rows=0 loops=1)

6. 0.000 79.746 ↓ 0.0 0 1

Nested Loop Left Join (cost=346.26..53,048.55 rows=39 width=94) (actual time=79.746..79.746 rows=0 loops=1)

7. 0.001 79.746 ↓ 0.0 0 1

Hash Left Join (cost=345.97..52,646.08 rows=39 width=86) (actual time=79.746..79.746 rows=0 loops=1)

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

Nested Loop (cost=0.41..52,299.72 rows=39 width=75) (actual time=79.745..79.745 rows=0 loops=1)

9. 79.744 79.744 ↓ 0.0 0 1

Seq Scan on digitalizacao d (cost=0.00..51,974.46 rows=39 width=56) (actual time=79.744..79.744 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: 52561
10. 0.000 0.000 ↓ 0.0 0

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

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

Hash (cost=287.14..287.14 rows=4,673 width=19) (never executed)

12. 0.000 0.000 ↓ 0.0 0

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

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

Index Scan using responsavel_digitalizacao_situacao_digitalizacao_id_idx on responsavel_digitalizacao_situacao responsavel_digitalizacao (cost=0.29..10.31 rows=1 width=35) (never executed)

  • Index Cond: (digitalizacao_id = d.id)
  • Filter: ((situacao)::text = (d.situacao)::text)
14. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = responsavel_digitalizacao.usuario_responsavel_id)
Planning time : 1.907 ms
Execution time : 79.875 ms