Re: Protect syscache from bloating with negative cache entries

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, <robertmhaas(at)gmail(dot)com>, <craig(at)2ndquadrant(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Protect syscache from bloating with negative cache entries
Date: 2017-01-22 22:41:18
Message-ID: 276bcca0-9bfd-e60f-243d-baf081b41946@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/21/17 8:54 PM, Tom Lane wrote:
> Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)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.
--
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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2017-01-22 22:51:53 Re: Protect syscache from bloating with negative cache entries
Previous Message Jim Nasby 2017-01-22 21:59:34 Re: Too many autovacuum workers spawned during forced auto-vacuum