explain.depesz.com

PostgreSQL's explain analyze made readable

Result: y5vw

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 4,477.424 ↓ 0.0 0 1

Hash Join (cost=69,073.24..1,988,648.89 rows=641 width=12) (actual time=4,477.424..4,477.424 rows=0 loops=1)

  • Hash Cond: ((ta.id_fluxo)::integer = (f.id_fluxo)::integer)
  • time=0.030..184.217 rows=136560 loops=1)
  • loops=1)
  • loops=50069)
  • Planning time: 13.512 ms
  • Execution time: 4479.242 ms
2. 119.095 4,477.355 ↓ 0.0 0 1

Hash Left Join (cost=69,070.33..1,988,625.94 rows=641 width=16) (actual time=4,477.355..4,477.355 rows=0 loops=1)

  • Hash Cond: (((ptc.id_caixa)::integer = (c.id_caixa)::integer) AND ((tj.id_tarefa)::integer = (c.id_tarefa)::integer))
  • Filter: ((((taskinstan0_.id_)::text || (COALESCE((c.id_caixa)::integer, 999))::text))::bigint = '33504073999'::bigint)
  • Rows Removed by Filter: 141666
3. 219.722 4,348.217 ↓ 1.1 141,666 1

Hash Left Join (cost=68,693.17..1,987,253.63 rows=128,116 width=20) (actual time=1,808.913..4,348.217 rows=141,666 loops=1)

  • Hash Cond: (pj.id_processo = (ptc.id_processo_trf)::integer)
  • Join Filter: (SubPlan 1)
  • Rows Removed by Join Filter: 66533
4. 114.562 3,221.430 ↓ 1.0 128,815 1

Hash Join (cost=65,565.92..95,946.86 rows=128,116 width=24) (actual time=1,717.482..3,221.430 rows=128,815 loops=1)

  • Hash Cond: (taskinstan0_.task_ = (tj.id_jbpm_task)::integer)
5. 154.744 3,071.848 ↓ 1.0 128,815 1

Hash Join (cost=64,728.35..93,188.07 rows=128,012 width=24) (actual time=1,682.378..3,071.848 rows=128,815 loops=1)

  • Hash Cond: (pj.id_processo = (proc.id_processo)::integer)
6. 154.927 2,434.122 ↓ 1.0 128,815 1

Hash Join (cost=52,830.00..79,532.10 rows=128,012 width=24) (actual time=1,198.814..2,434.122 rows=128,815 loops=1)

  • Hash Cond: (taskinstan0_.procinst_ = fpf.id_procinst)
7. 1,012.841 1,354.163 ↓ 1.0 128,815 1

