Improving the Performance of Database-Centric Applications Through Program Analysis