explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MmlW

Settings
# exclusive inclusive rows x rows loops node
1. 0.051 15,362.874 ↑ 23.0 3 1

GroupAggregate (cost=742,817.13..742,875.19 rows=69 width=59) (actual time=15,362.852..15,362.874 rows=3 loops=1)

  • Output: caixa.id_caixa_adv_proc, caixa.nm_caixa, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, max((1)), CASE WHEN (cx_in.id_caixa_adv_proc IS NULL) THEN true ELSE false END, count(DISTINCT ptf.id_processo_trf), cx_in.id_caixa_adv_proc
  • Group Key: caixa.nm_caixa, caixa.id_caixa_adv_proc, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, cx_in.id_caixa_adv_proc
2. 0.109 15,362.823 ↑ 29.7 86 1

Sort (cost=742,817.13..742,823.50 rows=2,550 width=59) (actual time=15,362.817..15,362.823 rows=86 loops=1)

  • Output: caixa.id_caixa_adv_proc, caixa.nm_caixa, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, cx_in.id_caixa_adv_proc, (1), ptf.id_processo_trf
  • Sort Key: caixa.nm_caixa, caixa.id_caixa_adv_proc, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, cx_in.id_caixa_adv_proc
  • Sort Method: quicksort Memory: 31kB
3. 0.110 15,362.714 ↑ 29.7 86 1

Hash Left Join (cost=667,858.12..742,672.85 rows=2,550 width=59) (actual time=12,888.035..15,362.714 rows=86 loops=1)

  • Output: caixa.id_caixa_adv_proc, caixa.nm_caixa, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, cx_in.id_caixa_adv_proc, (1), ptf.id_processo_trf
  • Hash Cond: ((pp.id_processo_parte)::integer = (pp_2.id_processo_parte)::integer)
4. 0.110 13,643.061 ↑ 29.7 86 1

Nested Loop Left Join (cost=664,634.99..739,363.65 rows=2,550 width=63) (actual time=11,168.475..13,643.061 rows=86 loops=1)

  • Output: (1), caixa.id_caixa_adv_proc, caixa.nm_caixa, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, ptf.id_processo_trf, pp.id_processo_parte, cx_in.id_caixa_adv_proc
5. 25.880 13,386.311 ↑ 35.9 16 1

Merge Right Join (cost=664,634.56..738,890.62 rows=575 width=59) (actual time=11,117.586..13,386.311 rows=16 loops=1)

  • Output: (1), caixa.id_caixa_adv_proc, caixa.nm_caixa, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, ptf.id_processo_trf, cx_in.id_caixa_adv_proc
  • Merge Cond: ((ptf.id_processo_trf)::integer = cx_proc.id_processo_trf)
6. 682.854 13,132.939 ↑ 3.0 330,911 1

Unique (cost=663,637.06..725,423.64 rows=996,868 width=116) (actual time=10,844.170..13,132.939 rows=330,911 loops=1)

  • Output: ptf.id_processo_trf, ptf.nr_processo, ptf.nr_sequencia, ptf.nr_digito_verificador, ptf.nr_ano, ptf.nr_identificacao_orgao_justica, ptf.nr_origem_processo, ptf.id_jurisdicao, ptf.id_classe_judicial, ptf.cd_classe_judi (...)
7. 5,116.074 12,450.085 ↑ 1.3 1,080,209 1

Sort (cost=663,637.06..667,271.56 rows=1,453,802 width=116) (actual time=10,844.169..12,450.085 rows=1,080,209 loops=1)

  • Output: ptf.id_processo_trf, ptf.nr_processo, ptf.nr_sequencia, ptf.nr_digito_verificador, ptf.nr_ano, ptf.nr_identificacao_orgao_justica, ptf.nr_origem_processo, ptf.id_jurisdicao, ptf.id_classe_judicial, ptf.cd_class (...)
  • Sort Key: ptf.id_processo_trf, ptf.nr_processo, ptf.nr_sequencia, ptf.nr_digito_verificador, ptf.nr_ano, ptf.nr_identificacao_orgao_justica, ptf.nr_origem_processo, ptf.id_classe_judicial, ptf.cd_classe_judicial, ptf.d (...)
  • Sort Method: external merge Disk: 181456kB
