Optimizing FK & PK performance...

Поиск
Список
Период
Сортировка
От Sean P. Thomas
Тема Optimizing FK & PK performance...
Дата
Msg-id 3FD89D72.8080508@ulanji.com
обсуждение исходный текст
Ответы Re: Optimizing FK & PK performance...  (Neil Conway <neilc@samurai.com>)
Re: Optimizing FK & PK performance...  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-performance
I am working on migrating to postgres and had some questions regarding
optimization that I could not find references in the documentation:


1. Is there any performance difference for declaring a primary or
foreign key a column or table contraint?  From the documentation, which
way is faster and/or scales better:


CREATE TABLE distributors (
      did     integer,
      name    varchar(40),
      PRIMARY KEY(did)
);

CREATE TABLE distributors (
      did     integer PRIMARY KEY,
      name    varchar(40)
);


2. Is DEFERRABLE and INITIALLY IMMEDIATE or INITIALLY DEFERRABLE
perferred for performance?  We generally have very small transactions
(web app) but we utilize a model of:

view (limit scope for security) -> rules -> before triggers (validate
permissions and to set proper permissions) -> tables.

I know there were some issues with deferring that was fixed but does it
benefit performance or cause any reliability issues?


Thank you for your assistance and let me know if I can offer additional
information.

                            --spt




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

Предыдущее
От: Manfred Spraul
Дата:
Сообщение: Re: [HACKERS] fsync method checking
Следующее
От: "Chadwick, Russell"
Дата:
Сообщение: Excessive rows/tuples seriously degrading query performance