Add intervals for range queries