Homological properties of piecewise hereditary algebras