Re: A real world example

From: JOG <jog_at_cs.nott.ac.uk>
Date: 16 Aug 2006 03:51:32 -0700
Message-ID: <1155725491.968044.320240_at_p79g2000cwp.googlegroups.com>


Brian Selzer wrote:
> [snippage]
> I disagree. The definition of a key is critical. Because its scope is a
> single database instance, it cannot permanently identify things in a
> universe that can change.

Ok, I understand your point there - you want a form of key that is consistent across relation values. I agree that is useful, and terminology is sketchy. However given that the definition of a database relation is still argued (date/pascal for example), I think we have to concede there is also ambiguity at the very edges of the term key. As ever as long as we are talking about the same thing we'll be ok.

> [snippage]
> > It is important to see that "Me now" is a completely different entity
> > to "Me over my whole lifetime". The temporal issue is irrelevant, all
> > that matters is to recognise they are just different entites. I know
> > this is initially seems an obtuse philosophical point, but it has
> > _real_ consequences for how to model those entities.
> >
>
> I see the difference, but I can't see how you can shrug off the temporal
> issue.

Temporal differences are just a context change. Geographical/Cultural/etc may be another generating exactly the same problems. There is no way I'm shrugging it off, I'm just saying we can't just externalise it - its integral to the universe of discourse we are concerned with.

> They must have a common property because they're related. I would
> argue that "Me now" is part of "Me over my whole lifetime."

"Me now" and "Me over my lifetime" could have a common property, but they don't _have to_ as they are entities from separate domains. Again it's the universe of discourse under concern that matters. At some point the chances are they will have common properties, but a DNA value might not be recorded for "Me now" and it still be perfectly valid in its domain.

>
> > Something must remain constant to compare entities - something must
> > identify them. If nothing remains constant the things being compared,
> > by liebniz equality, are different things full stop. This is what
> > mathematical logic is grounded in, we can't just avoid it. You seem to
> > be saying it is possible that "every attribute of something has
> > changed, yet it is still the same thing". Surely that's logical
> > nonsense!
> >
>
> In the mathematical sense, if *any* attribute is different, then they're
> different, but that's beside the point. I'm not saying that it is possible
> that "every attribute of something has changed, yet it is still the same
> thing" What I'm saying is that "every universal property of something can
> change, yet it is still the same thing." I know I'm going to get beat up
> about this, but as I see it, there is a difference between a property that
> defines something and a property that describes something. In an earlier
> post, I used the terms, "individual" and "universal" to describe these
> categories of properties. Individual properties define the essence of
> something and remain constant throughout its lifetime. Universal properties
> depend on the state of the universe during that lifetime. Universal
> properties are the only ones that can change.

I've wrestled with definitional and descriptional properties too, and I've come to the conclusion (painfully) from reading the philosophy that there isn't any difference. Consider two towers, identical in every way, one in paris and one in london. The only difference to identify them is their geographical position. Then, what we may have thought of as a descriptional property originally. is now necessarily definitional. Its a murky distinction. I'll post a better example at some point, as I think this also contributes to why we shouldn't hide surrogates.

>
> "Are you the same person you were when you were 10?" depends on the context
> of the query, not necessarily the data, but in either context, you must be
> able to correlate the state when you were 10 to the state you are now in
> order to do the comparison. In the one context, you would compare the
> individual properties; in the other you would compare the universal
> properties.

No! You have already presumed they are the same person if you do that.

All one needs to do is see if the two entities _do correlate or not_ (And not assume they do a priori). If they don't, as in the identity is not the same, I conclude they are different people. If they do, I can say they are the same person, but in different states. I apologise for banging on about liebniz all the time, but thats exactly how we distinguish whether something is the same thing or not (conceding that functional dependency means we can rely on the key for identity in RM). I think this is a big point where we are differing.

