Re: setting up foreign keys
От | Chris |
---|---|
Тема | Re: setting up foreign keys |
Дата | |
Msg-id | 44DAEB04.9050306@gmail.com обсуждение исходный текст |
Ответ на | setting up foreign keys (Sue Fitt <sue@inf.ed.ac.uk>) |
Ответы |
Re: setting up foreign keys
|
Список | pgsql-performance |
Sue Fitt wrote: > Hi all, > > This is my first post to the performance list, I hope someone can help me. > > I'm setting up a table with 2 columns, both of which reference a column > in another table: > > CREATE TABLE headwords_core_lexemes ( > core_id int REFERENCES headwords_core(core_id), > lexeme_id int REFERENCES headwords_core(core_id), > ); One problem here is both of these are referencing the same column ;) I'm sure that's a typo. It sounds like you have something blocking or locking the other table. Check pg_locks (I think it is), 13,000 rows shouldn't take *that* long. Make sure there is an index on headwords_core(core_id) and whatever the other column should be. Foreign keys have to check the other table so without those indexes, it will be slow(er). -- Postgresql & php tutorials http://www.designmagick.com/
В списке pgsql-performance по дате отправления: