Re: Question about Foreign key constraint causes "costly
В списке pgsql-general по дате отправления:
| От | Michael Fuhr |
|---|---|
| Тема | Re: Question about Foreign key constraint causes "costly |
| Дата | |
| Msg-id | 20050823152611.GA9739@winnie.fuhr.org обсуждение |
| Ответ на | Re: Question about Foreign key constraint causes "costly (Matt Miller <mattm@epx.com>) |
| Список | pgsql-general |
On Tue, Aug 23, 2005 at 02:53:33PM +0000, 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 as: > > > > foreign key constraint "Aclo3_fk" will require costly sequential > > scans > > Index the foreign key: > > create index a_col3_ix on a (col3); > > and then drop an recreate the foreign key and see if the warning is > still there. That's a good idea, but it's not the condition that elicits the "will require costly sequential scans" warning. That warning is caused by the keys being of different types (see ATAddForeignKeyConstraint() in src/backend/commands/tablecmds.c in the source code for 8.0 and later). -- Michael Fuhr
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера