Re: Why are data types size limited?

From: Rudy Fernandes <rferdy_at_americasm01.nt.com>
Date: 2000/03/20
Message-ID: <38D6AE93.3A04DC84_at_americasm01.nt.com>#1/1


eison_at_cc.gatech.edu wrote:

> I am a programmer who is mostly ignorant of database theory, and have just
> started using databases. From an ignorant-user standpoint, they're great
> except for field size limitations. Character strings must be specified as
> X size maximum, with a hard limit of Y characters is the longest string
> that can be handled, unless you use this funky other binary data type that
> has its own odd and difficult syntax for working with. Why is this? Why
> can't databases be written to handle arbitrarily long strings, and grow or
> shrink all input fields as needed?

Real life performance, I would think. Take Informix : It has at least 3 datatypes (in v7.3) that handle strings
char - fixed length
varchar - variable length with a max. of 255 text - variable length, no limits

For a given fixed string length, char is fastest (because Informix has the least 'thinking' to do) and text is slowest. So, one would want to use char wherever possible.

However, if your data is of a highly variable length, one would consider varchar (the cost of increased I/Os when using char may outweigh its cpu advantages).

Similarly, under some circumstances, one would choose to use the text datatype.

Informix, like other databases, also allows you to change the size and datatype of your column quite easily - so, if your business needs change, the database can be modified to fit.

Rudy Received on Mon Mar 20 2000 - 00:00:00 CET

Original text of this message