Question about Foreign key constraint causes "costly sequential scans"?

From: Emi Lu <emilu(at)cs(dot)concordia(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Question about Foreign key constraint causes "costly sequential scans"?
Date: 2005-08-23 14:30:14
Message-ID: 430B32F6.7090408@cs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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) REFERENCES B(colB1)

But I got a warning msg from postgresql as:

foreign key constraint "Aclo3_fk" will require costly sequential scans

Some comments about it?

Thanks a lot!
Emi

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas F. O'Connell 2005-08-23 14:31:20 Re: ORDER BY time consuming
Previous Message Ilja Golshtein 2005-08-23 14:02:05 Re: ctid access is slow