Re: [GENERAL] Storage of Foreign Keys

2009-09-22 Thread Lew
Scott Marlowe wrote: On Mon, Sep 21, 2009 at 11:09 AM, Alan Hodgson wrote: On Monday 21 September 2009, Christian Koetschan wrote: Is everything I insert into mycolA and mycolB stored twice, or is there something like a pointer/reference from mycolA to the things stored in mycolB? It's stor

Re: [GENERAL] Storage of Foreign Keys

2009-09-21 Thread Scott Marlowe
On Mon, Sep 21, 2009 at 11:09 AM, Alan Hodgson wrote: > On Monday 21 September 2009, Christian Koetschan > wrote: >> Is everything I insert into mycolA and mycolB stored twice, or >> is there something like a pointer/reference from mycolA to the things >> stored in mycolB? >> > > It's stored twic

Re: [GENERAL] Storage of Foreign Keys

2009-09-21 Thread Alan Hodgson
On Monday 21 September 2009, Christian Koetschan wrote: > Is everything I insert into mycolA and mycolB stored twice, or > is there something like a pointer/reference from mycolA to the things > stored in mycolB? > It's stored twice and for performance you need to index it in both tables. If yo

[GENERAL] Storage of Foreign Keys

2009-09-21 Thread Christian Koetschan
Hi, can anybody tell me how postgres internally stores foreign keys... E.g. I have a table "tableA" with column "mycolA text" and the constraint FOREIGN KEY(mycolA) REFERENCES tableB(mycolB) Is everything I insert into mycolA and mycolB stored twice, or is there something like a pointer/referenc