[sqlite] VARCHAR or TEXT to save sapce

2016-09-02 Thread Dave Blake
Can I confirm that defining feilds as VARCHAR(20) rather than TEXT, if I know I only want 20 chars or less, will result in a smaller database? ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailm

Re: [sqlite] VARCHAR or TEXT to save sapce

2016-09-02 Thread Tim Streater
On 02 Sep 2016 at 15:05, Dave Blake wrote: > Can I confirm that defining feilds as VARCHAR(20) rather than TEXT, if I > know I only want 20 chars or less, will result in a smaller database? Makes no difference whatever. See: -- Cheers -- Tim ___

Re: [sqlite] VARCHAR or TEXT to save sapce

2016-09-02 Thread Olivier Mascia
> Le 2 sept. 2016 à 16:05, Dave Blake a écrit : > > Can I confirm that defining feilds as VARCHAR(20) rather than TEXT, if I > know I only want 20 chars or less, will result in a smaller database? That won't change anything. The (20) in VARCHAR(20) is purely 'documentation' for you, and insign

Re: [sqlite] VARCHAR or TEXT to save sapce

2016-09-02 Thread R Smith
On 2016/09/02 4:05 PM, Dave Blake wrote: Can I confirm that defining feilds as VARCHAR(20) rather than TEXT, if I know I only want 20 chars or less, will result in a smaller database? In addition to the other useful replies, you might actually be interested in ensuring the text field in ques

Re: [sqlite] VARCHAR or TEXT to save sapce

2016-09-02 Thread Richard Hipp
On Fri, 02 Sep 2016 15:10 +0100, Tim Streater wrote: > On 02 Sep 2016 at 15:05, Dave Blake wrote: > >> Can I confirm that defining feilds as VARCHAR(20) rather than TEXT, if I >> know I only want 20 chars or less, will result in a smaller database? > > Makes no difference whatever. Mr. Streater

Re: [sqlite] VARCHAR or TEXT to save sapce

2016-09-02 Thread Dominique Devienne
On Fri, Sep 2, 2016 at 5:04 PM, Richard Hipp wrote: > On Fri, 02 Sep 2016 15:10 +0100, Tim Streater > wrote: > > On 02 Sep 2016 at 15:05, Dave Blake wrote: > > > >> Can I confirm that defining feilds as VARCHAR(20) rather than TEXT, if I > >> know I only want 20 chars or less, will result in a

Re: [sqlite] VARCHAR or TEXT to save sapce

2016-09-02 Thread Richard Hipp
On 9/2/16, Dominique Devienne wrote: > > For example, we use Guid extensively, which are typed blob, but often > add that CHECK(length(guid) = 16) constraint. I know 20 is not far off > from 16 in this particular case, but more accurate is always better, no? The difference between 16 and 20 won't

Re: [sqlite] VARCHAR or TEXT to save sapce

2016-09-02 Thread Dominique Devienne
On Fri, Sep 2, 2016 at 5:51 PM, Richard Hipp wrote: > On 9/2/16, Dominique Devienne wrote: > > > > For example, we use Guid extensively, which are typed blob, but often > > add that CHECK(length(guid) = 16) constraint. I know 20 is not far off > > from 16 in this particular case, but more accura

Re: [sqlite] VARCHAR or TEXT to save sapce

2016-09-02 Thread Richard Hipp
On 9/2/16, Dominique Devienne wrote: > > Does ANALYZE gather actual statistics on lengths? The sqlite_stat1 table has a place to put that information and SQLite will use the information if it is present, but the ANALYZE command does not currently generate it. -- D. Richard Hipp d...@sqlite.org