On 23 Oct 2019, at 1:53pm, x <tam118...@hotmail.com> wrote:

> Suppose you have a table with say 5 columns that are almost always the 
> default value (probably zero or null). Does the above suggest you should make 
> them the last 5 columns in the table as the last n columns that are the 
> default value won’t take up space?

If you make up your own file in SQLite format and do this, you get the right 
results: missing fields at the end of a row return the correct DEFAULT value.  
I seem to remember testing this long ago using a hex editor.

However, I don't think the SQLite API checks for this or implements it.  I 
believe that even if a row ends in NULL NULL NULL those three values get 
written to the row.  However they take up one octet each, so it will have 
minimal effect on filesize.

I note with interest the SQLITE_ENABLE_NULL_TRIM option mentioned by 
david.raym...@tomtom.com .  If this was to work correctly according to the text 
of your question it might more properly be called SQLITE_ENABLE_DEFAULT_TRIM .

It might be interesting to find out what it does if the default value for a 
column isn't NULL.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to