I am working on an application where users 'fight' to own larger parts of the map. Each map is made of a 1000 regions. Now my initial plan was to store the areas a user owns as a comma separated string e.g
a user owns regions one to ten 1,2,3,4,5,6,7,8,9,10
Problem is a user could potentially own all 1000 which means it could be a string 3893 characters long... I stored it as a varchar(3893)... which seems horribly inefficient.
I did consider a binary solution e.g
1111111111 followed by 990 0's
Which is a good solution if only one user owns the whole grid as that's 1000 characters but if its 4 or more then its less efficient.
Also I need to consider a way that is easy to compute back to a comma separated string as that is how my javascript will use it.
Thanks,