explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fOQ8

Settings
# exclusive inclusive rows x rows loops node
1. 981.038 22,927.403 ↓ 137.0 137 1

Gather (cost=27,964.50..56,077.64 rows=1 width=24) (actual time=7,213.244..22,927.403 rows=137 loops=1)

  • Output: planoexecu7_.id, entregasfo6_.quantidade, entregasfo6_.valor
  • Workers Planned: 3
  • Workers Launched: 3
2. 1,006.358 21,946.365 ↓ 34.0 34 4

Hash Join (cost=26,964.50..55,077.54 rows=1 width=24) (actual time=7,232.688..21,946.365 rows=34 loops=4)

  • Output: planoexecu7_.id, entregasfo6_.quantidade, entregasfo6_.valor
  • Inner Unique: true
  • Hash Cond: (entregasfo6_.plano_execucao_fornecedor_fk = planoexecu7_.id)
  • Worker 0: actual time=7181.932..21413.617 rows=38 loops=1
  • Worker 1: actual time=7200.819..21667.147 rows=37 loops=1
  • Worker 2: actual time=7336.108..22690.836 rows=23 loops=1
3. 6,143.125 20,938.836 ↓ 10,057.2 754,288 4

Nested Loop (cost=26,945.87..55,058.71 rows=75 width=24) (actual time=2,737.082..20,938.836 rows=754,288 loops=4)

  • Output: entregasfo6_.quantidade, entregasfo6_.valor, entregasfo6_.plano_execucao_fornecedor_fk
  • Worker 0: actual time=2797.251..20402.294 rows=738017 loops=1
  • Worker 1: actual time=2727.136..20687.948 rows=733003 loops=1
  • Worker 2: actual time=2646.021..21673.186 rows=760197 loops=1
4. 2,418.544 14,795.698 ↓ 10,224.2 265,830 4

Nested Loop (cost=26,945.44..55,040.11 rows=26 width=8) (actual time=2,736.922..14,795.698 rows=265,830 loops=4)

  • Output: produtos4_.id
  • Inner Unique: true
  • Worker 0: actual time=2797.107..14298.983 rows=250572 loops=1
  • Worker 1: actual time=2726.896..14573.133 rows=260680 loops=1
  • Worker 2: actual time=2645.786..15296.024 rows=278110 loops=1
5. 2,859.956 12,377.149 ↓ 10,224.2 265,830 4

Nested Loop (cost=26,945.02..55,028.72 rows=26 width=24) (actual time=2,736.716..12,377.149 rows=265,830 loops=4)

  • Output: precos3_.id, produtos4_.plano_execucao_produto_preco_fk, produtos4_.id
  • Inner Unique: true
  • Join Filter: (entregacpr0_.id = entregacpr0_1_.id)
  • Worker 0: actual time=2796.881..11987.198 rows=250572 loops=1
  • Worker 1: actual time=2726.608..12197.927 rows=260680 loops=1
  • Worker 2: actual time=2645.504..12771.691 rows=278110 loops=1
6. 2,064.095 9,517.187 ↓ 9,936.1 268,274 4

Nested Loop (cost=26,944.60..55,016.38 rows=27 width=40) (actual time=2,736.577..9,517.187 rows=268,274 loops=4)

  • Output: entregacpr0_.id, precos3_.id, produtos4_.entrega_c_p_r_doacao_fk, produtos4_.plano_execucao_produto_preco_fk, produtos4_.id
  • Inner Unique: true
  • Worker 0: actual time=2796.675..9259.862 rows=252548 loops=1
  • Worker 1: actual time=2726.430..9383.575 rows=262977 loops=1
  • Worker 2: actual time=2645.360..9770.679 rows=281350 loops=1
7. 2,234.108 7,453.089 ↓ 7,665.0 268,274 4

