Re: setting up foreign keys

Поиск
Список
Период
Сортировка
От Sue Fitt
Тема Re: setting up foreign keys
Дата
Msg-id 44DAF6B7.1090800@inf.ed.ac.uk
обсуждение исходный текст
Ответ на Re: setting up foreign keys  (Chris <dmagick@gmail.com>)
Ответы Re: setting up foreign keys  (Chris <dmagick@gmail.com>)
Список pgsql-performance
Thanks Chris and Chris, you've solved it.

I had a gui open that connects to the database. It was doing nothing
(and not preventing me adding to or altering headwords_core via psql),
but having closed it the table is instantly created. Weird.

BTW, referencing the same column twice is deliberate, it's a
cross-reference.

Sue

Chris Mair wrote:
 >> 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),
 >> );
 >>
 >> Trouble is, it's taken 18 hours and counting!  The table
headwords_core only has about 13,000 lines, and core_id is the primary
key on that table. However, I assume it must be those 13,000 lines that
are the problem, since if I try it referencing a similar table with 360
lines the new table is created almost instantly.
 >>
 >
 > Hi,
 >
 > the 13000 rows in headwords_core don't matter at all for what this
 > statement concerns. I bet you have another idle transaction that keeps
 > headwords_core locked, for example because you did an
 > alter table headwords_core there...
 >
 > Bye,
 > Chris.
 >
 >

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

Предыдущее
От: Chris
Дата:
Сообщение: Re: setting up foreign keys
Следующее
От: Chris
Дата:
Сообщение: Re: setting up foreign keys