Michael, another small improvement... to take advantage of effective integer
packing you can encode two numbers interleaving them dedicating odd bits to
one and even to another. This will require extra steps in the program so
this is your turn to decide worth it or not.

Max


On Wed, Feb 9, 2011 at 10:35 PM, Black, Michael (IS) <michael.bla...@ngc.com
> wrote:

> I think I can get away with 31 bits (I'll have to add some error checking
> just in case).
>
> I like this idea as it collapses into a single field that is easily
> indexed.
>
> ...
> ________________________________________
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on
> behalf of Jim Wilcoxson [pri...@gmail.com]
>
>
>
If you don't care about the order and the integers are smallish, like 31
> bits or less, I'd do this:
>
> create table t(k int primary key);
>
> i = whatever
> j = whatever
> if i < j:
>   k = i<<32 | j
> else:
>   k = j<<32 | i
> insert k into table
>
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to