Re: Why are data types size limited?

From: Alan <alanshein_at_erols.spambuster.com>
Date: 2000/03/21
Message-ID: <8b81fr$mkj$1_at_bob.news.rcn.net>#1/1


Another reason (and I'm surprised Joe left this out) is to enforce data integrity (in this case, length) at the database level. If constraints cannot be supported at the database level, then _every_ program written in the enterprise would need to contain more-or-less matching constraints for each column. This would be at best a pain, and at worst impossible. When constraints are at the DB level, the programmers don't have to concern themseleves with enforcing them.

Now, this does not explain why there is still an unreasonable limit or penalty on the various string types, though I suspect there is some underlying architectural reason for it, or surely it would have been "fixed" by now.

eison_at_cc.gatech.edu wrote in message <8b63hp$91n_at_catapult.gatech.edu>...
>"Joe \"Nuke Me Xemu\" Foster" <joe_at_bftsi0.uucp> wrote:
>: It's mainly an implementation issue. The b-tree-based indexing scheme
>: most RDBMS' use works best when the b-tree nodes, including the keys,
>: fits within a disk page, however that's defined.
>
>Thank you, this seems to be pointing to the reason... more reasons would
>be lovely...
>
>: Who has
>: an email address longer than 255 characters?
>
>The point was that once you limit a field length, somebody will eventually
>come along with something longer than that field length. Say you decide
>all e-mails are 100 chars max, then some Lotus Notes user will come along
>with a 105 character address, and things break. I still don't understand
>why a database can't handle this; I would assume a slow-down on the rare
>cases where this happens would be more acceptable than an error message,
>but maybe it would be worse than just a slow-down.
>
>: Here's an example of one
>: of those tricks, in pseudo-SQL:
>: select mytable.*
>: from mytable
>: where mytable.IndexedEmailAddress = substring(:findthisaddress, 1, 255)
>: and mytable.FullEmailAddress = :findthisaddress
>
>Thanks for pointing this out. I believe it still won't deal with things
>like comments longer than Oracle's 4000 char limit (which requires you to
>switch to a different object with its own tricky weird rules for using it
>- I would think it should be a transparent-to-the-user switch, just use a
>different datatype, and unfortunately I would be wrong for thinking that).
>Additionally, I don't want to have to do this for almost every field I
>have - it seems to largely defeat the purpose of having the database in
>the first place.
>
>As an OO programmer, my intuition says that the database should be able to
>abstract these picky detail away from me so I don't have to worry about
>it. Right now I'm writing an extra layer to do it, but I really wanted to
>understand why I have to bother. I assume it's ignorance, and like the
>disk page explanation, and would love more explanations along those lines
>along with thoughts on working around them.
>
>-David
>--
>David Eison (404) 892-6579 x 212 <http://www.cc.gatech.edu/~eison>
>Brother, Phi Kappa Theta Fraternity
Received on Tue Mar 21 2000 - 00:00:00 CET

Original text of this message