explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RTyw

Settings
# exclusive inclusive rows x rows loops node
1. 2.770 2.770 ↑ 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=2.769..2.770 rows=1 loops=1)

  • Output: execucoes_da_arvore_toda.id, execucoes_da_arvore_toda.version, execucoes_da_arvore_toda.date_created, execucoes_da_arvore_toda.id_usuario, execucoes_da_arvore_toda.manual, execucoes_da_arvore_toda.execucao_de_fluxo_id, execucoes_da_arvore_toda.status, execucoes_da_arvore_toda.class, execucoes_da_arvore_toda.executavel_id, execucoes_da_arvore_toda.detalhe_status, execucoes_da_arvore_toda.concluida, execucoes_da_arvore_toda.agendamento_id, execucoes_da_arvore_toda.estrategia_contingencia_id
2.          

CTE execucoes_da_arvore_toda_com_tentativas

3. 0.008 0.845 ↑ 991.0 1 1

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

4. 0.812 0.812 ↑ 1.0 1 1

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

  • Output: execucao_raiz.id, execucao_raiz.version, execucao_raiz.date_created, execucao_raiz.id_usuario, execucao_raiz.manual, execucao_raiz.execucao_de_fluxo_id, execucao_raiz.status, execucao_raiz.class, execucao_raiz.executavel_id, execucao_raiz.detalhe_status, execucao_raiz.concluida, execucao_raiz.agendamento_id, execucao_raiz.estrategia_contingencia_id
  • Index Cond: (execucao_raiz.id = 55258568)
5. 0.002 0.025 ↓ 0.0 0 1

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

  • Output: execucao_filha.id, execucao_filha.version, execucao_filha.date_created, execucao_filha.id_usuario, execucao_filha.manual, execucao_filha.execucao_de_fluxo_id, execucao_filha.status, execucao_filha.class, execucao_filha.executavel_id, execucao_filha.detalhe_status, execucao_filha.concluida, execucao_filha.agendamento_id, execucao_filha.estrategia_contingencia_id
6. 0.002 0.002 ↑ 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.002..0.002 rows=1 loops=1)

  • Output: execucao_pai.id, execucao_pai.version, execucao_pai.date_created, execucao_pai.id_usuario, execucao_pai.manual, execucao_pai.execucao_de_fluxo_id, execucao_pai.status, execucao_pai.class, execucao_pai.executavel_id, execucao_pai.detalhe_status, execucao_pai.concluida, execucao_pai.agendamento_id, execucao_pai.estrategia_contingencia_id
7. 0.021 0.021 ↓ 0.0 0 1

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

  • Output: execucao_filha.id, execucao_filha.version, execucao_filha.date_created, execucao_filha.id_usuario, execucao_filha.manual, execucao_filha.execucao_de_fluxo_id, execucao_filha.status, execucao_filha.class, execucao_filha.executavel_id, execucao_filha.detalhe_status, execucao_filha.concluida, execucao_filha.agendamento_id, execucao_filha.estrategia_contingencia_id
  • Index Cond: (execucao_filha.execucao_de_fluxo_id = execucao_pai.id)
8.          

CTE execucoes_da_arvore_toda

9. 0.001 2.766 ↑ 991.0 1 1

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

  • Output: execucao.id, execucao.version, execucao.date_created, execucao.id_usuario, execucao.manual, execucao.execucao_de_fluxo_id, execucao.status, execucao.class, execucao.executavel_id, execucao.detalhe_status, execucao.concluida, execucao.agendamento_id, execucao.estrategia_contingencia_id, execucao_fluxo.executavel_id, (CASE WHEN ($4) THEN execucao.status ELSE NULL::character varying END)
10. 0.014 2.765 ↑ 991.0 1 1

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

  • Output: execucao.id, execucao.version, execucao.date_created, execucao.id_usuario, execucao.manual, execucao.execucao_de_fluxo_id, execucao.status, execucao.class, execucao.executavel_id, execucao.detalhe_status, execucao.concluida, execucao.agendamento_id, execucao.estrategia_contingencia_id, execucao_fluxo.executavel_id, (CASE WHEN ($4) THEN execucao.status ELSE NULL::character varying END)
  • 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 2.751 ↑ 991.0 1 1

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

  • Output: execucao.id, execucao.version, execucao.date_created, execucao.id_usuario, execucao.manual, execucao.execucao_de_fluxo_id, execucao.status, execucao.class, execucao.executavel_id, execucao.detalhe_status, execucao.concluida, execucao.agendamento_id, execucao.estrategia_contingencia_id, execucao_fluxo.executavel_id, CASE WHEN ($4) THEN execucao.status ELSE NULL::character varying END
12. 0.018 2.730 ↑ 991.0 1 1

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

  • Output: execucao.id, execucao.version, execucao.date_created, execucao.id_usuario, execucao.manual, execucao.execucao_de_fluxo_id, execucao.status, execucao.class, execucao.executavel_id, execucao.detalhe_status, execucao.concluida, execucao.agendamento_id, execucao.estrategia_contingencia_id, execucao_fluxo.executavel_id
  • Hash Cond: (execucao_fluxo.executavel_id = executavel_fluxo.id)
13. 0.005 2.296 ↑ 991.0 1 1

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

  • Output: execucao.id, execucao.version, execucao.date_created, execucao.id_usuario, execucao.manual, execucao.execucao_de_fluxo_id, execucao.status, execucao.class, execucao.executavel_id, execucao.detalhe_status, execucao.concluida, execucao.agendamento_id, execucao.estrategia_contingencia_id, execucao_fluxo.executavel_id
14. 0.847 0.847 ↑ 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.818..0.847 rows=1 loops=1)

  • Output: execucao.id, execucao.version, execucao.date_created, execucao.id_usuario, execucao.manual, execucao.execucao_de_fluxo_id, execucao.status, execucao.class, execucao.executavel_id, execucao.detalhe_status, execucao.concluida, execucao.agendamento_id, execucao.estrategia_contingencia_id
15. 1.444 1.444 ↑ 1.0 1 1

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

  • Output: execucao_fluxo.id, execucao_fluxo.version, execucao_fluxo.date_created, execucao_fluxo.id_usuario, execucao_fluxo.manual, execucao_fluxo.execucao_de_fluxo_id, execucao_fluxo.status, execucao_fluxo.class, execucao_fluxo.executavel_id, execucao_fluxo.detalhe_status, execucao_fluxo.concluida, execucao_fluxo.agendamento_id, execucao_fluxo.estrategia_contingencia_id
  • Index Cond: (execucao_fluxo.id = execucao.execucao_de_fluxo_id)
16. 0.156 0.416 ↓ 1.0 1,250 1

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

  • Output: executavel_fluxo.id
  • Buckets: 2048 Batches: 1 Memory Usage: 65kB
17. 0.260 0.260 ↓ 1.0 1,250 1

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

  • Output: executavel_fluxo.id
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)

  • Output: $4
19.          

Initplan (for Result)

20. 0.004 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.008 0.008 ↑ 1.0 1 1

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

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

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

  • Output: parametro_executavel.id, parametro_executavel.version, parametro_executavel.alteravel, parametro_executavel.nome, parametro_executavel.obrigatorio, parametro_executavel.valor_padrao, parametro_executavel.tipo, parametro_executavel.descricao, parametro_executavel.expor, parametro_executavel.executavel_id, parametro_executavel.multi_execucao
  • Index Cond: (parametro_executavel.executavel_id = $3)
  • Filter: (parametro_executavel.multi_execucao IS TRUE)
Planning time : 0.849 ms
Execution time : 2.913 ms