![]() | |
#31
| |||
| |||
|
|
dawn wrote: mAsterdam wrote: dawn wrote: ... What does it mean that a list is a key? If I change one value in the list, does that make it a new key? I would think so. If I change the order of the items in the list, does that make it a new key? I would think so. (See below) Yes, I too often mix sets & lists when I think in terms of the MV data model, which has only list attributes in which conceptual sets & lists are both implemented. Really? Are sets implemented as well? |
|
I thought it was more like this: When you have a model only supporting lists (e.g. XML) you have no choice but to implement any multi-value thingy as a list - wether you initially thought of it as a set or not. |
#32
| |||
| |||
|
|
"mAsterdam" <mAsterdam (AT) vrijdag (DOT) org> wrote If I change the order of the items in the list, does that make it a new key? I would think so. (See below) In other words, an onion and mushroom pizza is different from a mushroom and onion pizza. Here we go again. |
#33
| |||
| |||
|
|
mAsterdam wrote: dawn wrote: ... What does it mean that a list is a key? If I change one value in the list, does that make it a new key? I would think so. If I change the order of the items in the list, does that make it a new key? I would think so. (See below) Sure. If you change the order of the bits in the int, that makes it a new key as well. If you make a logical change to the value, it's a different value. (Likewise, if the logical value stays the same but something else changes, it's the same value.) |
#34
| |||
| |||
|
|
On 26 Feb 2006 08:19:50 -0800, "Marshall Spight" marshall.spight (AT) gmail (DOT) com> wrote: mAsterdam wrote: dawn wrote: ... What does it mean that a list is a key? If I change one value in the list, does that make it a new key? I would think so. If I change the order of the items in the list, does that make it a new key? I would think so. (See below) Sure. If you change the order of the bits in the int, that makes it a new key as well. If you make a logical change to the value, it's a different value. (Likewise, if the logical value stays the same but something else changes, it's the same value.) It's not quite that simple. As David pointed out, a "mushroom and onion pizza" is not necessarily different than an "onion and mushroom pizza". But the ordering of the bits in an integer is significant, whereas the ordering of ingredients for a pizza isn't (although I'd definitely want to make the crust before I put the tomato sauce on it<g>). |
#35
| |||
| |||
|
|
It would be nice to see an example of something that would also scale comfortably beyond twenty rows or so. |
#36
| |||
| |||
|
|
Marshall Spight wrote: mAsterdam wrote: dawn wrote: ... What does it mean that a list is a key? If I change one value in the list, does that make it a new key? I would think so. If I change the order of the items in the list, does that make it a new key? I would think so. (See below) Sure. If you change the order of the bits in the int, that makes it a new key as well. If you make a logical change to the value, it's a different value. (Likewise, if the logical value stays the same but something else changes, it's the same value.) It's not quite that simple. As David pointed out, a "mushroom and onion pizza" is not necessarily different than an "onion and mushroom pizza". |
|
But the ordering of the bits in an integer is significant, whereas the ordering of ingredients for a pizza isn't (although I'd definitely want to make the crust before I put the tomato sauce on it<g>). One of the fundamental things in RM is that the Cartesian join of two relations is commutative. Think about the implications of this when trying to decide what requirements a MV key would have to fulfill. |
|
In Joe Celko's book "SQL for Smarties", there is an example of a schema for an airline scheduling system which he uses to illustrate DKNF (starts at the bottom of p. 35). How would someone model this in a MV database? In this and similar threads here, when people talk about the virtues of MV vs. RM, there is a perceived (by me) lack of any real-world examples on the MV side that go beyond trivial things such as stuffing lists of people's phone numbers and e-mail addresses into one ... (hm, I almost said "column" ... I guess "field" would be more appropriate here). It would be nice to see an example of something that would also scale comfortably beyond twenty rows or so. |
#37
| |||
| |||
|
|
The way Pick (and I presume most of the MV family) represent lists is inherently ordered. And, whenever I ask Dawn, or any of the other Pickies who dorp in form time to time whether the order in a list conveys information or not, the answer is always the same: "the programmer knows what the data means". |
#38
| |||
| |||
|
|
David Cressey wrote: "mAsterdam" <mAsterdam (AT) vrijdag (DOT) org> wrote If I change the order of the items in the list, does that make it a new key? I would think so. (See below) In other words, an onion and mushroom pizza is different from a mushroom and onion pizza. Here we go again. Yeah, ehrm well... Is this issue closed? Is there a nice solution? In e.g. XML the basic assumption is that order has meaning, in SQL it is that order has no meaning. Historically (XML coming from a document heritage, SQL from experiments with relational products) this makes sense, but I would prefer it if one could choose wether order is meaningful/worth preserving/relevant or not - instead of being pushed into one way of thinking or another because of the background of the product at hand. |
#39
| |||||||||||
| |||||||||||
|
|
Brian Selzer wrote: "Marshall Spight" <marshall.spight (AT) gmail (DOT) com> wrote in message What I'm trying to convey is that from one point of view, a list has identity, regardless of its contents. I reject this point of view. The system I am building has values and variables only. There are no pointers, there are no addresses, and there is no concept of identity. There is only value. What about the list of operations and materials that are required to produce a part? That certainly has identity. Nope. Just a value. Same as an int. This is not to say that the concept of identity is not consistent. It certainly is, and useful programming languages have been built on top of it. It is foundational to OOP. However, useful systems have been built without it as well; it is not a necessary concept. I disagree. It is a necessary concept, not only externally but also internally. There are plenty of useful general purpose programming languages that don't have any concept of identity in them. Mercury, for example. (And in the non-general-purpose category, SQL.) So I don't see how you could describe the concept as "necessary." Useful, arguable, but not necessary. A turing machine doesn't have any notion of identity. The lamba calculus has no notion of identity. Come to that, the lambda calculus has no concept of equality, either. Huh. So I guess neither one is necessary. I'm not sure we're using the terms in the same way, though. Do you speak Java? Integer i = new Integer(1); Integer j = new Integer(1); System.out.println(i==j); // tests for identity System.out.println(i.equals(j)); // tests for equality Is that how you're using the terms? In Java, == on a reference type tests for reference equality, which is to say identity. If there were no reference types, as in Prolog or SQL or whatever, then there is no identity. |
|
An entity must have identity, otherwise there's no way for the database, or users, for that matter, to distinguish between them. That's the whole point of keys. One distinguishes between values by equality. If two values are equal, they are the same value. If they are not equal, they are not the same value. This is true for key values as well as nonkey values. Keys work because one can compare values, not because one can compare identies. That is the fundamental difference between keys and pointers. |
|
Members of a set don't have identity. |
|
Because a key value determines all other attribute values, it identifies an entity. Sure. This requires only values and equality. But a there's a problem: a key value may change over time, so any given key value's ability to determine what was or is known about an entity is limited to a specific interval, bounded by the time that its value became known by the database and the time that a new value became known. This imposes limitations on the types of updates that can be performed or the types of constraints that can be enforced. Um, I don't see how it does. If you want to impose specific semantics on the data, then that might constain how you allow the data to be updated. But that is true of any constraint. Constraints are semantic things; values are logical things. 240 is a perfectly legal int, but it might not be an allowed age for a person. |
|
If all keys can change, then either updates must be singular, that is, must affect only one entity of any given type at a time, or no temporal constraint (a constraint that involves the state of the database at more than one point in time) can be enforced. I don't see why this should be so. Perhaps I'm just not following your terminology. And anyway, if your domain wants keys that don't change, just apply a constraint that enforces that. |
|
This is a significant limitation of the Relational Model with which I am most familiar, but I suspect that the concept applies to all other data models, which may have means to overcome it. In the Relational Model, all updates are set-based, and if all keys are subject to change during an update and if the cardinality of the update is greater than one, then there's no way to determine which tuple in a new relation value corresponds to any given tuple in the original relation value. I don't see how you can use the word "limitation" to describe what you appear to consider the ability to update too much. Assuming you add code to reject these updates you don't like, would you say that you had "removed a limitation"? |
|
Also, I think you somewhat overstate the case. If I have a relation of customers with customerid in the range 1 - 1000, and I decide I want customer ids to start at 1,000,000, I can "UPDATE Customers set CustomerId = CustomerId + 1000000;" and there's an update that changes keys and has cardinality greater than one, and I can still determine which tuple in the new relation value corresponds to any given tuple in the original relation value. |
|
If you want a system that supports identity, you don't want to be using set theory. There are plenty to choose from, and they are well-supported and popular! |
|
It should be obvious that correlation is necessary to enforce a constraint that involves more than one database state. It's not obvious to me. |
|
Every proposition must necessarily be different from every other proposition, because either something is known, or it isn't: the knowledge contained in a database is a set of propositions, not a collection. Thus every proposition has identity with respect to the state of the database at any specific point in time, and that identity can be revealed as an attribute. If what you're saying here is "every relation must have at least one key" then I agree. If that's not what you're saying, then I don't understand. In order to avoid losing information over time, every new proposition must have a new identity value. In this and in the previous part, it appears you are using the term "identity value" as a synonym for key. Is that correct? |
|
By that I mean that new values exist only for propositions that are completely new to the database rather than to propositions that have been changed. In other words, something can become known by the database, and something that is already known can change. The distinction is subtle, I know, but necessary--especially in a temporal database, but also in one that only requires that transitions be constrained. Perhaps an example is in order. Marshall |
#40
| |||||
| |||||
|
|
After takin a swig o' Arrakan spice grog, mAsterdam belched out: |
|
David Cressey wrote: mAsterdam wrote: If I change the order of the items in the list, does that make it a new key? I would think so. (See below) In other words, an onion and mushroom pizza is different from a mushroom and onion pizza. Here we go again. Yeah, ehrm well... Is this issue closed? Is there a nice solution? In e.g. XML the basic assumption is that order has meaning, in SQL it is that order has no meaning. Historically (XML coming from a document heritage, SQL from experiments with relational products) this makes sense, but I would prefer it if one could choose wether order is meaningful/worth preserving/relevant or not - instead of being pushed into one way of thinking or another because of the background of the product at hand. Is it *always* true, in XML, that order has meaning? |
|
I don't think that's so at all... There may exist cases where relative order can have meaning, but there certainly exist cases where it is irrelevant. For instance, RFC 3733 describes an XML schema for representing contact information (the sort of information that the WHOIS service reports for the various sorts of organizational contacts). In that schema, order is normally expressly NOT significant in indicating meaning. If an XML request for creating a contact submits the <contact:name before or after the <contact:country>, that is entirely irrelevant as far as any application is concerned. |
|
More pointedly, the domain representation, in RFC 3731, can associate multiple nameservers with a domain. The canonical example is: domain:ns domain:hostObj>ns1.example.com</domain:hostObj domain:hostObj>ns2.example.com</domain:hostObj /domain:ns You might perceive an ordering, there; that ordering is not a real one. That is, in formal terms, a set of nameservers. They are NOT ordered, as far as the DNS service is concerned. I'm sure you can find counterexamples; what that would establish is not that "order always has meaning" in XML, but rather that *sometimes* the order of elements in an XML document has meaning. |
|
In effect, you don't have the result you wish you had; in order for order to be preserved, when it important to do so, it is vital to expressly declare that it needs preservation. XML doesn't help as it does not provide any way to systemically indicate that need. |
![]() |
| Thread Tools | |
| Display Modes | |
| |