|
|
|
|
|
by CJefferson
3212 days ago
|
|
I think you could use this method with other bases, although be careful with base 256 -- if your strings are stored in UTF8 or something, then base 256 isn't actually that useful. However, the important bit (to me) is that you can use your database's sorting function to compare the numbers. The advantage of base-10 is it's easy to display the number :) Others bases do provide a constant speed improvement of course. |
|
In fact I'd make an index on (len(N), N), then include len(X) and X in all your comparisons and range queries (wrapping for ergonomics as needed). You can use any base storage (including compact varbinary base256).