| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Pizza Example
On Mon, 05 Apr 2004 11:19:56 -0500, Dawn M. Wolthuis wrote:
[snip]
> I understand now from Paul's response that the reason folks like to
> restrict the size of fields is not for performance reasons, but because
> they want the database, not just software applications, to kick out data
> that is clearly wrong. I suspect that in many cases, by the time data
> reaches the DBMS a software developer has already found a reason to apply
> constraint logic (coded outside of the database) to the transactions
> because they needed to for the GUI or to provide an immediate response to
> a web services transaction, but this locks down the database further so if
> a programmer doesn't catch something, the database will.
>
> It does seem to me that it might make more sense, then, for these lengths
> to give warnings in many cases, rather than be fixed constraints if they
> are checking for the likelihood of good data, but I don't know if there is
> a clean way to do that.
>
This runs counter to the DBA culture. As a DBA my primary responsibility is the integrity of the contents of the database. Giving a warning implies that I store bad data that doesn't satisfy my validation rules. I would rather bounce any questionable data back to those who know it and have the ability to correct it. (If they need to increase the size of the column I can do that without taking the database down, so this is not a biggie and won't interfere with any other use of the database.)
> Otherwise, allowing the database to store every data element as variable
> length unless there is a clear business reason not to, but ensuring that
> all points of entry of data -- GUI or web service, for example -- apply
> constraint logic with warnings in cases where unlikely data is entered
> makes more sense to me.
>
There are rules for maximum length for many data items. For example, the
maximum length of the standard US Postal Service name of a city in the US
is 14 characters. The maximum length of an international telephone number
is either 14 or 15 characters. The length of a US Postal Code is zip+4 or
9 integer digits. In these and similar cases if the size of the data
exceeds the database specification it is wrong and should be rejected out
of hand. When it comes to the length of names, for example, I agree with
your position that a relatively long variable length column be used.
[snip]
>> > Constraining the database to only store up to a particular length >> > means that the database needs to be changed if a new
>> > value for an attribute arises that is longer than what was >> > anticipated. >> >> How terrifying! More likely of course, the user will come up with a >> suitably abbreviated name. We are all familiar with such abbreviated >> names from till receipts, credit card statements etc.
Whoa! I can alter a table and increase the width of a column without taking the database down or interfering with the users of the database. There is no risk in increasing the width of a column. If you are working with a DBA who refuses to make necessary changes or a DBMS that won't allow such changes get rid of the offender.
[snip]
>> >> What it is worth is a LOT, since computers work better with data >> structured according to rules rather than "unstructured" or "natural" >> data. Who cares if it seems "natural" to you? If you are a database >> designer, you better learn to see beyond the "natural" if you are going >> to be useful, and if you are an end-user accessing the database via an >> application you can be protected from needing to understand the >> relational way of doing it.
> What I have seen with RDBMS's is that the size constraint is placed on
> everything while more important constraints
> related to the allowable values are not as often applied, especially
> when it is a "yellow flag" type of data value for an attribute rather
> than obviously not permitted. I'll put this in a separate thread at some
> point (but have several other questions prior to that one).
>
I prefer that the "more important constraints" be handled by the application programs rather than incorporated into the RDBMS. This is because the application programs are specified and written by developers and analysts who are working with the users and have first hand knowledge of the business rules while the database is cared for by the DBAs who are concerned with the efficiency and effectiveness of the database in meeting the needs of many different applications.
HTH
Jerry
Received on Tue Apr 06 2004 - 00:00:26 CDT
![]() |
![]() |