Re: FK Constraints, indexes and performance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: FK Constraints, indexes and performance
Дата
Msg-id 19626.1065415203@sss.pgh.pa.us
обсуждение исходный текст
Ответ на FK Constraints, indexes and performance  (ow <oneway_111@yahoo.com>)
Ответы Re: FK Constraints, indexes and performance  (ow <oneway_111@yahoo.com>)
Список pgsql-sql
ow <oneway_111@yahoo.com> writes:
> It's understood that FK constraints carry some performance hit. However, the
> performance hit I observe is huge.

It looks to me like the 7.3 planner will not choose indexscans for the FK
check queries in this example, because the comparison operators are
misconstrued as shown in this thread:
http://archives.postgresql.org/pgsql-hackers/2003-03/msg00997.php
The equality operator on your domain is taken to be "oideq" which won't
be the same operator associated with the index on the column.

This seems to be fixed in 7.4.  In 7.3 I'd counsel not introducing
domains unnecessarily.
        regards, tom lane


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

Предыдущее
От: ow
Дата:
Сообщение: FK Constraints, indexes and performance
Следующее
От: Peter Childs
Дата:
Сообщение: Re: FK Constraints, indexes and performance