explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1AXV : test1

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.085 1,522.382 ↓ 17.5 35 1

Sort (cost=1,128,307.29..1,128,307.30 rows=2 width=353) (actual time=1,522.380..1,522.382 rows=35 loops=1)

  • Sort Key: instancia_da_tarefa_interno.name_
  • Sort Method: quicksort Memory: 30kB
  • Buffers: shared hit=696721, temp read=171 written=172
2. 0.026 1,522.297 ↓ 17.5 35 1

Unique (cost=1,128,307.21..1,128,307.26 rows=2 width=353) (actual time=1,522.269..1,522.297 rows=35 loops=1)

  • Buffers: shared hit=696718, temp read=171 written=172
3. 0.091 1,522.271 ↓ 17.5 35 1

Sort (cost=1,128,307.21..1,128,307.21 rows=2 width=353) (actual time=1,522.267..1,522.271 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=696718, temp read=171 written=172
4. 0.006 1,522.180 ↓ 17.5 35 1

Append (cost=1,013,784.42..1,128,307.20 rows=2 width=353) (actual time=1,072.851..1,522.180 rows=35 loops=1)

  • Buffers: shared hit=696709, temp read=171 written=172
5. 4.983 1,076.336 ↓ 35.0 35 1

GroupAggregate (cost=1,013,784.42..1,014,701.21 rows=1 width=240) (actual time=1,072.850..1,076.336 rows=35 loops=1)

  • Group Key: instancia_da_tarefa_interno.name_
  • Buffers: shared hit=657277, temp read=171 written=172
6. 19.480 1,071.353 ↑ 2.9 17,917 1

Sort (cost=1,013,784.42..1,013,915.39 rows=52,387 width=68) (actual time=1,068.650..1,071.353 rows=17,917 loops=1)

  • Sort Key: instancia_da_tarefa_interno.name_
  • Sort Method: external merge Disk: 1368kB
  • Buffers: shared hit=657277, temp read=171 written=172
7. 33.298 1,051.873 ↑ 2.9 17,917 1

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

  • Buffers: shared hit=657276
8. 23.296 453.461 ↑ 1.0 51,374 1

Nested Loop (cost=1.29..44,381.13 rows=52,387 width=16) (actual time=0.129..453.461 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. 12.251 89.343 ↓ 1.0 17,938 1

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

  • Buffers: shared hit=71918
10. 5.340 5.340 ↓ 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.075..5.340 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. 340.822 340.822 ↑ 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.019 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. 15.540 308.244 ↓ 0.0 0 51,374

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

  • Buffers: shared hit=277484
19. 256.870 256.870 ↓ 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.005..0.005 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.002 445.838 ↓ 0.0 0 1

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

  • Group Key: instancia_da_tarefa_interno_1.name_
  • Buffers: shared hit=39432
26. 0.010 445.836 ↓ 0.0 0 1

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

  • Sort Key: instancia_da_tarefa_interno_1.name_
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=39432
27. 0.031 445.826 ↓ 0.0 0 1

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

  • Buffers: shared hit=39432
28. 4.786 445.643 ↑ 1.5 8 1

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

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=39400
29. 0.049 440.857 ↑ 1.7 3 3

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

  • Buffers: shared hit=97936
30. 0.365 440.787 ↑ 1.7 3 3

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

  • Buffers: shared hit=97902
31. 440.413 440.413 ↓ 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=21.964..440.413 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=97600
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.021 0.021 ↑ 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.021..0.021 rows=1 loops=8)

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

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

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

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

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

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

  • Buffers: shared hit=32
37. 0.000 0.104 ↓ 0.0 0 8

Nested Loop Semi Join (cost=1.57..10.48 rows=1 width=63) (actual time=0.013..0.013 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.008 0.104 ↓ 0.0 0 8

Nested Loop Left Join (cost=1.14..7.81 rows=1 width=71) (actual time=0.013..0.013 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.096 ↓ 0.0 0 8

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

  • Buffers: shared hit=32
40. 0.088 0.088 ↓ 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.011..0.011 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 : 18.662 ms
Execution time : 1,540.659 ms