explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cV9w

Settings
# exclusive inclusive rows x rows loops node
1. 0.742 0.742 ↑ 991.0 1 1

CTE Scan on execucoes_da_arvore_toda (cost=248,841.59..249,832.59 rows=991 width=1,130) (actual time=0.741..0.742 rows=1 loops=1)

2.          

CTE execucoes_da_arvore_toda_com_tentativas

3. 0.005 0.066 ↑ 991.0 1 1

Recursive Union (cost=86.00..12,106.91 rows=991 width=116) (actual time=0.051..0.066 rows=1 loops=1)

4. 0.048 0.048 ↑ 1.0 1 1

Index Scan using execucao_pkey on execucao execucao_raiz (cost=86.00..90.50 rows=1 width=116) (actual time=0.046..0.048 rows=1 loops=1)

  • Index Cond: (id = 55258568)
5. 0.004 0.013 ↓ 0.0 0 1

Nested Loop (cost=86.00..1,102.54 rows=99 width=116) (actual time=0.013..0.013 rows=0 loops=1)

6. 0.001 0.001 ↑ 10.0 1 1

WorkTable Scan on execucoes_da_arvore_toda_com_tentativas execucao_pai (cost=0.00..10.00 rows=10 width=8) (actual time=0.001..0.001 rows=1 loops=1)

7. 0.008 0.008 ↓ 0.0 0 1

Index Scan using idx_execucao_execucao_de_fluxo_id_idx on execucao execucao_filha (cost=86.00..104.25 rows=10 width=116) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (execucao_de_fluxo_id = execucao_pai.id)
8.          

CTE execucoes_da_arvore_toda

9. 0.001 0.740 ↑ 991.0 1 1

Unique (cost=234,752.68..236,734.68 rows=991 width=1,170) (actual time=0.738..0.740 rows=1 loops=1)

10. 0.015 0.739 ↑ 991.0 1 1

Sort (cost=234,752.68..235,248.18 rows=991 width=1,170) (actual time=0.738..0.739 rows=1 loops=1)

  • Sort Key: execucao_fluxo.executavel_id NULLS FIRST, execucao.executavel_id, (CASE WHEN ($4) THEN execucao.status ELSE NULL::character varying END), execucao.id DESC
  • Sort Method: quicksort Memory: 25kB
11. 0.004 0.724 ↑ 991.0 1 1

Nested Loop Left Join (cost=2,127.33..224,889.51 rows=991 width=1,170) (actual time=0.706..0.724 rows=1 loops=1)

12. 0.015 0.703 ↑ 991.0 1 1

Hash Join (cost=1,997.00..94,246.75 rows=991 width=1,138) (actual time=0.685..0.703 rows=1 loops=1)

  • Hash Cond: (execucao_fluxo.executavel_id = executavel_fluxo.id)
13. 0.001 0.077 ↑ 991.0 1 1

Nested Loop (cost=86.00..91,097.00 rows=991 width=1,138) (actual time=0.061..0.077 rows=1 loops=1)

14. 0.066 0.066 ↑ 991.0 1 1

CTE Scan on execucoes_da_arvore_toda_com_tentativas execucao (cost=0.00..991.00 rows=991 width=1,130) (actual time=0.051..0.066 rows=1 loops=1)

15. 0.010 0.010 ↑ 1.0 1 1

Index Scan using execucao_pkey on execucao execucao_fluxo (cost=86.00..90.42 rows=1 width=16) (actual time=0.008..0.010 rows=1 loops=1)

  • Index Cond: (id = execucao.execucao_de_fluxo_id)
16. 0.296 0.611 ↓ 1.0 1,250 1

Hash (cost=662.00..662.00 rows=1,249 width=8) (actual time=0.611..0.611 rows=1,250 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 65kB
17. 0.315 0.315 ↓ 1.0 1,250 1

Seq Scan on executavel executavel_fluxo (cost=0.00..662.00 rows=1,249 width=8) (actual time=0.006..0.315 rows=1,250 loops=1)

18. 0.001 0.017 ↑ 1.0 1 1

Result (cost=130.33..130.83 rows=1 width=1) (actual time=0.017..0.017 rows=1 loops=1)

19.          

Initplan (for Result)

20. 0.005 0.016 ↓ 0.0 0 1

Nested Loop (cost=112.00..130.33 rows=1 width=0) (actual time=0.016..0.016 rows=0 loops=1)

21. 0.006 0.006 ↑ 1.0 1 1

Index Only Scan using executavel_pkey on executavel executavel_tarefa (cost=55.50..58.50 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id = $3)
  • Heap Fetches: 0
22. 0.005 0.005 ↓ 0.0 0 1

Index Scan using idx_parametro_executavel_id_idx on parametro parametro_executavel (cost=56.50..71.33 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (executavel_id = $3)
  • Filter: (multi_execucao IS TRUE)
Planning time : 0.902 ms
Execution time : 0.910 ms