explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DFbk : teste2

Settings
# exclusive inclusive rows x rows loops node
1. 0.059 1,537.070 ↓ 17.5 35 1

Sort (cost=1,127,048.59..1,127,048.60 rows=2 width=353) (actual time=1,537.068..1,537.070 rows=35 loops=1)

  • Sort Key: instancia_da_tarefa_interno.name_
  • Sort Method: quicksort Memory: 30kB
  • Buffers: shared hit=698843
2. 0.026 1,537.011 ↓ 17.5 35 1

Unique (cost=1,127,048.51..1,127,048.56 rows=2 width=353) (actual time=1,536.983..1,537.011 rows=35 loops=1)

  • Buffers: shared hit=698840
3. 0.087 1,536.985 ↓ 17.5 35 1

Sort (cost=1,127,048.51..1,127,048.51 rows=2 width=353) (actual time=1,536.982..1,536.985 rows=35 loops=1)

  • Sort Key: (max((max(instancia_da_tarefa_interno.token_)))), instancia_da_tarefa_interno.name_, (max((max((tarefa_no_jbpm.id_tarefa)::integer)))), (sum((count(processo_lote.id_lote)))), (sum((count(caixa.nm_caixa)))), (sum((count(instancia_da_tarefa_interno.token_)))), ('Task'::text), ('false'::text), ('caixa'::text), (1)
  • Sort Method: quicksort Memory: 30kB
  • Buffers: shared hit=698840
4. 0.006 1,536.898 ↓ 17.5 35 1

Append (cost=1,012,525.72..1,127,048.50 rows=2 width=353) (actual time=1,084.901..1,536.898 rows=35 loops=1)

  • Buffers: shared hit=698831
5. 4.139 1,087.304 ↓ 35.0 35 1

GroupAggregate (cost=1,012,525.72..1,013,442.51 rows=1 width=240) (actual time=1,084.900..1,087.304 rows=35 loops=1)

  • Group Key: instancia_da_tarefa_interno.name_
  • Buffers: shared hit=657276
6. 11.051 1,083.165 ↑ 2.9 17,917 1

Sort (cost=1,012,525.72..1,012,656.69 rows=52,387 width=68) (actual time=1,082.317..1,083.165 rows=17,917 loops=1)

  • Sort Key: instancia_da_tarefa_interno.name_
  • Sort Method: quicksort Memory: 3288kB
  • Buffers: shared hit=657276
7. 39.609 1,072.114 ↑ 2.9 17,917 1

Nested Loop (cost=19.52..1,008,419.38 rows=52,387 width=68) (actual time=0.333..1,072.114 rows=17,917 loops=1)

  • Buffers: shared hit=657276
8. 19.907 467.391 ↑ 1.0 51,374 1

Nested Loop (cost=1.29..44,381.13 rows=52,387 width=16) (actual time=0.130..467.391 rows=51,374 loops=1)

  • Join Filter: ((instancia_do_processo.id_orgao_julgador IS NULL) OR ((instancia_do_processo.id_orgao_julgador)::integer = (processo_trf.id_orgao_julgador)::integer))
  • Buffers: shared hit=289018
9. 11.329 88.724 ↓ 1.0 17,938 1

Nested Loop (cost=0.85..22,968.11 rows=17,929 width=16) (actual time=0.093..88.724 rows=17,938 loops=1)

  • Buffers: shared hit=71918
10. 5.643 5.643 ↓ 1.0 17,938 1

Index Only Scan using idx_tjpe_idx_tb_processo_trf3 on tb_processo_trf processo_trf (cost=0.43..405.91 rows=17,929 width=8) (actual time=0.066..5.643 rows=17,938 loops=1)

  • Index Cond: (id_orgao_julgador = 14)
  • Heap Fetches: 111
  • Buffers: shared hit=114
11. 71.752 71.752 ↑ 1.0 1 17,938

