I read in some sources that mash conditions can influence the production of dextrins, that are not fermentable, have no taste (is that correct?) and add body to the beer. But somewhere else I read that mash conditions can contribute to sweetness (for example with decoction mash), what kind of compounds are produced during mash that will give some malty flavor or sweetness in finished beer?
The mash temperature specifically doesn't really make for a sweeter beer. While adjusting mash temperature allows the brewer to control the balance of simple (fermentable) sugars and dextrins (unfermentable), increasing either doesn't produce a sweeter beer:
- increasing simple sugars doesn't make the beer sweeter - primarily any sweetness from these sugars is lost when they are fermented.
- increasing dextrins doesn't increase sweetness considerably, because dextrins are not all that sweet. Dextrins have around 5-10% the sweetness of table sugar.
You may be thinking of melanoidins. These are a class of Maillard reaction compounds - of which there are many, with flavors like bready, malty. Some say richer, sweeter, but not like candy. They are produced with heat in addition to amino acids, proteins and carbohydrates. The high temperature of a decoction mash increases the rate of production of melanoidins. You can also emulate the effect with (Weyermann) Melanoidin Malt, aka Aromatic Malt from other malters.
Note: I am not a chemist. My homebrewing understanding is along the lines of:
Mashing at a higher temperature will promote the alpha-amylase enzyme to breakdown the sugars, while mashing at a lower temperature will promote the beta-amylase enzyme to breakdown the sugars.
The alpha-amylase will produce dextrins which will contribute to sweetness and body.
The beta-amylase will produce fermentable sugars, hence more alcohol.