I have an set numeric ranges that I would like to optimize.
Here's a simple example of initial values:
Start End
9 12
1 2
60 88
10 11
79 80
What I'd expect as output after optimization:
Start End
1 2
9 12
60 88
These are the left
and right
values from Modified Preorder Tree Traversal (Nested Set) data stored in a MySQL database. I use them to exclude inactive branches from the result, and am not currently optimizing the ranges at all. I thought I might get a performance gain from optimizing the ranges before use.
MORE INFO
The values are passed into a query for exclusion of the inactive branches in the tree using a NOT BETWEEN
clause. I thought that I could optimize the performance of that query by using a minimal set of ranges.