Storing a great many fields in a database

Andre Garzia andre at andregarzia.com
Mon Jul 16 14:08:29 EDT 2012


Bob,

SQLite will always use TEXT and allocate just as much space as necessary to
store the information at hand. I think it is a better option.

So if you just store 10 chars in that column, the TEXT field will use just
that space and nothing more.

On Mon, Jul 16, 2012 at 2:58 PM, Bob Sneidar <bobs at twft.com> wrote:

> Wha?? I thought the whole point to using VARCHAR was that it only used as
> much space as the actual text needed. What is the difference between TEXT
> and VARCHAR then?
>
> Bob
>
>
> On Jul 16, 2012, at 9:50 AM, Peter Haworth wrote:
>
> > SQLite does have some advantages over other dbs in this area.  Since it
> > effectively ignores any length specification, e.g. VARCHAR(100), it only
> > stores the number of characters you give it during an INSERT or UPDATE
> > operation.  On the other hand VARCHAR(100) on most other SQL dbs will
> > allocate enough disk space to store 100 characters even if you only put 1
> > character in the column.  The "100" is a constraint that prevents more
> than
> > 100 chars from being put into the column but doesn't affect the storage
> > space.
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.



More information about the use-livecode mailing list