8. 1,150.537 7,334.011 ↑ 1.1 1,366,616 1

Hash Right Join (cost=396,033.00..425,384.25 rows=1,453,802 width=116) (actual time=5,107.195..7,334.011 rows=1,366,616 loops=1)

  • Output: ptf.id_processo_trf, ptf.nr_processo, ptf.nr_sequencia, ptf.nr_digito_verificador, ptf.nr_ano, ptf.nr_identificacao_orgao_justica, ptf.nr_origem_processo, ptf.id_jurisdicao, ptf.id_classe_judicial, ptf.cd (...)
  • Hash Cond: ((ppr.id_processo_parte)::integer = (pp_1.id_processo_parte)::integer)
  • Filter: ((NOT ptf.in_segredo_justica) OR (SubPlan 1))
  • Rows Removed by Filter: 179970
9. 0.258 0.258 ↓ 1.0 150 1

Index Scan using idx_tb_processo_parte_representante2 on client.tb_proc_parte_represntante ppr (cost=0.43..523.24 rows=145 width=8) (actual time=0.019..0.258 rows=150 loops=1)

  • Output: ppr.id_processo_parte, ppr.id_representante
  • Index Cond: ((ppr.id_representante)::integer = 35379)
10. 822.919 5,103.312 ↓ 1.0 1,546,586 1

Hash (cost=348,500.57..348,500.57 rows=1,530,560 width=125) (actual time=5,103.312..5,103.312 rows=1,546,586 loops=1)

  • Output: ptf.id_processo_trf, ptf.nr_processo, ptf.nr_sequencia, ptf.nr_digito_verificador, ptf.nr_ano, ptf.nr_identificacao_orgao_justica, ptf.nr_origem_processo, ptf.id_jurisdicao, ptf.id_classe_judicial, (...)
  • Buckets: 1048576 Batches: 4 Memory Usage: 72606kB
11. 2,082.121 4,280.393 ↓ 1.0 1,546,586 1

Hash Join (cost=171,885.69..348,500.57 rows=1,530,560 width=125) (actual time=767.071..4,280.393 rows=1,546,586 loops=1)

  • Output: ptf.id_processo_trf, ptf.nr_processo, ptf.nr_sequencia, ptf.nr_digito_verificador, ptf.nr_ano, ptf.nr_identificacao_orgao_justica, ptf.nr_origem_processo, ptf.id_jurisdicao, ptf.id_classe_judi (...)
  • Hash Cond: ((pp_1.id_processo_trf)::integer = (ptf.id_processo_trf)::integer)
12. 1,432.939 1,432.939 ↑ 1.0 6,693,575 1

Seq Scan on client.tb_processo_parte pp_1 (cost=0.00..136,204.67 rows=6,694,560 width=12) (actual time=0.010..1,432.939 rows=6,693,575 loops=1)

  • Output: pp_1.id_processo_parte, pp_1.id_processo_trf, pp_1.id_pessoa, pp_1.id_tipo_parte, pp_1.in_participacao, pp_1.in_segredo, pp_1.id_pessoa_doc_identificacao, pp_1.in_parte_principal, pp_1.i (...)
  • Filter: (pp_1.in_situacao = 'A'::bpchar)
  • Rows Removed by Filter: 109507
13. 236.684 765.333 ↑ 1.0 489,985 1

Hash (cost=165,655.27..165,655.27 rows=498,434 width=117) (actual time=765.333..765.333 rows=489,985 loops=1)

  • Output: ptf.id_processo_trf, ptf.nr_processo, ptf.nr_sequencia, ptf.nr_digito_verificador, ptf.nr_ano, ptf.nr_identificacao_orgao_justica, ptf.nr_origem_processo, ptf.id_jurisdicao, ptf.id_class (...)
  • Buckets: 524288 Batches: 1 Memory Usage: 79683kB
14. 471.239 528.649 ↑ 1.0 489,985 1

