![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
That article makes me want to vomit uncontrollably! ;-) "Business data might also simply be bad -- glitches in the Social Security Administration's system may lead to different persons having the same Social Security Number. A surrogate key helps to isolate the system from such problems." The surrogate key isn't solving the underlying logical inconsistency problem. It is being used as a work-around to cover one up. I suspect the author of being a MySQL user. |
#12
| |||
| |||
|
|
joking Apparently gamma functions and string theory have little to do with understanding the relational model of data. /joking |
#13
| |||
| |||
|
|
On Tue, 2004-10-26 at 17:26 -0400, Mike Mascari wrote: joking Apparently gamma functions and string theory have little to do with understanding the relational model of data. /joking mmmmm.. string theory. :-) |
#14
| |||
| |||
|
|
On Tue, 26 Oct 2004 17:05:27 -0700, Robby Russell <robby (AT) planetargon (DOT) com>wrote: On Tue, 2004-10-26 at 17:26 -0400, Mike Mascari wrote: joking Apparently gamma functions and string theory have little to do with understanding the relational model of data. /joking mmmmm.. string theory. :-) Ya you know the theory that states that the Database is really made up of a large amount of strings. Some are even null terminated strings, although most strings really have a quanta that can be found immediate before the string. :-) |
#15
| |||
| |||
|
|
On Tue, 26 Oct 2004 17:05:27 -0700, Robby Russell <robby (AT) planetargon (DOT) com>wrote: On Tue, 2004-10-26 at 17:26 -0400, Mike Mascari wrote: joking Apparently gamma functions and string theory have little to do with understanding the relational model of data. /joking mmmmm.. string theory. :-) Ya you know the theory that states that the Database is really made up of a large amount of strings. Some are even null terminated strings, although most strings really have a quanta that can be found immediate before the string. :-) |
#16
| |||
| |||
|
|
This existing unique field will have to be a character of fixed length (VARCHAR(12)) because although it's a numeric value there will be leading zeroes. |
#17
| |||
| |||
|
|
3. If you'll need things like "last 50 keys", you can SELECT * FROM foo ORDER BY yourserialkey DESC LIMIT 50; |
#18
| |||
| |||
|
#19
| |||
| |||
|
|
Dawid, I am interested in the first point you made that: having varchar(12) in every referencing table, takes more storage space. The thing is though, if I have a serial primary key then it would be an additional column. Or you are saying the space taken by a VARCHAR(12) field is more than two INT fields? ( or is it the fact that when it is referenced it will appear several times?) I guess the reason I am resisting the idea of an additional primary key field is to avoid the additional lookup in some queries. Perhaps it's a minor almost irrelevant performance factor. |
#20
| |||
| |||
|
|
From: Bruno Wolff III <bruno (AT) wolff (DOT) to To: Sally Sally <dedeb17 (AT) hotmail (DOT) com CC: pgsql-general (AT) postgresql (DOT) org, qnex42 (AT) gmail (DOT) com Subject: Re: [GENERAL] primary key and existing unique fields Date: Thu, 28 Oct 2004 12:44:00 -0500 On Thu, Oct 28, 2004 at 14:31:32 +0000, Sally Sally <dedeb17 (AT) hotmail (DOT) com> wrote: Dawid, I am interested in the first point you made that: having varchar(12) in every referencing table, takes more storage space. The thing is though, if I have a serial primary key then it would be an additional column. Or you are saying the space taken by a VARCHAR(12) field is more than two INT fields? ( or is it the fact that when it is referenced it will appear several times?) I guess the reason I am resisting the idea of an additional primary key field is to avoid the additional lookup in some queries. Perhaps it's a minor almost irrelevant performance factor. I think it is better to worry about what is going to make it easiest to have clean data and to support future changes than worry about performance. Over the long run hardware is cheaper than people. ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend |
![]() |
| Thread Tools | |
| Display Modes | |
| |