explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5Jfg

Settings
# exclusive inclusive rows x rows loops node
1. 0.382 399.038 ↑ 1.0 1 1

Aggregate (cost=8,963.51..8,963.52 rows=1 width=40) (actual time=399.038..399.038 rows=1 loops=1)

2. 1.971 398.656 ↓ 336.0 336 1

Nested Loop (cost=19.98..8,963.51 rows=1 width=7) (actual time=4.316..398.656 rows=336 loops=1)

3. 1.524 389.149 ↓ 1,884.0 1,884 1

Nested Loop (cost=19.70..8,959.90 rows=1 width=14) (actual time=1.959..389.149 rows=1,884 loops=1)

4. 1.201 381.973 ↓ 1,884.0 1,884 1

Nested Loop (cost=19.27..8,956.14 rows=1 width=26) (actual time=1.941..381.973 rows=1,884 loops=1)

5. 2.107 55.512 ↓ 12.4 780 1

Nested Loop (cost=18.70..8,456.37 rows=63 width=12) (actual time=1.162..55.512 rows=780 loops=1)

6. 13.044 13.544 ↓ 5.9 4,429 1

Bitmap Heap Scan on processo_cnj_classes pcc (cost=18.28..2,228.62 rows=755 width=4) (actual time=0.787..13.544 rows=4,429 loops=1)

  • Recheck Cond: (fk_cnj_classe = 282)
  • Heap Blocks: exact=2463
7. 0.500 0.500 ↓ 5.9 4,429 1

Bitmap Index Scan on ind_processo_cnj_classes_fk_cnj_classe (cost=0.00..18.09 rows=755 width=0) (actual time=0.500..0.500 rows=4,429 loops=1)

  • Index Cond: (fk_cnj_classe = 282)
8. 39.861 39.861 ↓ 0.0 0 4,429

Index Scan using autos_repid on autos a (cost=0.43..8.25 rows=1 width=8) (actual time=0.009..0.009 rows=0 loops=4,429)

  • Index Cond: (id = pcc.fk_processo)
  • Filter: ((dt_distribuicao < '2018-11-01'::date) AND (st_fisica_processo = 0))
  • Rows Removed by Filter: 1
9. 325.260 325.260 ↓ 2.0 2 780

Index Scan using ind_processosandamentos_processo3 on processosandamentos pa2 (cost=0.56..7.92 rows=1 width=14) (actual time=0.291..0.417 rows=2 loops=780)

  • Index Cond: ((fkprocesso = a.id) AND (fklotacao = a.fk_lotacao))
  • Filter: ((date(dtfinalizacao) >= '2018-11-01'::date) AND (date(dtfinalizacao) <= '2018-11-30'::date))
  • Rows Removed by Filter: 113
10. 5.652 5.652 ↑ 1.0 1 1,884

Index Only Scan using ind_processo_1g_fk_processo on processo_1g p1g (cost=0.43..3.75 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=1,884)

  • Index Cond: (fk_processo = a.id)
  • Heap Fetches: 7
11. 7.536 7.536 ↓ 0.0 0 1,884

Index Only Scan using ind_pe_login_fk_tipo_especialidade on pessoas_especialidade pe (cost=0.29..3.60 rows=1 width=11) (actual time=0.004..0.004 rows=0 loops=1,884)

  • Index Cond: ((login = (pa2.usuario)::text) AND (fk_lotacao = pa2.fklotacao))
  • Filter: (fk_tipo_especialidade = ANY ('{1,3,5,6,16,9,40}'::integer[]))
  • Rows Removed by Filter: 0
  • Heap Fetches: 60
Planning time : 4.005 ms
Execution time : 399.111 ms