On 2/9/2011 4:13 PM, Black, Michael (IS) wrote:
> And what's the advantage of packing like this?

SQLite uses variable-length encoding for integers - smaller values 
(nearer to zero, to be precise) get packed into fewer bytes. So if you 
have two 1 values to store, combining them in the way Max Vlasov sugests 
would produce 2 (takes one byte in the database) rather than 0x00010001 
(takes three, maybe four bytes).

> So what if you're storing 0x00000001 and 0x00010000.
> Same space

No, not the same space. Whether the benefit is worth the complexity is a 
question, of course.
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to