Index Scan using sys_c005762 on tb_processo processo (cost=0.43..1.26 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=17,938)

  • Index Cond: ((id_processo)::integer = (processo_trf.id_processo_trf)::integer)
  • Buffers: shared hit=71804
12. 358.760 358.760 ↑ 2.7 3 17,938

Index Scan using idx_processo_instance_1 on tb_processo_instance instancia_do_processo (cost=0.43..1.09 rows=8 width=16) (actual time=0.006..0.020 rows=3 loops=17,938)

  • Index Cond: (id_processo = (processo.id_processo)::integer)
  • Filter: in_ativo
  • Rows Removed by Filter: 11
  • Buffers: shared hit=217100
13. 0.000 565.114 ↓ 0.0 0 51,374

GroupAggregate (cost=18.23..18.38 rows=1 width=68) (actual time=0.011..0.011 rows=0 loops=51,374)

  • Group Key: instancia_da_tarefa_interno.name_
  • Buffers: shared hit=368258
14. 102.748 565.114 ↓ 0.0 0 51,374

Sort (cost=18.23..18.25 rows=8 width=67) (actual time=0.011..0.011 rows=0 loops=51,374)

  • Sort Key: instancia_da_tarefa_interno.name_
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=368258
15. 33.457 462.366 ↓ 0.0 0 51,374

Nested Loop Left Join (cost=2.88..18.11 rows=8 width=67) (actual time=0.009..0.009 rows=0 loops=51,374)

  • Buffers: shared hit=368258
16. 13.163 410.992 ↓ 0.0 0 51,374

Nested Loop Semi Join (cost=1.57..10.48 rows=1 width=63) (actual time=0.008..0.008 rows=0 loops=51,374)

  • Join Filter: (instancia_da_tarefa_interno.task_ = (localizacao_do_processo.id_task_jbpm)::integer)
  • Rows Removed by Join Filter: 0
  • Buffers: shared hit=350341
17. 0.000 308.244 ↓ 0.0 0 51,374

Nested Loop Left Join (cost=1.14..7.81 rows=1 width=71) (actual time=0.006..0.006 rows=0 loops=51,374)

  • Join Filter: ((caixa.id_tarefa)::integer = (tarefa_no_jbpm.id_tarefa)::integer)
  • Buffers: shared hit=278593
18. 66.914 308.244 ↓ 0.0 0 51,374

Nested Loop Left Join (cost=0.85..5.30 rows=1 width=52) (actual time=0.005..0.006 rows=0 loops=51,374)

  • Buffers: shared hit=277484
19. 205.496 205.496 ↓ 0.0 0 51,374

Index Scan using idx_tskinst_vwprocesso on jbpm_taskinstance instancia_da_tarefa_interno (cost=0.56..2.79 rows=1 width=48) (actual time=0.004..0.004 rows=0 loops=51,374)

  • Index Cond: ((procinst_ = instancia_do_processo.id_proc_inst) AND (isopen_ = true) AND (issuspended_ = false))
  • Filter: ((NOT issuspended_) AND isopen_)
  • Buffers: shared hit=223691
20. 35.834 35.834 ↑ 1.0 1 17,917

Index Scan using idx_tb_tarefa_jbpm1 on tb_tarefa_jbpm tarefa_no_jbpm (cost=0.29..2.50 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=17,917)

  • Index Cond: ((id_jbpm_task)::integer = instancia_da_tarefa_interno.task_)
  • Buffers: shared hit=53793
21. 0.000 0.000 ↓ 0.0 0 17,917

Index Scan using tb_caixa_pkey on tb_caixa caixa (cost=0.29..2.51 rows=1 width=23) (actual time=0.000..0.000 rows=0 loops=17,917)

  • Index Cond: ((processo.id_caixa)::integer = (id_caixa)::integer)
  • Buffers: shared hit=1109
22. 89.585 89.585 ↑ 1.0 1 17,917

