explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hAwH

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Gather (cost=38,566,117.84..242,704,884,322.28 rows=304,977,143 width=556) (actual rows= loops=)

  • Workers Planned: 2
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=38,565,117.84..135,975,537.23 rows=127,073,810 width=187) (actual rows= loops=)

  • Hash Cond: ((t1.clienteid = t5.clienteid) AND ((t1.codigolocal)::text = (t5.codigolocal)::text) AND (t1.dataarquivo = t5.dataarquivo))
3. 0.000 0.000 ↓ 0.0

Parallel Hash Left Join (cost=38,564,940.41..99,638,675.77 rows=127,073,810 width=130) (actual rows= loops=)

  • Hash Cond: ((t1.clienteid = t3.clienteid) AND (t1.dataarquivo = t3.dataarquivo) AND ((t2.codigofornecedor)::text = (t3.codigofornecedor)::text))
4. 0.000 0.000 ↓ 0.0

Parallel Hash Left Join (cost=38,554,311.77..58,717,082.66 rows=127,073,810 width=117) (actual rows= loops=)

  • Hash Cond: ((t1.clienteid = t2.clienteid) AND (t1.dataarquivo = t2.dataarquivo) AND ((t1.codigoproduto)::text = (t2.codigoproduto)::text))
5. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=38,193,721.35..41,999,736.33 rows=127,073,810 width=64) (actual rows= loops=)

  • Merge Cond: ((t1.clienteid = t4.clienteid) AND ((t1.codigolocal)::text = (t4.codigolocal)::text) AND ((t1.datamovimentod1)::text = (t4.datamovimento)::text))
6. 0.000 0.000 ↓ 0.0

Sort (cost=38,193,310.92..38,509,445.62 rows=126,453,878 width=62) (actual rows= loops=)

  • Sort Key: t1.clienteid, t1.codigolocal, t1.datamovimentod1
7. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on "Movimentos_Layout1" t1 (cost=0.00..6,913,273.78 rows=126,453,878 width=62) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Sort (cost=410.43..423.54 rows=5,244 width=18) (actual rows= loops=)

  • Sort Key: t4.clienteid, t4.codigolocal, t4.datamovimento
9. 0.000 0.000 ↓ 0.0

Seq Scan on "CalendarioComercial" t4 (cost=0.00..86.44 rows=5,244 width=18) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Parallel Hash (cost=255,781.97..255,781.97 rows=3,586,997 width=67) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on "CadastroProdutos_Layout1" t2 (cost=0.00..255,781.97 rows=3,586,997 width=67) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Parallel Hash (cost=6,769.69..6,769.69 rows=158,569 width=27) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on "CadastroFornecedores_Layout1" t3 (cost=0.00..6,769.69 rows=158,569 width=27) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=104.61..104.61 rows=4,161 width=68) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on "Locais_Layout1" t5 (cost=0.00..104.61 rows=4,161 width=68) (actual rows= loops=)

16.          

SubPlan (forGather)

17. 0.000 0.000 ↓ 0.0

Aggregate (cost=132.52..132.53 rows=1 width=32) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Index Scan using "Movimentos_Layout1_clienteid_codigolocal_codigoproduto_data_idx" on "Movimentos_Layout1" t4_1 (cost=0.57..132.51 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((t1.clienteid = clienteid) AND ((t1.codigolocal)::text = (codigolocal)::text) AND ((t1.codigoproduto)::text = (codigoproduto)::text))
  • Filter: (((dataarquivo - 1) >= (t1.dataarquivo - 31)) AND ((dataarquivo - 1) <= (t1.dataarquivo - 1)))
19. 0.000 0.000 ↓ 0.0

Aggregate (cost=132.52..132.53 rows=1 width=32) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Index Scan using "Movimentos_Layout1_clienteid_codigolocal_codigoproduto_data_idx" on "Movimentos_Layout1" t4_1_1 (cost=0.57..132.51 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((t1.clienteid = clienteid) AND ((t1.codigolocal)::text = (codigolocal)::text) AND ((t1.codigoproduto)::text = (codigoproduto)::text))
  • Filter: (((dataarquivo - 1) >= (t1.dataarquivo - 31)) AND ((dataarquivo - 1) <= (t1.dataarquivo - 1)))
21. 0.000 0.000 ↓ 0.0

Aggregate (cost=132.51..132.52 rows=1 width=32) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan using "Movimentos_Layout1_clienteid_codigolocal_codigoproduto_data_idx" on "Movimentos_Layout1" t4_1_2 (cost=0.57..132.51 rows=1 width=3) (actual rows= loops=)

  • Index Cond: ((t1.clienteid = clienteid) AND ((t1.codigolocal)::text = (codigolocal)::text) AND ((t1.codigoproduto)::text = (codigoproduto)::text))
  • Filter: (((dataarquivo - 1) >= (t1.dataarquivo - 31)) AND ((dataarquivo - 1) <= (t1.dataarquivo - 1)))
23. 0.000 0.000 ↓ 0.0

Aggregate (cost=132.51..132.52 rows=1 width=32) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Index Scan using "Movimentos_Layout1_clienteid_codigolocal_codigoproduto_data_idx" on "Movimentos_Layout1" t4_1_3 (cost=0.57..132.51 rows=1 width=3) (actual rows= loops=)

  • Index Cond: ((t1.clienteid = clienteid) AND ((t1.codigolocal)::text = (codigolocal)::text) AND ((t1.codigoproduto)::text = (codigoproduto)::text))
  • Filter: (((dataarquivo - 1) >= (t1.dataarquivo - 31)) AND ((dataarquivo - 1) <= (t1.dataarquivo - 1)))
25. 0.000 0.000 ↓ 0.0

Aggregate (cost=132.52..132.53 rows=1 width=32) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Index Scan using "Movimentos_Layout1_clienteid_codigolocal_codigoproduto_data_idx" on "Movimentos_Layout1" t4_1_4 (cost=0.57..132.51 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((t1.clienteid = clienteid) AND ((t1.codigolocal)::text = (codigolocal)::text) AND ((t1.codigoproduto)::text = (codigoproduto)::text))
  • Filter: (((dataarquivo - 1) >= (t1.dataarquivo - 31)) AND ((dataarquivo - 1) <= (t1.dataarquivo - 1)))
27. 0.000 0.000 ↓ 0.0

Aggregate (cost=132.52..132.53 rows=1 width=32) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Index Scan using "Movimentos_Layout1_clienteid_codigolocal_codigoproduto_data_idx" on "Movimentos_Layout1" t4_1_5 (cost=0.57..132.51 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((t1.clienteid = clienteid) AND ((t1.codigolocal)::text = (codigolocal)::text) AND ((t1.codigoproduto)::text = (codigoproduto)::text))