Design optimization of the Grid data analysis workflow in CMS