I need a data structure that can store non-overlapping ranges within a single dimension. The entire range of the dimension need not be completely covered.
An example
I've had success storing a beginning time and duration. The test for overlap would be something like
WHERE NOT EXISTS (
SELECT 1 FROM table
WHERE BeginTime < NewBeginTime AND BeginTime + Duration > NewBeginTime
)
AND NOT EXISTS (
SELECT 1 FROM table
WHERE NewBeginTime < BeginTime AND NewBeginTime + NewDuration > BeginTime
)
I think without testing, but hopefully you get the drift