Nested Loop (cost=26,944.31..55,005.78 rows=35 width=64) (actual time=2,736.434..7,453.089 rows=268,274 loops=4)

  • Output: entregacpr0_.id, entregacpr0_.plano_execucao_fk, planoexecu1_.id, produtos2_.plano_execucao_fk, precos3_.id, produtos4_.entrega_c_p_r_doacao_fk, produtos4_.plano_execucao_produto_preco_fk, produtos4_.id
  • Inner Unique: true
  • Worker 0: actual time=2796.512..7283.600 rows=252548 loops=1
  • Worker 1: actual time=2726.211..7357.598 rows=262977 loops=1
  • Worker 2: actual time=2645.190..7603.948 rows=281350 loops=1
8. 1,124.485 5,218.977 ↓ 7,665.0 268,274 4

Hash Join (cost=26,944.03..54,995.19 rows=35 width=56) (actual time=2,736.292..5,218.977 rows=268,274 loops=4)

  • Output: entregacpr0_.id, entregacpr0_.plano_execucao_fk, produtos2_.plano_execucao_fk, precos3_.id, produtos4_.entrega_c_p_r_doacao_fk, produtos4_.plano_execucao_produto_preco_fk, produtos4_.id
  • Hash Cond: ((entregacpr0_.plano_execucao_fk = produtos2_.plano_execucao_fk) AND (produtos4_.plano_execucao_produto_preco_fk = precos3_.id))
  • Worker 0: actual time=2796.319..5142.692 rows=252548 loops=1
  • Worker 1: actual time=2726.049..5145.905 rows=262977 loops=1
  • Worker 2: actual time=2645.003..5259.552 rows=281350 loops=1
9. 917.561 1,771.673 ↑ 1.3 268,274 4

Hash Join (cost=4,747.78..23,521.68 rows=349,455 width=40) (actual time=411.456..1,771.673 rows=268,274 loops=4)

  • Output: entregacpr0_.id, entregacpr0_.plano_execucao_fk, produtos4_.entrega_c_p_r_doacao_fk, produtos4_.plano_execucao_produto_preco_fk, produtos4_.id
  • Inner Unique: true
  • Hash Cond: (produtos4_.entrega_c_p_r_doacao_fk = entregacpr0_.id)
  • Worker 0: actual time=440.693..1712.237 rows=252548 loops=1
  • Worker 1: actual time=417.918..1746.726 rows=262977 loops=1
  • Worker 2: actual time=403.881..1840.071 rows=281350 loops=1
10. 444.402 444.402 ↑ 1.3 270,834 4

Parallel Seq Scan on public.tb_entrega_c_p_r_doacao_produto produtos4_ (cost=0.00..13,116.55 rows=349,455 width=24) (actual time=0.062..444.402 rows=270,834 loops=4)

  • Output: produtos4_.entrega_c_p_r_doacao_fk, produtos4_.plano_execucao_produto_preco_fk, produtos4_.id
  • Worker 0: actual time=0.067..417.037 rows=255162 loops=1
  • Worker 1: actual time=0.069..442.972 rows=265396 loops=1
  • Worker 2: actual time=0.104..474.344 rows=283837 loops=1
11. 201.431 409.710 ↓ 1.0 131,772 4

Hash (cost=2,456.68..2,456.68 rows=131,768 width=16) (actual time=409.709..409.710 rows=131,772 loops=4)

  • Output: entregacpr0_.id, entregacpr0_.plano_execucao_fk
  • Buckets: 32768 Batches: 16 Memory Usage: 660kB
  • Worker 0: actual time=438.110..438.111 rows=131772 loops=1
  • Worker 1: actual time=415.871..415.872 rows=131772 loops=1
  • Worker 2: actual time=402.177..402.178 rows=131772 loops=1
12. 208.279 208.279 ↓ 1.0 131,772 4

Seq Scan on public.tb_entrega_c_p_r_doacao entregacpr0_ (cost=0.00..2,456.68 rows=131,768 width=16) (actual time=0.041..208.279 rows=131,772 loops=4)

  • Output: entregacpr0_.id, entregacpr0_.plano_execucao_fk
  • Worker 0: actual time=0.035..224.737 rows=131772 loops=1
  • Worker 1: actual time=0.053..211.812 rows=131772 loops=1
  • Worker 2: actual time=0.063..209.125 rows=131772 loops=1
