Re: Indexes for Foreign Keys?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Indexes for Foreign Keys?
Дата
Msg-id 14807.1193684343@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Indexes for Foreign Keys?  ("Jeff Larsen" <jlar310@gmail.com>)
Список pgsql-admin
"Jeff Larsen" <jlar310@gmail.com> writes:
> I've noticed that PG automatically creates indexes when you create a
> primary key. But when you create a foreign key on a child table, it
> does not create an index on the referencing columns of the child
> table.

This is intentional since depending on what your workload is like,
the index on the child table might be more overhead than it's worth.

If you frequently do updates or deletes on the parent column, you'll
want to have the child column indexed.

            regards, tom lane

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

Предыдущее
От: "Medi Montaseri"
Дата:
Сообщение: Re: [HACKERS] grep command
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: Problem with PITR Past Particular WAL File