Re: [GENERAL] Question about Foreign key constraint causes "costly

2005-08-23 Thread Michael Fuhr
On Tue, Aug 23, 2005 at 02:53:33PM +, Matt Miller wrote: > On Tue, 2005-08-23 at 10:30 -0400, Emi Lu wrote: > > I'd like to setup foreign key constraint for A.col3, as the following: > > CONSTRAINT Aclo3_fk FOREIGN KEY (col3) REFERENCES B(colB1) > > > > But I got a warning msg from postgresql

Re: [GENERAL] Question about Foreign key constraint causes "costly

2005-08-23 Thread Emi Lu
Thanks a lot for all helps. I do not have warnings anymore :-) I'd like to setup foreign key constraint for A.col3, as the following: CONSTRAINT Aclo3_fk FOREIGN KEY (col3) REFERENCES B(colB1) But I got a warning msg from postgresql as: foreign key constraint "Aclo3_fk" will require costly

Re: [GENERAL] Question about Foreign key constraint causes "costly sequential scans"?

2005-08-23 Thread Michael Fuhr
On Tue, Aug 23, 2005 at 10:30:14AM -0400, Emi Lu wrote: > I'd like to setup foreign key constraint for A.col3, as the following: > CONSTRAINT Aclo3_fk FOREIGN KEY (col3) REFERENCES B(colB1) > > But I got a warning msg from postgresql as: > > foreign key constraint "Aclo3_fk" will require costly

Re: [GENERAL] Question about Foreign key constraint causes "costly

2005-08-23 Thread Matt Miller
On Tue, 2005-08-23 at 10:30 -0400, Emi Lu wrote: > I'd like to setup foreign key constraint for A.col3, as the following: > CONSTRAINT Aclo3_fk FOREIGN KEY (col3) REFERENCES B(colB1) > > But I got a warning msg from postgresql as: > >foreign key constraint "Aclo3_fk" will require costly seque

Re: [GENERAL] Question about Foreign key constraint causes "costly sequential scans"?

2005-08-23 Thread Tom Lane
Emi Lu <[EMAIL PROTECTED]> writes: > But I got a warning msg from postgresql as: >foreign key constraint "Aclo3_fk" will require costly sequential scans Try to make the referencing and referenced columns the same datatype. regards, tom lane ---

[GENERAL] Question about Foreign key constraint causes "costly sequential scans"?

2005-08-23 Thread Emi Lu
Greetings, I have a question about foreign key cost. I have two tables A and B. A has 300,000 records, B has 3 records. A (col1, col2, col3... ... colN) B (colB1 primary key, colB2) I'd like to setup foreign key constraint for A.col3, as the following: CONSTRAINT Aclo3_fk FOREIGN KEY (col3) RE