Timeline for Unique constraint for single structure that simulates relations between tables
Current License: CC BY-SA 4.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 17 at 0:35 | comment | added | J.D. | @Macok Yea, typically a single denormalized table with every combination is an anti-pattern and not a good way to manage data. It is error prone and will lack performance features that separate tables naturally have. | |
May 16 at 21:43 | comment | added | Macok | @J.D. This is a big concern. My initial thought was that having so many possible combinations will make it costly and error prone to check certain conditions. Is cat in a car? I need to check cat-car, cat-carrier-car, cat-carrier-box-car and cat-box-car. Listing all cats in a car has also that many combinations. Ultimately, I think I'll need to do it with separate tables and helper views. I had an idea and wanted to check if it is any good. | |
May 16 at 14:19 | comment | added | J.D. | @Macok FWIW, this single table is denormalized and not a good way to manage data from an integrity standpoint. Why do you feel the need to use a single joined table instead of the separately normalized tables? | |
May 16 at 14:12 | answer | added | SergeyA | timeline score: 0 | |
May 16 at 13:40 | comment | added | Akina |
I have also specified the conditions of illogical situations. First 3 conditions can be combined to "cannot exist 2 rows with the same cat" which needs in one unique (cat) . Last 3 conditions can be implemented with according 2-column unique constraints. E.g. for condition 4 this will be unique by (carrier, box) .
|
|
May 16 at 13:37 | comment | added | Akina | I do not know why th tables were bad. Empty line between text and table is compulsory. | |
May 16 at 13:31 | history | edited | Macok | CC BY-SA 4.0 |
added 14 characters in body
|
May 16 at 13:30 | comment | added | Macok | @Akina Thanks for the edit, I do not know why th tables were bad. I have also specified the conditions of illogical situations. | |
May 16 at 13:30 | history | edited | Macok | CC BY-SA 4.0 |
added 312 characters in body
|
May 16 at 12:41 | comment | added | Akina |
I have to make sure that there are no illogical data Does the below illogical situations are complete list of possible illogicals? if not then expand the illogical data situations list. Cat carrier cannot be in two boxes at once unique by (carrier, box) . Cat cannot be in a carrier and cat box separately Unique (cat) .
|
|
May 16 at 12:36 | history | edited | Akina | CC BY-SA 4.0 |
added 6 characters in body
|
S May 16 at 11:48 | review | First questions | |||
May 16 at 20:23 | |||||
S May 16 at 11:48 | history | asked | Macok | CC BY-SA 4.0 |