Re: Foreign key slows down copy/insert

Поиск
Список
Период
Сортировка
От Vivek Khera
Тема Re: Foreign key slows down copy/insert
Дата
Msg-id 5cb421b6dd5dca3586616b66390b0d40@khera.org
обсуждение исходный текст
Ответ на Foreign key slows down copy/insert  (Richard van den Berg <richard.vandenberg@trust-factory.com>)
Список pgsql-performance
On Apr 14, 2005, at 7:59 AM, Richard van den Berg wrote:

> How do I explain why test cases 2 and 3 do not come close to case 1?
> Am I missing something obvious?

there's cost involved with enforcing the FK: if you're indexes can't be
used then you're doing a boatload of sequence scans to find and lock
the referenced rows in the parent tables.

Make sure you have indexes on your FK columns (on *both* tables), and
that the data type on both tables is the same.

Vivek Khera, Ph.D.
+1-301-869-4449 x806


Вложения

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

Предыдущее
От: Vivek Khera
Дата:
Сообщение: Re: Spend 7K *WHERE*? WAS Intel SRCS16 SATA raid? and How
Следующее
От: Vivek Khera
Дата:
Сообщение: Re: What to do with 6 disks?