Re: Protect syscache from bloating with negative cache entries

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)com, tomas(dot)vondra(at)2ndquadrant(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, andres(at)anarazel(dot)de, tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com, alvherre(at)2ndquadrant(dot)com, bruce(at)momjian(dot)us, pgsql-hackers(at)lists(dot)postgresql(dot)org, michael(dot)paquier(at)gmail(dot)com, david(at)pgmasters(dot)net, craig(at)2ndquadrant(dot)com, robertmhaas(at)gmail(dot)com
Subject: Re: Protect syscache from bloating with negative cache entries
Date: 2021-01-26 09:43:21
Message-ID: 460e97aa-bd09-5124-4f4d-27780b98bcf1@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 19/11/2020 07:25, Kyotaro Horiguchi wrote:
> Performance measurement on the attached showed better result about
> searching but maybe worse for cache entry creation. Each time number
> is the mean of 10 runs.
>
> # Cacache (negative) entry creation
> : time(ms) (% to master)
> master : 3965.61 (100.0)
> patched-off: 4040.93 (101.9)
> patched-on : 4032.22 (101.7)
>
> # Searching negative cache entries
> master : 8173.46 (100.0)
> patched-off: 7983.43 ( 97.7)
> patched-on : 8049.88 ( 98.5)
>
> # Creation, searching and expiration
> master : 6393.23 (100.0)
> patched-off: 6527.94 (102.1)
> patched-on : 15880.01 (248.4)
>
>
> That is, catcache searching gets faster by 2-3% but creation gets
> slower by about 2%. If I moved the condition of 2 further up to
> CatalogCacheCreateEntry(), that degradation reduced to 0.6%.
>
> # Cacache (negative) entry creation
> master : 3967.45 (100.0)
> patched-off : 3990.43 (100.6)
> patched-on : 4108.96 (103.6)
>
> # Searching negative cache entries
> master : 8106.53 (100.0)
> patched-off : 8036.61 ( 99.1)
> patched-on : 8058.18 ( 99.4)
>
> # Creation, searching and expiration
> master : 6395.00 (100.0)
> patched-off : 6416.57 (100.3)
> patched-on : 15830.91 (247.6)

Can you share the exact script or steps to reproduce these numbers? I
presume these are from the catcachebench extension, but I can't figure
out which scenario above corresponds to which catcachebench test. Also,
catcachebench seems to depend on a bunch of tables being created in
schema called "test"; what tables did you use for the above numbers?

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Takashi Menjo 2021-01-26 09:50:50 Re: [PoC] Non-volatile WAL buffer
Previous Message Daniel Gustafsson 2021-01-26 09:38:43 Re: Add SQL function for SHA1