![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Clifford Heath wrote: [Nulls] are an efficiency feature, added to allow a reduction in the number of physical tables required, *PLONK!* And on so many levels too. |
#12
| |||
| |||
|
|
* *It sounds as if you are getting into premature optimisation. Well. I'd rather think of it as a willing to do everything correctly |
|
Roy Hann wrote: Clifford Heath wrote: [Nulls] are an efficiency feature, added to allow a reduction in the number of physical tables required, *PLONK!* *And on so many levels too. Twat. If you want to avoid NULLs, you add tables. Cleaner, but typically slower.. Perhaps not the way it should be, but the way existing RDBMS' are. If I want to avoid using NULLs on a logical level (and I do), I'd just |
#13
| |||
| |||
|
|
Clifford Heath wrote: [Nulls] are an efficiency feature, added to allow a reduction in the number of physical tables required, as a concession to the physical access characteristics of mechanical storage devices. *PLONK!* *And on so many levels too. An *efficiency feature*. Never heard that one before. Typical mumbo |
#14
| |||
| |||
|
|
On 10 nov, 10:18, Roy Hann<specia... (AT) processed (DOT) almost.meat> wrote: Clifford Heath wrote: [Nulls] are an efficiency feature, added to allow a reduction in the number of physical tables required, as a concession to the physical access characteristics of mechanical storage devices. *PLONK!* And on so many levels too. An *efficiency feature*. Never heard that one before. Typical mumbo jumbo. |
#15
| |||
| |||
|
|
putting the performance cart before the functional cart |
#16
| |||
| |||
|
|
On Wed, 10 Nov 2010 15:54:26 -0800 (PST), Kentauros joker.vd (AT) gmail (DOT) com> wrote: On Nov 11, 12:39 am, Hugo Kornelis h... (AT) perFact (DOT) REMOVETHIS.info.INVALID> wrote: ... The predicate "<Character> has<Defense>", for instance, is incomplete. To complete it, you have to change it to "<Character> has Defense> in<Game>". The problem is, many characteristics never change at all. But why is that a problem? "Wario has defense 17 in Super Mario World" "Wario has defense 17 in Super Mario World 2" "Wario has defense 17 in Super Mario World 3D" "Wario has defense 17 in Super Mario World - the last part" "Wario has defense 17 in Super Mario World - the sequel to the last part" There is nothing wrong with this extension. The candidate key for this relvar is (Character, Game), and there are no violations of this key, or of any other constraint. From your posts, I get the impression that you try to minimize the number of distinct facts in the database. In my experience, it is often far better to minimize the number of distinct predicates.... |
#17
| |||||
| |||||
|
|
On Nov 11, 10:32*pm, Hugo Kornelis h... (AT) perFact (DOT) REMOVETHIS.info.INVALID> wrote: But why is that a problem? "Wario has defense 17 in Super Mario World" "Wario has defense 17 in Super Mario World 2" "Wario has defense 17 in Super Mario World 3D" "Wario has defense 17 in Super Mario World - the last part" "Wario has defense 17 in Super Mario World - the sequel to the last part" There is nothing wrong with this extension. The candidate key for this relvar is (Character, Game), and there are no violations of this key, or of any other constraint. The redundancy. That is what wrong. |
|
I'm wondering why you have introduced a character number, and why the CharacterName is not a candidate key. Since this is all about tracking different characteristics of the same character in different games, I would have expected the character name to be the most obvious identifier for characters - or are there indeed any games with a "Sonic" character that is not derived from the original hedgehog? Because these CharacterNumbers exist in the games, they're visible to players, and they behave just like AUTOINCREMENT. Well, if the game characters have such wonderful characterstic, I surely pick it as a primary key. |
|
But it seems that the table Characters has to go characters have different sets of characteristics in different games, and I can't predict what will (dis)appear or which remained characteristic change -- except for name. But why would that impact the table Characters? If a character exists in a game, you can represent that fact in this table, regardless of his/her characteristics. It's the work for CharacterExistence. The table Characters were intended to store characters' characteristics. Maybe CharactersCharacteristics would be a better name. |
|
This is not a good constraint. What will you do if a new game is relased next month (just in time for Christmas), where special is mandatory again? Change the constraints? Yes. Just change the constraints. So the constraints will mean "Special is mandatory in the first and the (currently) last games, but is absent in any other game". It's pretty simple and won't take any changing in table. |
|
I'm also wondering about your choice to use seperate tables for each characteristic (attack, defense, special, ...). Not that this is really WRONG, but it might not be the best choice either. Have you considered the predicate "<Character> has <Characteristic> <score> in Game>" to replace all these? Yes. And I don't think it will work. What will the domain of <score be? Alpha? No, thank you very much. Such relation would require an enormous number of constraints. |
#18
| |||
| |||
|
|
Roy H snipped the first sentence in Clifford H's paragraph: "You shouldn't need NULLs in your conceptual model." For me the big problem with nulls is that I don't know how to express them in a predicate. |
|
(Until the late 1990's, I never thought much about predicates only because I hadn't seen much written about them. |
|
Instead, I had thought of relations as being abstractions of what I called uniform sentences. This 'thinking' was casual and a little fuzzy, not formal at all but it did at least prevent me from associating two 'very unlike' sentences with the same 'table'.) |
#19
| ||||
| ||||
|
|
Don't forget that in the context of databases, "redundancy" refers to representing the same *fact* more than once, not about storing the same *value* more than once. [...] As long as you stick to your choice. You should not try to combine these alternatives - as that WOULD introduce the redundancy you already thought to see in the first alternative. |
|
Unless it is possible for a character to exist in a game with no characteristic at all (and you have already told us it isn't), the existence of a character in a game is implied by the character having characteristics in that game; adding a seperate relvar to store its existence would be redundant. |
|
Most people in the field will tell you that it is not good practice to have constraints that need to change based on foreseeable changes in the world. They'll also tell you that is is best not to mix data and metadata. Your constraint violates both advices. |
|
I'm also wondering about your choice to use seperate tables for each characteristic (attack, defense, special, ...). Not that this is really WRONG, but it might not be the best choice either. Have you considered the predicate "<Character> has <Characteristic> <score> in Game>" to replace all these? Yes. And I don't think it will work. What will the domain of <score be? Alpha? No, thank you very much. Such relation would require an enormous number of constraints. Yes, that is true. Welcome rock, meet hard place. You'll either have a model that's easy to query and has lots of nasty constraints, or you can choose a model with relatively simple constraint that is tough to query. Neither of these choices is automatically better than the other; it's a choice you'll have to make, based on how you expect the system to be used. Well. Actually, when I query some data about character, I specify what |
![]() |
| Thread Tools | |
| Display Modes | |
| |