On Wed, 17 Aug 2011 01:39:57 -0700 (PDT), LiranR
<liran.rit...@gmail.com> wrote:

>
>Hi all !
>A quick question:
>Do you know if there is a different in performance when i use 4 bytes
>Integer Primary Key or 8 bytes Integer Primary Key?

The INTEGER type in SQLite is a 64bit signed integer.
It is stored in a compressed form, such that the left most zero's
of the binary representation are dropped.
Stprage size and speed is best when using smaller, positive
values, but don't overestimate this effect.

Remember to use the exact wording: INTEGER PRIMARY KEY, as it will
make the primary key an alias for the always present internal
primary key, AKA rowid. This has several advantages (like
portability, speed, and the value of rowid will not change using
VACUUM).
So, avoid types like INT(4) or INT(8), especially for  primary
keys.
-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to