added large dim check in AggregateFunDef to avoid "optimization" against
very large dimensions.