On the dimension of graded algebras