Index Scan using idx_tjrn_tb_proc_localizacao_ibpm_05 on tb_proc_localizacao_ibpm localizacao_do_processo (cost=0.43..2.66 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=17,917)

  • Index Cond: (((id_processo)::integer = (processo_trf.id_processo_trf)::integer) AND ((id_localizacao)::integer = 5) AND ((id_papel)::integer = 1338))
  • Buffers: shared hit=71748
23. 0.000 17.917 ↓ 0.0 0 17,917

Bitmap Heap Scan on tb_processo_lote processo_lote (cost=1.31..7.55 rows=8 width=4) (actual time=0.001..0.001 rows=0 loops=17,917)

  • Recheck Cond: ((processo_trf.id_processo_trf)::integer = (id_processo_trf)::integer)
  • Buffers: shared hit=17917
24. 17.917 17.917 ↓ 0.0 0 17,917

Bitmap Index Scan on idx_tb_processo_lote1 (cost=0.00..1.31 rows=8 width=0) (actual time=0.001..0.001 rows=0 loops=17,917)

  • Index Cond: ((processo_trf.id_processo_trf)::integer = (id_processo_trf)::integer)
  • Buffers: shared hit=17917
25. 0.001 449.588 ↓ 0.0 0 1

GroupAggregate (cost=113,605.74..113,605.97 rows=1 width=240) (actual time=449.588..449.588 rows=0 loops=1)

  • Group Key: instancia_da_tarefa_interno_1.name_
  • Buffers: shared hit=41555
26. 0.009 449.587 ↓ 0.0 0 1

Sort (cost=113,605.74..113,605.77 rows=12 width=68) (actual time=449.587..449.587 rows=0 loops=1)

  • Sort Key: instancia_da_tarefa_interno_1.name_
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=41555
27. 0.013 449.578 ↓ 0.0 0 1

Nested Loop (cost=1,019.52..113,605.53 rows=12 width=68) (actual time=449.578..449.578 rows=0 loops=1)

  • Buffers: shared hit=41555
28. 6.089 449.445 ↑ 1.5 8 1

