Board index » delphi » DB design question: stringfield vs memo

DB design question: stringfield vs memo

i'm creating my first BDE based database and have some general design questions for those who are more experienced.

If i have an address field which is only used in 1 out of 10 records would you:

   * Define it as a string field, requiring probably 256 chars to be safe
     simple but space wasting
   * define it as a memo
     simple but incurs hidden overhead
   * store it in another table as either string or memo
     save space, increase complexity

there are lots of other variables here but i'm looking for a general idea leading to the best balance of DB size, performance, and coding simplicity.  My understanding of a memo is that it is effectively creating another table, but one that i don't need to
be concerned with.  The database here should not be especially large (a few K records, <2Mb?), but as they all do, will continue to grow.  This will be non SQL.

Jay

 

Re:DB design question: stringfield vs memo


I'd define as a memo with stored size set to 0.  The extra overhead isn't
really worth sweating over, since you'd have overhead on any of the methods.
The only potential downside is searching.

John

Quote
EJP <e...@spamsucks.ramss.com> wrote in message

news:pf=oN2K0B1rKH=EayrIEDmlaGgtA@4ax.com...
Quote
> i'm creating my first BDE based database and have some general design

questions for those who are more experienced.
Quote

> If i have an address field which is only used in 1 out of 10 records would
you:

>    * Define it as a string field, requiring probably 256 chars to be safe
>      simple but space wasting
>    * define it as a memo
>      simple but incurs hidden overhead
>    * store it in another table as either string or memo
>      save space, increase complexity

> there are lots of other variables here but i'm looking for a general idea

leading to the best balance of DB size, performance, and coding simplicity.
My understanding of a memo is that it is effectively creating another table,
but one that i don't need to
Quote
> be concerned with.  The database here should not be especially large (a

few K records, <2Mb?), but as they all do, will continue to grow.  This will
be non SQL.
Quote

> Jay

Re:DB design question: stringfield vs memo


If you want to store the entire address in a single field I would use the
memo. However, I cannot think of a case where I would store an address in a
single field since it makes it difficult to search or use the City, State
and Zip Code for other purposes.

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to questions received via email)

Re:DB design question: stringfield vs memo


Any package where you weren't doing such searches.  Or any portion where it
is irrelevant.  I've coded two of these aps in the past year alone, both
where the address will only ever be used for printing (both accounting
related).

Example outside of Delphi: QuickBooks.

John

Quote
Bill Todd <b...@nospam.dbginc.com> wrote in message

news:7sbrb9$j113@forums.borland.com...
Quote
> If you want to store the entire address in a single field I would use the
> memo. However, I cannot think of a case where I would store an address in
a
> single field since it makes it difficult to search or use the City, State
> and Zip Code for other purposes.

> Bill

> --

> Bill Todd - TeamB
> (TeamB cannot respond to questions received via email)

Other Threads