explain.depesz.com

PostgreSQL's explain analyze made readable

Result: baT : Optimization for: plan #b3Mi

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 36.612 44,697.911 ↓ 1.3 81 1

Hash Left Join (cost=7,722.85..4,849,491.21 rows=62 width=277) (actual time=683.956..44,697.911 rows=81 loops=1)

  • Hash Cond: (f.produto_chave = (((((p.filial)::text || '-'::text) || (p.item_pai_codigo)::text) || '-'::text) || (p.item_pai_mascara_nome)::text))
2. 102.282 102.282 ↓ 9.5 19 1

Seq Scan on fatos_faturamento f (cost=0.00..22,891.69 rows=2 width=224) (actual time=0.438..102.282 rows=19 loops=1)

  • Filter: (documento_chave = 'S1-2017-03-14-75593'::text)
  • Rows Removed by Filter: 493556
3. 78.447 111.644 ↑ 1.1 126,257 1

Hash (cost=4,636.71..4,636.71 rows=138,571 width=50) (actual time=111.644..111.644 rows=126,257 loops=1)

  • Buckets: 65536 Batches: 4 Memory Usage: 3052kB
4. 33.197 33.197 ↑ 1.0 138,366 1

Seq Scan on produtos_explosao p (cost=0.00..4,636.71 rows=138,571 width=50) (actual time=0.014..33.197 rows=138,366 loops=1)

5.          

SubPlan (forHash Left Join)

6. 1.944 4,066.281 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=50.200..50.201 rows=1 loops=81)

7. 4,064.337 4,064.337 ↑ 173.2 4 81

Seq Scan on produtos_explosao e (cost=0.00..7,061.70 rows=693 width=5) (actual time=10.800..50.177 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
8. 1.863 4,025.052 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=49.692..49.692 rows=1 loops=81)

9. 4,023.189 4,023.189 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_1 (cost=0.00..7,061.70 rows=693 width=5) (actual time=10.521..49.669 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
10. 1.944 3,934.899 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=48.579..48.579 rows=1 loops=81)

11. 3,932.955 3,932.955 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_2 (cost=0.00..7,061.70 rows=693 width=5) (actual time=10.245..48.555 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
12. 1.944 3,895.938 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=48.098..48.098 rows=1 loops=81)

13. 3,893.994 3,893.994 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_3 (cost=0.00..7,061.70 rows=693 width=5) (actual time=10.417..48.074 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
14. 1.863 3,969.000 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=49.000..49.000 rows=1 loops=81)

15. 3,967.137 3,967.137 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_4 (cost=0.00..7,061.70 rows=693 width=5) (actual time=10.727..48.977 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
16. 1.944 4,158.378 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=51.337..51.338 rows=1 loops=81)

17. 4,156.434 4,156.434 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_5 (cost=0.00..7,061.70 rows=693 width=5) (actual time=10.765..51.314 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
18. 2.025 3,978.072 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=49.112..49.112 rows=1 loops=81)

19. 3,976.047 3,976.047 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_6 (cost=0.00..7,061.70 rows=693 width=5) (actual time=10.776..49.087 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
20. 1.944 3,919.914 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=48.393..48.394 rows=1 loops=81)

21. 3,917.970 3,917.970 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_7 (cost=0.00..7,061.70 rows=693 width=5) (actual time=11.056..48.370 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
22. 1.944 4,120.308 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=50.867..50.868 rows=1 loops=81)

23. 4,118.364 4,118.364 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_8 (cost=0.00..7,061.70 rows=693 width=5) (actual time=10.222..50.844 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
24. 1.863 4,305.636 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=53.156..53.156 rows=1 loops=81)

25. 4,303.773 4,303.773 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_9 (cost=0.00..7,061.70 rows=693 width=5) (actual time=11.176..53.133 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
26. 1.944 4,073.895 ↑ 1.0 1 81

Aggregate (cost=7,063.44..7,063.45 rows=1 width=32) (actual time=50.294..50.295 rows=1 loops=81)

27. 4,071.951 4,071.951 ↑ 173.2 4 81

Seq Scan on produtos_explosao e_10 (cost=0.00..7,061.70 rows=693 width=5) (actual time=10.870..50.271 rows=4 loops=81)

  • Filter: (f.produto_chave = (((((filial)::text || '-'::text) || (item_pai_codigo)::text) || '-'::text) || (item_pai_mascara_nome)::text))
  • Rows Removed by Filter: 138362
Planning time : 1.543 ms