13. 396.364 2,322.819 ↑ 1.1 227,488 4

Hash (cost=17,334.54..17,334.54 rows=244,514 width=16) (actual time=2,322.818..2,322.819 rows=227,488 loops=4)

  • Output: produtos2_.plano_execucao_fk, precos3_.id
  • Buckets: 32768 Batches: 16 Memory Usage: 923kB
  • Worker 0: actual time=2353.654..2353.655 rows=227488 loops=1
  • Worker 1: actual time=2304.194..2304.195 rows=227488 loops=1
  • Worker 2: actual time=2240.037..2240.039 rows=227488 loops=1
14. 1,005.400 1,926.455 ↑ 1.0 241,192 4

Merge Join (cost=1.12..17,334.54 rows=244,514 width=16) (actual time=0.263..1,926.455 rows=241,192 loops=4)

  • Output: produtos2_.plano_execucao_fk, precos3_.id
  • Merge Cond: (produtos2_.id = precos3_.plano_execucao_produto_fk)
  • Worker 0: actual time=0.346..1956.052 rows=241192 loops=1
  • Worker 1: actual time=0.301..1909.918 rows=241192 loops=1
  • Worker 2: actual time=0.348..1862.718 rows=241192 loops=1
15. 443.775 443.775 ↑ 1.0 240,614 4

Index Scan using tb_plano_execucao_produto_pkey on public.tb_plano_execucao_produto produtos2_ (cost=0.42..6,964.37 rows=240,614 width=16) (actual time=0.164..443.775 rows=240,614 loops=4)

  • Output: produtos2_.id, produtos2_.peso_liquido_unitario, produtos2_.peso_liquido_total, produtos2_.produto_fk, produtos2_.unidade_medida_fk, produtos2_.plano_execucao_fk, produtos2_.dt_atualizacao
  • Worker 0: actual time=0.222..455.723 rows=240614 loops=1
  • Worker 1: actual time=0.185..439.122 rows=240614 loops=1
  • Worker 2: actual time=0.222..438.177 rows=240614 loops=1
16. 477.280 477.280 ↑ 1.0 241,193 4

Index Scan using idx_plano_execucao_produto_preco_plano_execucao_produto_fk on public.tb_plano_execucao_produto_preco precos3_ (cost=0.42..6,850.27 rows=244,514 width=16) (actual time=0.088..477.280 rows=241,193 loops=4)

  • Output: precos3_.id, precos3_.preco_unitario, precos3_.quantidade_para_entrega, precos3_.quantidade_entregue, precos3_.plano_execucao_produto_fk, precos3_.dt_atualizacao
  • Worker 0: actual time=0.113..488.030 rows=241193 loops=1
  • Worker 1: actual time=0.104..474.556 rows=241193 loops=1
  • Worker 2: actual time=0.115..472.439 rows=241193 loops=1
17. 0.004 0.004 ↑ 1.0 1 1,073,098

Index Only Scan using tb_plano_execucao_doacao_pkey on public.tb_plano_execucao_doacao planoexecu1_ (cost=0.29..0.30 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=1,073,098)

  • Output: planoexecu1_.id
  • Index Cond: (planoexecu1_.id = entregacpr0_.plano_execucao_fk)
  • Heap Fetches: 103565
  • Worker 0: actual time=0.004..0.004 rows=1 loops=252548
  • Worker 1: actual time=0.004..0.004 rows=1 loops=262977
  • Worker 2: actual time=0.004..0.004 rows=1 loops=281350
18. 0.003 0.003 ↑ 1.0 1 1,073,098

Index Only Scan using tb_plano_execucao_pkey on public.tb_plano_execucao planoexecu1_1_ (cost=0.29..0.30 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=1,073,098)

  • Output: planoexecu1_1_.id
  • Index Cond: (planoexecu1_1_.id = entregacpr0_.plano_execucao_fk)
  • Heap Fetches: 60869
  • Worker 0: actual time=0.004..0.004 rows=1 loops=252548
  • Worker 1: actual time=0.004..0.004 rows=1 loops=262977
  • Worker 2: actual time=0.003..0.003 rows=1 loops=281350
