Reputation: 193
I am questioning the very orthodox method of storing(at least in my zone) the range of values in db in a format (i.e. 0:1:20;1:7:40). This rule can mean,
Now, I am a believer of change and therefore would like to know if there is some other way to store such data in database which would give me flexibility in coding it as well as would require less space than the JSON format.
Upvotes: 1
Views: 50
Reputation: 386654
While you have ranges which are consecutive, you could omit start value (if it is always zero) and use just the length of the range.
1|20 first range is starting with zero and ending on starting + length
6|40 second range starting with end of the last range
Upvotes: 1