change default sql function from Avg to Sum