Bitmap Heap Scan on client.tb_cabecalho_processo ptf (cost=10,291.45..165,655.27 rows=498,434 width=117) (actual time=85.313..528.649 rows=489,985 loops=1)

  • Output: ptf.id_processo_trf, ptf.nr_processo, ptf.nr_sequencia, ptf.nr_digito_verificador, ptf.nr_ano, ptf.nr_identificacao_orgao_justica, ptf.nr_origem_processo, ptf.id_jurisdicao, ptf.id (...)
  • Recheck Cond: ((ptf.id_jurisdicao)::integer = 10)
  • Filter: (ptf.cd_processo_status = 'D'::bpchar)
  • Rows Removed by Filter: 53065
  • Heap Blocks: exact=111283
15. 57.410 57.410 ↑ 1.0 543,051 1

Bitmap Index Scan on idx_tb_cab_proc_id_jurisdicao (cost=0.00..10,166.84 rows=550,188 width=0) (actual time=57.410..57.410 rows=543,051 loops=1)

  • Index Cond: ((ptf.id_jurisdicao)::integer = 10)
16.          

SubPlan (forHash Right Join)

17. 179.984 1,079.904 ↓ 0.0 0 179,984

Bitmap Heap Scan on client.tb_proc_visibilida_segredo vis (cost=8.87..12.89 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=179,984)

  • Recheck Cond: ((((vis.id_pessoa)::integer = 35379) AND ((vis.id_processo_trf)::integer = (ptf.id_processo_trf)::integer)) OR (((vis.id_pessoa)::integer = (pp_1.id_pessoa)::integer) AND ((vis.id_processo_t (...)
  • Filter: (((vis.id_pessoa)::integer = 35379) OR (((vis.id_pessoa)::integer = (pp_1.id_pessoa)::integer) AND ((ppr.id_representante)::integer = 35379)))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=163324
18. 179.984 899.920 ↓ 0.0 0 179,984

BitmapOr (cost=8.87..8.87 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=179,984)

19. 179.984 179.984 ↓ 0.0 0 179,984

Bitmap Index Scan on idx_nome7 (cost=0.00..4.43 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=179,984)

  • Index Cond: (((vis.id_pessoa)::integer = 35379) AND ((vis.id_processo_trf)::integer = (ptf.id_processo_trf)::integer))
20. 539.952 539.952 ↑ 1.0 1 179,984

Bitmap Index Scan on idx_nome7 (cost=0.00..4.43 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=179,984)

  • Index Cond: (((vis.id_pessoa)::integer = (pp_1.id_pessoa)::integer) AND ((vis.id_processo_trf)::integer = (ptf.id_processo_trf)::integer))
21. 0.046 227.492 ↑ 7.7 16 1

Sort (cost=997.51..997.81 rows=123 width=59) (actual time=227.484..227.492 rows=16 loops=1)

  • Output: (1), caixa.id_caixa_adv_proc, caixa.nm_caixa, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, cx_proc.id_processo_trf, cx_in.id_caixa_adv_proc
  • Sort Key: cx_proc.id_processo_trf
  • Sort Method: quicksort Memory: 26kB
22. 0.033 227.446 ↑ 7.7 16 1

Hash Left Join (cost=60.05..993.24 rows=123 width=59) (actual time=74.367..227.446 rows=16 loops=1)

  • Output: (1), caixa.id_caixa_adv_proc, caixa.nm_caixa, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, cx_proc.id_processo_trf, cx_in.id_caixa_adv_proc
  • Hash Cond: ((caixa.id_caixa_adv_proc)::integer = (cx_in.id_caixa_adv_proc)::integer)
23. 0.034 227.409 ↑ 7.7 16 1

Nested Loop Left Join (cost=9.61..942.33 rows=123 width=55) (actual time=74.347..227.409 rows=16 loops=1)

  • Output: (1), caixa.id_caixa_adv_proc, caixa.nm_caixa, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao, cx_proc.id_processo_trf
24. 0.007 55.652 ↑ 1.0 3 1

Nested Loop (cost=4.40..40.71 rows=3 width=51) (actual time=37.363..55.652 rows=3 loops=1)

  • Output: (1), caixa.id_caixa_adv_proc, caixa.nm_caixa, caixa.ds_caixa, jur.id_jurisdicao, jur.ds_jurisdicao
25. 0.006 0.055 ↑ 1.0 1 1

Nested Loop (cost=0.00..4.35 rows=1 width=28) (actual time=0.027..0.055 rows=1 loops=1)

  • Output: (1), jur.id_jurisdicao, jur.ds_jurisdicao
26. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1)

  • Output: 1
27. 0.048 0.048 ↑ 1.0 1 1

Seq Scan on client.tb_jurisdicao jur (cost=0.00..4.33 rows=1 width=24) (actual time=0.021..0.048 rows=1 loops=1)

  • Output: jur.id_jurisdicao, jur.ds_jurisdicao, jur.in_ativo, jur.nr_origem, jur.id_estado, jur.id_aplicacao
  • Filter: ((jur.id_jurisdicao)::integer = 10)
  • Rows Removed by Filter: 185
28. 41.144 55.590 ↑ 1.0 3 1

Bitmap Heap Scan on client.tb_caixa_adv_proc caixa (cost=4.40..36.32 rows=3 width=27) (actual time=37.331..55.590 rows=3 loops=1)

  • Output: caixa.id_caixa_adv_proc, caixa.id_jurisdicao, caixa.id_orgao_julgador, caixa.id_localizacao, caixa.nm_caixa, caixa.ds_caixa, caixa.nr_sequencia, caixa.nr_digito_verificador, caixa.nr_ano, caix (...)
  • Recheck Cond: ((caixa.id_localizacao)::integer = 3033)
  • Filter: ((caixa.id_jurisdicao)::integer = 10)
  • Rows Removed by Filter: 12
  • Heap Blocks: exact=8
29. 14.446 14.446 ↑ 1.0 15 1

Bitmap Index Scan on idx_tb_caixa_adv_proc3 (cost=0.00..4.39 rows=15 width=0) (actual time=14.446..14.446 rows=15 loops=1)

  • Index Cond: ((caixa.id_localizacao)::integer = 3033)
30. 126.348 171.723 ↑ 20.6 5 3

Bitmap Heap Scan on client.tb_processo_caixa_adv_proc cx_proc (cost=5.22..299.51 rows=103 width=8) (actual time=25.885..57.241 rows=5 loops=3)

  • Output: cx_proc.id_processo_caixa_adv_proc, cx_proc.id_processo_trf, cx_proc.id_caixa_adv_proc
  • Recheck Cond: (cx_proc.id_caixa_adv_proc = (caixa.id_caixa_adv_proc)::integer)
  • Heap Blocks: exact=12
31. 45.375 45.375 ↑ 20.6 5 3

Bitmap Index Scan on idx_tb_processo_caixa_adv_proc2 (cost=0.00..5.19 rows=103 width=0) (actual time=15.125..15.125 rows=5 loops=3)

  • Index Cond: (cx_proc.id_caixa_adv_proc = (caixa.id_caixa_adv_proc)::integer)
32. 0.000 0.004 ↓ 0.0 0 1

Hash (cost=50.15..50.15 rows=23 width=4) (actual time=0.004..0.004 rows=0 loops=1)

  • Output: cx_in.id_caixa_adv_proc
  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
33. 0.003 0.004 ↓ 0.0 0 1

HashAggregate (cost=49.69..49.92 rows=23 width=4) (actual time=0.004..0.004 rows=0 loops=1)

  • Output: cx_in.id_caixa_adv_proc
  • Group Key: cx_in.id_caixa_adv_proc
34. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on client.tb_periodo_inativ_caixa_rep cx_in (cost=0.00..49.25 rows=177 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: cx_in.id_caixa_adv_proc
  • Filter: (((now() >= (cx_in.dt_inicio)::timestamp without time zone) AND (now() <= (cx_in.dt_fim)::timestamp without time zone)) OR (((cx_in.dt_inicio)::timestamp without time zone <= now()) AND (cx_in (...)
35. 256.640 256.640 ↓ 1.2 5 16

Index Scan using testeubd13 on client.tb_processo_parte pp (cost=0.43..0.78 rows=4 width=8) (actual time=16.030..16.040 rows=5 loops=16)

  • Output: pp.id_processo_parte, pp.id_processo_trf, pp.id_pessoa, pp.id_tipo_parte, pp.in_participacao, pp.in_segredo, pp.id_pessoa_doc_identificacao, pp.in_parte_principal, pp.in_endereco_desconhecido, pp.in_situacao, pp.id_procura (...)
  • Index Cond: ((pp.id_processo_trf)::integer = (ptf.id_processo_trf)::integer)
36. 0.042 1,719.543 ↓ 1.1 276 1

Hash (cost=3,220.00..3,220.00 rows=250 width=4) (actual time=1,719.543..1,719.543 rows=276 loops=1)

  • Output: pp_2.id_processo_parte
  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
37. 0.433 1,719.501 ↓ 1.1 276 1

HashAggregate (cost=3,215.00..3,217.50 rows=250 width=4) (actual time=1,719.457..1,719.501 rows=276 loops=1)

  • Output: pp_2.id_processo_parte
  • Group Key: pp_2.id_processo_parte
38. 0.078 1,719.068 ↓ 1.2 290 1

Append (cost=0.86..3,214.38 rows=250 width=4) (actual time=93.291..1,719.068 rows=290 loops=1)

39. 0.255 1,071.631 ↓ 1.3 145 1

Nested Loop (cost=0.86..1,520.09 rows=114 width=4) (actual time=93.289..1,071.631 rows=145 loops=1)

  • Output: pp_2.id_processo_parte
40. 62.031 62.031 ↓ 1.2 145 1

Index Scan using idx_pessoa on client.tb_processo_parte pp_2 (cost=0.43..458.13 rows=126 width=8) (actual time=61.674..62.031 rows=145 loops=1)

  • Output: pp_2.id_processo_parte, pp_2.id_processo_trf, pp_2.id_pessoa, pp_2.id_tipo_parte, pp_2.in_participacao, pp_2.in_segredo, pp_2.id_pessoa_doc_identificacao, pp_2.in_parte_principal, pp_2.in_endereco_desconh (...)
  • Index Cond: ((pp_2.id_pessoa)::integer = 35379)
  • Filter: (pp_2.in_situacao = 'A'::bpchar)
  • Rows Removed by Filter: 4
41. 1,009.345 1,009.345 ↑ 1.0 1 145

Index Scan using tb_cabecalho_processo_pkey on client.tb_cabecalho_processo ptf_1 (cost=0.43..8.42 rows=1 width=4) (actual time=6.961..6.961 rows=1 loops=145)

  • Output: ptf_1.id_processo_trf, ptf_1.nr_processo, ptf_1.nr_sequencia, ptf_1.nr_digito_verificador, ptf_1.nr_ano, ptf_1.nr_identificacao_orgao_justica, ptf_1.cd_processo_status, ptf_1.vl_causa, ptf_1.dt_autuacao, (...)
  • Index Cond: ((ptf_1.id_processo_trf)::integer = (pp_2.id_processo_trf)::integer)
  • Filter: (ptf_1.cd_processo_status = 'D'::bpchar)
42. 0.262 647.359 ↓ 1.1 145 1

Nested Loop (cost=0.86..1,691.79 rows=136 width=4) (actual time=6.747..647.359 rows=145 loops=1)

  • Output: pp_3.id_processo_parte
43. 0.397 0.397 ↓ 1.1 145 1

Index Scan using idx_tb_processo_parte_representante2 on client.tb_proc_parte_represntante ppr_1 (cost=0.43..523.96 rows=138 width=4) (actual time=0.021..0.397 rows=145 loops=1)

  • Output: ppr_1.id_proc_parte_representante, ppr_1.id_processo_parte, ppr_1.id_representante, ppr_1.id_tipo_representante, ppr_1.id_parte_representante, ppr_1.in_situacao
  • Index Cond: ((ppr_1.id_representante)::integer = 35379)
  • Filter: (((ppr_1.id_tipo_representante)::integer = 7) AND (ppr_1.in_situacao = 'A'::bpchar))
  • Rows Removed by Filter: 5
44. 646.700 646.700 ↑ 1.0 1 145

Index Only Scan using idx_pessoa_ubd1 on client.tb_processo_parte pp_3 (cost=0.43..8.45 rows=1 width=4) (actual time=4.460..4.460 rows=1 loops=145)

  • Output: pp_3.id_processo_parte, pp_3.id_pessoa, pp_3.in_situacao
  • Index Cond: ((pp_3.id_processo_parte = (ppr_1.id_processo_parte)::integer) AND (pp_3.in_situacao = 'A'::bpchar))
  • Heap Fetches: 145
Planning time : 2.287 ms
Execution time : 15,411.516 ms