Gather (cost=1,001.29..113,384.70 rows=12 width=16) (actual time=449.437..449.445 rows=8 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=41523
29. 0.060 443.356 ↑ 1.7 3 3

Nested Loop (cost=1.29..112,383.50 rows=5 width=16) (actual time=189.790..443.356 rows=3 loops=3)

  • Buffers: shared hit=97772
30. 0.383 443.271 ↑ 1.7 3 3

Nested Loop (cost=0.86..112,381.20 rows=5 width=16) (actual time=189.754..443.271 rows=3 loops=3)

  • Buffers: shared hit=97738
31. 442.879 442.879 ↓ 6.6 33 3

Parallel Index Scan using idx_tjrn_tb_processo_instance_01 on tb_processo_instance instancia_do_processo_1 (cost=0.43..112,372.95 rows=5 width=16) (actual time=29.550..442.879 rows=33 loops=3)

  • Index Cond: (in_ativo = true)
  • Filter: (in_ativo AND (id_orgao_julgador IS NOT NULL) AND ((id_orgao_julgador)::integer = 14))
  • Rows Removed by Filter: 1113768
  • Buffers: shared hit=97436
32. 0.009 0.009 ↓ 0.0 0 99

Index Only Scan using idx_tjrn_tb_processo_trf_01 on tb_processo_trf processo_trf_1 (cost=0.43..1.64 rows=1 width=8) (actual time=0.009..0.009 rows=0 loops=99)

  • Index Cond: (id_processo_trf = instancia_do_processo_1.id_processo)
  • Filter: ((instancia_do_processo_1.id_orgao_julgador)::integer <> (id_orgao_julgador)::integer)
  • Rows Removed by Filter: 1
  • Heap Fetches: 0
  • Buffers: shared hit=302
33. 0.025 0.025 ↑ 1.0 1 8

Index Scan using sys_c005762 on tb_processo processo_1 (cost=0.43..0.46 rows=1 width=8) (actual time=0.025..0.025 rows=1 loops=8)

  • Index Cond: ((id_processo)::integer = (processo_trf_1.id_processo_trf)::integer)
  • Buffers: shared hit=34
34. 0.000 0.120 ↓ 0.0 0 8

GroupAggregate (cost=18.23..18.38 rows=1 width=68) (actual time=0.015..0.015 rows=0 loops=8)

  • Group Key: instancia_da_tarefa_interno_1.name_
  • Buffers: shared hit=32
35. 0.032 0.120 ↓ 0.0 0 8

Sort (cost=18.23..18.25 rows=8 width=67) (actual time=0.015..0.015 rows=0 loops=8)

  • Sort Key: instancia_da_tarefa_interno_1.name_
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=32
36. 0.000 0.088 ↓ 0.0 0 8

Nested Loop Left Join (cost=2.88..18.11 rows=8 width=67) (actual time=0.011..0.011 rows=0 loops=8)

  • Buffers: shared hit=32
37. 0.008 0.088 ↓ 0.0 0 8

Nested Loop Semi Join (cost=1.57..10.48 rows=1 width=63) (actual time=0.011..0.011 rows=0 loops=8)

  • Join Filter: (instancia_da_tarefa_interno_1.task_ = (localizacao_do_processo_1.id_task_jbpm)::integer)
  • Buffers: shared hit=32
38. 0.000 0.080 ↓ 0.0 0 8

Nested Loop Left Join (cost=1.14..7.81 rows=1 width=71) (actual time=0.010..0.010 rows=0 loops=8)

  • Join Filter: ((caixa_1.id_tarefa)::integer = (tarefa_no_jbpm_1.id_tarefa)::integer)
  • Buffers: shared hit=32
39. 0.008 0.080 ↓ 0.0 0 8

Nested Loop Left Join (cost=0.85..5.30 rows=1 width=52) (actual time=0.010..0.010 rows=0 loops=8)

  • Buffers: shared hit=32
40. 0.072 0.072 ↓ 0.0 0 8

Index Scan using idx_tskinst_vwprocesso on jbpm_taskinstance instancia_da_tarefa_interno_1 (cost=0.56..2.79 rows=1 width=48) (actual time=0.009..0.009 rows=0 loops=8)

  • Index Cond: ((procinst_ = instancia_do_processo_1.id_proc_inst) AND (isopen_ = true) AND (issuspended_ = false))
  • Filter: ((NOT issuspended_) AND isopen_)
  • Buffers: shared hit=32
41. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_tb_tarefa_jbpm1 on tb_tarefa_jbpm tarefa_no_jbpm_1 (cost=0.29..2.50 rows=1 width=8) (never executed)

  • Index Cond: ((id_jbpm_task)::integer = instancia_da_tarefa_interno_1.task_)
42. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_caixa_pkey on tb_caixa caixa_1 (cost=0.29..2.51 rows=1 width=23) (never executed)

  • Index Cond: ((processo_1.id_caixa)::integer = (id_caixa)::integer)
43. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_tjrn_tb_proc_localizacao_ibpm_05 on tb_proc_localizacao_ibpm localizacao_do_processo_1 (cost=0.43..2.66 rows=1 width=4) (never executed)

  • Index Cond: (((id_processo)::integer = (processo_trf_1.id_processo_trf)::integer) AND ((id_localizacao)::integer = 5) AND ((id_papel)::integer = 1338))
44. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_processo_lote processo_lote_1 (cost=1.31..7.55 rows=8 width=4) (never executed)

  • Recheck Cond: ((processo_trf_1.id_processo_trf)::integer = (id_processo_trf)::integer)
45. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_tb_processo_lote1 (cost=0.00..1.31 rows=8 width=0) (never executed)

  • Index Cond: ((processo_trf_1.id_processo_trf)::integer = (id_processo_trf)::integer)
Planning time : 17.962 ms
Execution time : 1,559.299 ms