consider only looking for ranges only when the ids are within 100X the number of rows