Re: [bug fix] Memory leak in dblink

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [bug fix] Memory leak in dblink
Дата
Msg-id 31604.1403191108@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [bug fix] Memory leak in dblink  ("MauMau" <maumau307@gmail.com>)
Ответы Re: [bug fix] Memory leak in dblink
Список pgsql-hackers
"MauMau" <maumau307@gmail.com> writes:
> From: "Joe Conway" <mail@joeconway.com>
>> Any objections to me back-patching it this way?

> I thought the same at first before creating the patch, but I reconsidered. 
> If the query executed by dblink() doesn't return any row, the context 
> creation and deletion is a waste of processing.  I think the original author 
> wanted to eliminate this waste by creating the context when dblink() should 
> return a row.  I'd like to respect his thought.

I don't think speed is really worth worrying about.  The remote query will
take orders of magnitude more time than the possibly-useless context
creation.

The code is really designed to put all the setup for storeRow into one
place; but I concur with Joe that having teardown in a different place
from setup isn't very nice.

An alternative that might be worth thinking about is putting both the
context creation and deletion at the outermost level where the storeInfo
struct is defined.  That seems possibly a shade less surprising than
having it at the intermediate level.
        regards, tom lane



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Atomics hardware support table & supported architectures
Следующее
От: Joe Conway
Дата:
Сообщение: Re: [bug fix] Memory leak in dblink