19. 0.006 0.006 ↑ 1.0 1 1,073,098

Index Scan using tb_entrega_c_p_r_pkey on public.tb_entrega_c_p_r entregacpr0_1_ (cost=0.42..0.44 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1,073,098)

  • Output: entregacpr0_1_.id, entregacpr0_1_.codigo_entrega, entregacpr0_1_.codigo_validacao, entregacpr0_1_.valor_total, entregacpr0_1_.situacao, entregacpr0_1_.data, entregacpr0_1_.opcao_nota_entrada, entregacpr0_1_.dt_atualizacao
  • Index Cond: (entregacpr0_1_.id = produtos4_.entrega_c_p_r_doacao_fk)
  • Filter: (entregacpr0_1_.situacao = ANY ('{3,4,5,1}'::integer[]))
  • Rows Removed by Filter: 0
  • Worker 0: actual time=0.006..0.006 rows=1 loops=252548
  • Worker 1: actual time=0.006..0.006 rows=1 loops=262977
  • Worker 2: actual time=0.006..0.006 rows=1 loops=281350
20. 0.005 0.005 ↑ 1.0 1 1,063,322

Index Only Scan using tb_plano_execucao_produto_preco_pkey on public.tb_plano_execucao_produto_preco planoexecu5_ (cost=0.42..0.44 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1,063,322)

  • Output: planoexecu5_.id
  • Index Cond: (planoexecu5_.id = produtos4_.plano_execucao_produto_preco_fk)
  • Heap Fetches: 28352
  • Worker 0: actual time=0.005..0.005 rows=1 loops=250572
  • Worker 1: actual time=0.005..0.005 rows=1 loops=260680
  • Worker 2: actual time=0.005..0.005 rows=1 loops=278110
21. 0.013 0.013 ↑ 3.0 3 1,063,322

Index Scan using idx_entrega_c_p_r_doacao_fornecedor_entrega_c_p_r_doacao_produt on public.tb_entrega_c_p_r_doacao_fornecedor entregasfo6_ (cost=0.43..0.63 rows=9 width=32) (actual time=0.008..0.013 rows=3 loops=1,063,322)

  • Output: entregasfo6_.id, entregasfo6_.quantidade, entregasfo6_.valor, entregasfo6_.plano_execucao_fornecedor_fk, entregasfo6_.entrega_c_p_r_doacao_produto_fk, entregasfo6_.dt_atualizacao
  • Index Cond: (entregasfo6_.entrega_c_p_r_doacao_produto_fk = produtos4_.id)
  • Worker 0: actual time=0.009..0.014 rows=3 loops=250572
  • Worker 1: actual time=0.009..0.014 rows=3 loops=260680
  • Worker 2: actual time=0.009..0.013 rows=3 loops=278110
22. 0.034 1.171 ↑ 1.1 11 4

Hash (cost=18.48..18.48 rows=12 width=8) (actual time=1.170..1.171 rows=11 loops=4)

  • Output: planoexecu7_.id
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Worker 0: actual time=1.114..1.115 rows=11 loops=1
  • Worker 1: actual time=1.632..1.634 rows=11 loops=1
  • Worker 2: actual time=1.811..1.811 rows=11 loops=1
23. 1.137 1.137 ↑ 1.1 11 4

Index Only Scan using tb_plano_execucao_fornecedor_pkey on public.tb_plano_execucao_fornecedor planoexecu7_ (cost=0.42..18.48 rows=12 width=8) (actual time=0.450..1.137 rows=11 loops=4)

  • Output: planoexecu7_.id
  • Index Cond: (planoexecu7_.id = ANY ('{-1,584634,584642,584640,584636,584639,584632,584633,584638,584641,584637,584635}'::bigint[]))
  • Heap Fetches: 11
  • Worker 0: actual time=0.445..1.082 rows=11 loops=1
  • Worker 1: actual time=0.651..1.598 rows=11 loops=1
  • Worker 2: actual time=0.666..1.766 rows=11 loops=1
Planning time : 25.638 ms
Execution time : 22,927.882 ms