Merge Join (cost=24,999.35..49,940.37 rows=128,256 width=28) (actual time=271.254..1,354.163 rows=128,815 loops=1)

  • Merge Cond: (taskinstan0_.token_ = pj.id_token)
  • -> Index Scan using tb_processo_jbpm_id_token_idx on tb_processo_jbpm pj (cost=0.42..21038.80 rows=793353 width=8) (actual time=0.019
8. 341.322 341.322 ↓ 1.0 128,866 1

Sort (cost=24,998.81..25,318.52 rows=127,881 width=32) (actual time=271.227..341.322 rows=128,866 loops=1)

  • Sort Key: taskinstan0_.token_
  • Sort Method: quicksort Memory: 16573kB
  • -> Index Scan using jbpm_taskinstance_ix_1 on jbpm_taskinstance taskinstan0_ (cost=0.42..14151.66 rows=127881 width=32) (actual
  • Filter: (in_ativo = 'S'::bpchar)
  • Rows Removed by Filter: 5115
9. 925.032 925.032 ↓ 1.0 771,229 1

Hash (cost=18,227.82..18,227.82 rows=768,226 width=12) (actual time=925.032..925.032 rows=771,229 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 41331kB
  • -> Index Scan using tb_processinstance_fluxo_principal_pkey on tb_processinstance_fluxo_principal fpf (cost=0.42..18227.82 rows=76822
10. 75.556 482.982 ↓ 1.0 130,597 1

Hash (cost=10,269.20..10,269.20 rows=130,332 width=8) (actual time=482.982..482.982 rows=130,597 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 6126kB
11. 407.426 407.426 ↓ 1.0 130,597 1

Merge Join (cost=0.86..10,269.20 rows=130,332 width=8) (actual time=0.077..407.426 rows=130,597 loops=1)

  • Merge Cond: ((proc.id_processo)::integer = (proctrf.id_processo_trf)::integer)
  • -> Index Only Scan using sys_c005762 on tb_processo proc (cost=0.42..5170.50 rows=130591 width=4) (actual time=0.040..122.773 rows=13
  • Heap Fetches: 87279
  • -> Index Only Scan using tb_processo_trf_fk on tb_processo_trf proctrf (cost=0.42..3154.73 rows=130332 width=4) (actual time=0.033..1
  • Heap Fetches: 99320
12. 5.042 35.020 ↑ 1.0 9,549 1

Hash (cost=718.20..718.20 rows=9,549 width=20) (actual time=35.020..35.020 rows=9,549 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 651kB
13. 8.175 29.978 ↑ 1.0 9,549 1

Hash Join (cost=31.10..718.20 rows=9,549 width=20) (actual time=0.463..29.978 rows=9,549 loops=1)

  • Hash Cond: ((tj.id_tarefa)::integer = (ta.id_tarefa)::integer)
14. 21.388 21.388 ↑ 1.0 9,549 1

Merge Join (cost=0.57..556.37 rows=9,549 width=16) (actual time=0.031..21.388 rows=9,549 loops=1)

  • Merge Cond: ((tj.id_jbpm_task)::integer = task4_.id_)
  • -> Index Scan using idx_tb_tarefa_jbpm1 on tb_tarefa_jbpm tj (cost=0.29..226.42 rows=9549 width=8) (actual time=0.005..4.877 rows=954
  • -> Index Only Scan using jbpm_task_pkey on jbpm_task task4_ (cost=0.29..185.73 rows=9943 width=8) (actual time=0.022..4.315 rows=9959
  • Heap Fetches: 0
15. 0.108 0.415 ↑ 1.0 245 1

Hash (cost=27.47..27.47 rows=245 width=8) (actual time=0.415..0.415 rows=245 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
16. 0.307 0.307 ↑ 1.0 245 1

Index Scan using tb_tarefa_pkey on tb_tarefa ta (cost=0.14..27.47 rows=245 width=8) (actual time=0.005..0.307 rows=245 loops=1)

17. 90.851 90.851 ↑ 1.0 74,348 1

Hash (cost=2,197.89..2,197.89 rows=74,349 width=8) (actual time=90.851..90.851 rows=74,348 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 3929kB
  • -> Index Only Scan using tb_processo_trf_caixa_unq on tb_processo_trf_caixa ptc (cost=0.42..2197.89 rows=74349 width=8) (actual time=0.052..53.899 rows
  • Heap Fetches: 73985
18.          

SubPlan (forHash Left Join)

19. 148.853 816.214 ↓ 0.0 0 116,602

Nested Loop Anti Join (cost=0.99..14.84 rows=1 width=0) (actual time=0.007..0.007 rows=0 loops=116,602)

  • Join Filter: (c2.id_caixa_superior = (ic.id_caixa)::integer)
20. 116.602 116.602 ↓ 0.0 0 116,602

Index Only Scan using idx_tb_caixa3 on tb_caixa ic (cost=0.29..2.51 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=116,602)

  • Index Cond: ((id_caixa = (ptc.id_caixa)::integer) AND (id_tarefa = (tj.id_tarefa)::integer) AND (id_fluxo_principal = fpf.id_fluxo_principal))
  • Heap Fetches: 22236
21. 390.796 550.759 ↓ 0.0 0 50,069

Nested Loop (cost=0.70..12.32 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=50,069)

  • -> Index Scan using idx_tb_processo_trf_caixa01 on tb_processo_trf_caixa ptc2 (cost=0.42..4.78 rows=3 width=4) (actual time=0.002..0.004 rows=3
  • Index Cond: ((id_processo_trf)::integer = (ptc.id_processo_trf)::integer)
22. 159.963 159.963 ↓ 0.0 0 159,963

Index Scan using idx_tb_caixa3 on tb_caixa c2 (cost=0.29..2.51 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=159,963)

  • Index Cond: ((id_caixa)::integer = (ptc2.id_caixa)::integer)
  • Filter: (id_caixa_superior = (ptc.id_caixa)::integer)
  • Rows Removed by Filter: 1
23. 4.519 10.043 ↓ 1.0 8,836 1

Hash (cost=244.78..244.78 rows=8,825 width=8) (actual time=10.043..10.043 rows=8,836 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 474kB
24. 5.524 5.524 ↓ 1.0 8,893 1

Index Only Scan using idx_tb_caixa3 on tb_caixa c (cost=0.29..244.78 rows=8,825 width=8) (actual time=0.031..5.524 rows=8,893 loops=1)

  • Heap Fetches: 4275
25. 0.018 0.052 ↑ 1.0 21 1

Hash (cost=2.65..2.65 rows=21 width=4) (actual time=0.052..0.052 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.034 0.034 ↑ 1.0 21 1

Index Only Scan using sys_c005738 on tb_fluxo f (cost=0.14..2.65 rows=21 width=4) (actual time=0.025..0.034 rows=21 loops=1)

  • Heap Fetches: 0