Re: [HACKERS] Protect syscache from bloating with negative cacheentries

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: [HACKERS] Protect syscache from bloating with negative cacheentries
Дата
Msg-id 683113d7-c7a7-1a0f-da7c-b197b08a6440@BlueTreble.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Protect syscache from bloating with negative cacheentries  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: [HACKERS] Protect syscache from bloating with negative cache entries  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 1/22/17 4:41 PM, Jim Nasby wrote:
> On 1/21/17 8:54 PM, Tom Lane wrote:
>> Jim Nasby <Jim.Nasby@bluetreble.com> writes:
>>> The other (possibly naive) question I have is how useful negative
>>> entries really are? Will Postgres regularly incur negative lookups, or
>>> will these only happen due to user activity?
>> It varies depending on the particular syscache, but in at least some
>> of them, negative cache entries are critical for performance.
>> See for example RelnameGetRelid(), which basically does a RELNAMENSP
>> cache lookup for each schema down the search path until it finds a
>> match.
>
> Ahh, I hadn't considered that. So one idea would be to only track
> negative entries on caches where we know they're actually useful. That
> might make the performance hit of some of the other ideas more
> tolerable. Presumably you're much less likely to pollute the namespace
> cache than some of the others.

Ok, after reading the code I see I only partly understood what you were 
saying. In any case, it might still be useful to do some testing with 
CATCACHE_STATS defined to see if there's caches that don't accumulate a 
lot of negative entries.

Attached is a patch that tries to document some of this.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: [HACKERS] Protect syscache from bloating with negative cacheentries
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Assignment of valid collation for SET operations on queries with UNKNOWN types.