Re: Foreign key slows down copy/insert
От | Tom Lane |
---|---|
Тема | Re: Foreign key slows down copy/insert |
Дата | |
Msg-id | 742.1113491145@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Foreign key slows down copy/insert (Stephan Szabo <sszabo@megazone.bigpanda.com>) |
Ответы |
Re: Foreign key slows down copy/insert
|
Список | pgsql-performance |
Stephan Szabo <sszabo@megazone.bigpanda.com> writes: > ... At some point, if we can work out how to do all the semantics > properly, it'd probably be possible to replace the insert type check with > a per-statement check which would be somewhere in between. That requires > access to the affected rows inside the trigger which I don't believe is > available currently. Not necessarily. It occurs to me that maybe what we need is "lossy storage" of the trigger events. If we could detect that the queue of pending checks for a particular FK is getting large, we could discard the whole queue and replace it with one entry that says "run the wholesale check again when we are ready to fire triggers". I'm not sure how to detect this efficiently, though --- the trigger manager doesn't presently know anything about FKs being different from any other kind of trigger. regards, tom lane
В списке pgsql-performance по дате отправления: