new smarter query balancing