use lower_bound/upper_bound for the query