[MASSMAIL]Is it safe to cache data by GiST consistent function

Поиск
Список
Период
Сортировка
От Michał Kłeczek
Тема [MASSMAIL]Is it safe to cache data by GiST consistent function
Дата
Msg-id 3F12E994-B9E7-4308-9E18-5F01E28F55AC@kleczek.org
обсуждение исходный текст
Ответы Re: Is it safe to cache data by GiST consistent function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello,

When implementing a GiST consistent function I found the need to cache pre-processed query across invocations.
I am not sure if it is safe to do (or I need to perform some steps to make sure cached info is not leaked between
rescans).

The comment in gistrescan says:

        /*
         * If this isn't the first time through, preserve the fn_extra
         * pointers, so that if the consistentFns are using them to cache
         * data, that data is not leaked across a rescan.
         */

which seems to me self-contradictory as fn_extra is preserved between rescans (so leaks are indeed possible).

Am I missing something?

Thanks,
Michal


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Confusing #if nesting in hmac_openssl.c
Следующее
От: Bertrand Drouvot
Дата:
Сообщение: Re: Introduce XID age and inactive timeout based replication slot invalidation