>
> >
> >>
> >> > This is exactly the same as the basic philosophical question of change.
> >> > Are you the same person you were when you were 10? In one context the
> >> > answer is absolutely not, so an appropriate identifier is not DNA. In
> >> > another yes you are the same person, so DNA is perfect. It depends on
> >> > the domain you are considering, and one must pick the correct key
> >> > accordingly.
> >
> > I worry you have glazed over this, but it highlights how the context
> > information is more complex than we initially think, and we must
> > understand that context to make the right key choices (especially if
> > you want to make inter-relation value comparisons).
> >
> > My DNA don't change over my lifetime, so its a good key for that
> > conceptual entity (n.b. the representative label to record the DNA
> > might change, but the value is the same.)
> >
> >> >
> >> >
> >> >>
> >> >>
> >> >> Here's a simple example of what can happen:
> >> >>
> >> >> create table P
> >> >> (
> >> >> x int primary key,
> >> >> y int
> >> >> )
> >> >> create table F
> >> >> (
> >> >> x int primary key references P(x),
> >> >> z int
> >> >> )
> >> >> insert P (x, y) values (1, 1)
> >> >> insert P (x, y) values (2, 3)
> >> >> insert P (x, y) values (3, 2)
> >> >> insert F (x, z) values (1, 5)
> >> >> insert F (x, z) values (2, 4)
> >> >> select * from P join F on (p.x = F.x)
> >> >> update P
> >> >> set x = case x
> >> >> when 1 then 2
> >> >> when 2 then 1
> >> >> end
> >> >> where x in (1, 2)
> >> >> select * from P join F on (p.x = f.x)
> >> >>
> >> >> RESULTS:
> >> >>
> >> >> Before:
> >> >> x y x z
> >> >> ------ -------- ------- --------
> >> >> 1 1 1 5
> >> >> 2 3 2 4
> >> >>
> >> >> After:
> >> >> x y x z
> >> >> ------ ------- -------- --------
> >> >> 1 3 1 5
> >> >> 2 1 2 4
> >> >>
> >> >>
> >> >> Should the new values for x in P have cascaded into F? Assume that
> >> >> the
> >> >> system only has the before image and the after image (the first two
> >> >> columns
> >> >> in RESULTS) in order to complete the update. How can such a system
> >> >> differentiate between the above update and the following update?
> >> >>
> >> >> update P
> >> >> set y = case y
> >> >> when 1 then 3
> >> >> when 3 then 1
> >> >> end
> >> >> where x in (1, 2)
> >> >>
> >> >> Clearly first update affects a key, and consequently, the changes
> >> >> should
> >> >> cascade, but with the information available (both updates produce the
> >> >> exact
> >> >> same before and after images), the system cannot differentiate between
> >> >> the
> >> >> two updates; therefore, it cannot determine whether or not to cascade
> >> >> the
> >> >> changes. Updates within the Relational Model are are constrained in
> >> >> the
> >> >> same way as this hypothetical system. All that is available is the
> >> >> preceding instance and the succeeding instance, and if the only key
> >> >> can
> >> >> change, then there is no way to correlate tuples.
> >> >
> >> > I'll consider the example in due course. RL work to do in the meantime,
> >> > sigh. All best, Jim.
> >> >
> >>
> >> Another example is trying to write an update trigger in Sql Server to log
> >> changes to one table in another. The deleted and inserted pseudotables
> >> can
> >> be thought of as the preceding and succeeding database instances
> >> respectively. Unless you constrain updates to a single row, or reject
> >> updates that affect both key and non-key columns, or use a surrogate, you
> >> can't tell what changed to a particular row. In fact, it's possible for
> >> it
> >> to appear that nothing at all has changed, even though new key values
> >> have
> >> been propogated into referencing tables. (Sql Server does not faithfully
> >> implement the relational model. It can tell the difference between the
> >> two
> >> updates above, even though within a trigger on P, the deleted and
> >> inserted
> >> pseudotables would appear identical.)
> >
Received on Wed Aug 16 2006 - 12:51:32 CEST

Original text of this message