RE: ResourceOwner refactoring

Поиск
Список
Период
Сортировка
От kuroda.hayato@fujitsu.com
Тема RE: ResourceOwner refactoring
Дата
Msg-id OSBPR01MB3157BD946853F6FC1FD213B0F5A80@OSBPR01MB3157.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на RE: ResourceOwner refactoring  ("kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>)
Ответы Re: ResourceOwner refactoring
Список pgsql-hackers
Hi,

I put some comments.

Throughout, some components don’t have helper functions.
(e.g. catcache has ResOwnerReleaseCatCache, but tupdesc doesn't.)
I think it should be unified.

[catcache.c]
> +/* support for catcache refcount management */
> +static inline void
> +ResourceOwnerEnlargeCatCacheRefs(ResourceOwner owner)
> +{
> +       ResourceOwnerEnlarge(owner);
> +}

This function is not needed.

[syscache.c]
> -static CatCache *SysCache[SysCacheSize];
> + CatCache *SysCache[SysCacheSize];

Is it right? Compilation is done even if this variable is static...

[fd.c, dsm.c]
In these files helper functions are implemented as the define directive.
Could you explain the reason? For the performance?

> Previously, this was OK, because resources AAA and BBB were kept in 
> separate arrays. But after this patch, it's not guaranteed that the 
> ResourceOwnerRememberBBB() will find an empty slot.
>
> I don't think we do that currently, but to be sure, I'm planning to grep 
> ResourceOwnerRemember and look at each call carefullly. And perhaps we 
> can add an assertion for this, although I'm not sure where.

Indeed, but I think this line works well, isn't it?

>     Assert(owner->narr < RESOWNER_ARRAY_SIZE);

Best regards,
Hayato Kuroda
FUJITSU LIMITED


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

Предыдущее
От: Павел Еремин
Дата:
Сообщение: profiling
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit