Using usage-based optimization to optimize the cube