Re: dblink() cursor error/issue (TopMemoryContext)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: dblink() cursor error/issue (TopMemoryContext)
Дата
Msg-id 20080614223454.GE8519@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: dblink() cursor error/issue (TopMemoryContext)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: dblink() cursor error/issue (TopMemoryContext)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:

> (I wonder whether we can't improve on that, at least for the case of a
> non-deferred after trigger, which'd have already been fired before we
> exit the subtransaction.  The trick is how to know that there's nothing
> useful left in the subtransaction's per-transaction memory context ...)

I think this would require us to be smarter about what pfree's are
leaving the context empty.  Whether this requires us to troll the
freelist and aggregate contiguous elements, or something even more
complex, I don't know.  The fact that this adds a bit more complexity to
pfree() worries me.

Perhaps we could have something like MemoryContextDefrag that we would
invoke at subtransaction end.  If the context is truly empty it can
leave it in the initial empty state, which I think is enough for the
subxact code to know that it can remove it.

Unless I'm misunderstanding the issue completely.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: why sequential scan is used on indexed column ???
Следующее
От: Tom Lane
Дата:
Сообщение: Re: dblink() cursor error/issue (TopMemoryContext)