explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ic9G

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 752.255 ↓ 6.0 6 1

Limit (cost=4,362.37..4,362.49 rows=1 width=631) (actual time=752.241..752.255 rows=6 loops=1)

2. 0.010 752.247 ↓ 6.0 6 1

Unique (cost=4,362.37..4,362.49 rows=1 width=631) (actual time=752.237..752.247 rows=6 loops=1)

3. 0.124 752.237 ↓ 6.0 6 1

Sort (cost=4,362.37..4,362.38 rows=1 width=631) (actual time=752.237..752.237 rows=6 loops=1)

  • Sort Key: ptf.in_prioridade DESC, ppe.id_processo_parte_expediente DESC, ptf.id_processo_trf, ptf.nr_processo, ptf.nr_sequencia, ptf.nr_ano, ptf.dt_distribuicao, ptf.nm_pessoa_autor, ptf.qt_autor, ptf.nm_pessoa_reu, ptf.qt_reu, ptf.id_orgao_julga
  • Sort Method: quicksort Memory: 29kB
4. 0.340 752.113 ↓ 8.0 8 1

Nested Loop Semi Join (cost=16.10..4,362.36 rows=1 width=631) (actual time=722.169..752.113 rows=8 loops=1)

5. 69.310 750.731 ↓ 521.0 521 1

Nested Loop (cost=15.67..4,346.32 rows=1 width=475) (actual time=73.669..750.731 rows=521 loops=1)

  • Join Filter: ((ppe.id_processo_parte_expediente)::integer = fcx_exp.id_processo_parte_expediente)
  • Rows Removed by Join Filter: 1163479
6. 0.972 186.721 ↓ 1,940.0 1,940 1

Nested Loop Left Join (cost=2.13..3,092.01 rows=1 width=475) (actual time=0.490..186.721 rows=1,940 loops=1)

7. 1.778 172.169 ↓ 1,940.0 1,940 1

Nested Loop (cost=1.71..3,083.77 rows=1 width=463) (actual time=0.455..172.169 rows=1,940 loops=1)

8. 30.597 166.511 ↓ 1,940.0 1,940 1

Nested Loop (cost=1.28..3,075.35 rows=1 width=437) (actual time=0.429..166.511 rows=1,940 loops=1)

  • Join Filter: ((pe.id_tipo_processo_documento)::integer = (tpd.id_tipo_processo_documento)::integer)
  • Rows Removed by Join Filter: 409340
9. 1.114 104.874 ↓ 1,940.0 1,940 1

Nested Loop (cost=1.28..3,067.58 rows=1 width=416) (actual time=0.401..104.874 rows=1,940 loops=1)

10. 2.918 53.320 ↓ 1,940.0 1,940 1

Nested Loop (cost=0.85..3,059.13 rows=1 width=402) (actual time=0.359..53.320 rows=1,940 loops=1)

11. 0.411 24.352 ↓ 23.1 2,605 1

Nested Loop (cost=0.43..2,107.71 rows=113 width=97) (actual time=0.118..24.352 rows=2,605 loops=1)

12. 0.000 0.000 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1)

13. 23.941 23.941 ↓ 23.1 2,605 1

Index Scan using tb_proc_parte_exp_idx_procur on tb_proc_parte_expediente ppe (cost=0.43..2,106.56 rows=113 width=97) (actual time=0.116..23.941 rows=2,605 loops=1)

  • Index Cond: ((id_procuradoria = 43) AND (in_fechado = true) AND (in_intima_pessoal = false) AND (in_intima_pessoal = false))
  • Filter: ((NOT in_intima_pessoal) AND in_fechado AND (id_resposta IS NOT NULL) AND (NOT in_intima_pessoal))
  • Rows Removed by Filter: 574
14. 26.050 26.050 ↑ 1.0 1 2,605

Index Scan using tb_cabecalho_processo_pkey on tb_cabecalho_processo ptf (cost=0.42..8.41 rows=1 width=309) (actual time=0.010..0.010 rows=1 loops=2,605)

  • Index Cond: ((id_processo_trf)::integer = (ppe.id_processo_trf)::integer)
  • Filter: ((id_jurisdicao)::integer = 15)
  • Rows Removed by Filter: 0
15. 50.440 50.440 ↑ 1.0 1 1,940

Index Scan using idx_tb_processo_expediente2 on tb_processo_expediente pe (cost=0.43..8.45 rows=1 width=18) (actual time=0.026..0.026 rows=1 loops=1,940)

  • Index Cond: ((id_processo_expediente)::integer = (ppe.id_processo_expediente)::integer)
16. 31.040 31.040 ↑ 1.0 212 1,940

Seq Scan on tb_tipo_processo_documento tpd (cost=0.00..5.12 rows=212 width=25) (actual time=0.002..0.016 rows=212 loops=1,940)

17. 3.880 3.880 ↑ 1.0 1 1,940

Index Scan using tb_usuario_pkey on tb_usuario_login ul (cost=0.42..8.41 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=1,940)

  • Index Cond: (id_usuario = (ppe.id_pessoa_parte)::integer)
18. 13.580 13.580 ↑ 1.0 1 1,940

Index Scan using pk_tb_resposta_expediente on tb_resposta_expediente rex (cost=0.42..8.23 rows=1 width=12) (actual time=0.007..0.007 rows=1 loops=1,940)

  • Index Cond: (id = ppe.id_resposta)
19. 104.760 494.700 ↑ 1.0 600 1,940

Nested Loop (cost=13.54..1,246.50 rows=625 width=4) (actual time=0.054..0.255 rows=600 loops=1,940)

20. 3.880 3.880 ↑ 1.0 1 1,940

Index Scan using tb_caixa_adv_proc_pkey on tb_caixa_adv_proc caixa (cost=0.28..8.30 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1,940)

  • Index Cond: ((id_caixa_adv_proc)::integer = 543)
  • Filter: ((id_localizacao)::integer = 16547)
21. 312.340 386.060 ↑ 1.0 600 1,940

Bitmap Heap Scan on tb_proc_parte_exp_caixa_adv_proc fcx_exp (cost=13.26..1,231.95 rows=625 width=8) (actual time=0.051..0.199 rows=600 loops=1,940)

  • Recheck Cond: (id_caixa_adv_proc = 543)
  • Heap Blocks: exact=370540
22. 73.720 73.720 ↑ 1.0 600 1,940

Bitmap Index Scan on tb_proc_parte_exp_caixa_adv_proc_id_caixa_adv_proc_idx (cost=0.00..13.11 rows=625 width=0) (actual time=0.038..0.038 rows=600 loops=1,940)

  • Index Cond: (id_caixa_adv_proc = 543)
23. 1.042 1.042 ↓ 0.0 0 521

Index Scan using pk_tb_resposta_expediente on tb_resposta_expediente (cost=0.42..8.24 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=521)

  • Index Cond: (id = ppe.id_resposta)
  • Filter: ((dt_registro >= '2019-04-3