Re: Foreign key slows down copy/insert
От | Stephan Szabo |
---|---|
Тема | Re: Foreign key slows down copy/insert |
Дата | |
Msg-id | 20050414090931.P42874@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | Re: Foreign key slows down copy/insert (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-performance |
On Thu, 14 Apr 2005, Tom Lane wrote: > 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 Yeah, but there's a potentially large middle ground where neither our current plan nor check the entire table is particularly good for that we might be able to handle better. It'd be nice to also fall back to check the entire table for even larger changes.
В списке pgsql-performance по дате отправления: