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

Поиск
Список
Период
Сортировка
От Emi Lu
Тема Question about Foreign key constraint causes "costly sequential scans"?
Дата
Msg-id 430B32F6.7090408@cs.concordia.ca
обсуждение исходный текст
Ответы Re: Question about Foreign key constraint causes "costly sequential scans"?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Question about Foreign key constraint causes "costly  (Matt Miller <mattm@epx.com>)
Re: Question about Foreign key constraint causes "costly sequential scans"?  (Michael Fuhr <mike@fuhr.org>)
Список 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




В списке pgsql-general по дате отправления:

Предыдущее
От: "Ilja Golshtein"
Дата:
Сообщение: Re: ctid access is slow
Следующее
От: "Thomas F. O'Connell"
Дата:
Сообщение: Re: ORDER BY time consuming