In some database systems, it can be beneficial to use "NOT NULL" as
much as possible when defining tables.  It usually allows for a
slightly tighter storage encoding, and also allows some optimizations
to occur.

AFAICT, in sqlite it only seems important for constraining the data
appropriately.  For a column which does not contain null data, it
looks like the storage doesn't change between when it's defined with
NOT NULL or without (I'm guessing this is basically because of
manifest typing).  Also, the EXPLAIN output doesn't change at all when
I add or remove the NOT NULL.  So it would seem that the actual
performance would never change, nor would the storage footprint, so
long as you don't ever attempt to insert null data (in which case the
NOT NULL version would convert it to an appropriate default value,
which might cause changes to storage or performance).

Anyone got holes to shoot in my reasoning?

Thanks,
scott

[It's sort of hard to search for emails to sqlite-users about "NOT
NULL".  There are many references to "NOT NULL" in table examples
people include with their questions :-).]

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to