Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gr4Vw-0002Be-3E for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Feb 2019 17:28:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gr4Vu-00055o-Pb for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Feb 2019 17:28:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gr4Vu-00052f-9E for pgsql-hackers@lists.postgresql.org; Tue, 05 Feb 2019 17:28:02 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gr4Vq-0001hc-TC for pgsql-hackers@lists.postgresql.org; Tue, 05 Feb 2019 17:28:01 +0000 Received: by mail-wr1-x441.google.com with SMTP id r2so4514710wrv.10 for ; Tue, 05 Feb 2019 09:27:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=sKlAHHIX3st2mXXn6FDklgw0bIL5ZcXKlGdv9dR7VTA=; b=fkeRwz2gNJAldWBG0aUdKHRwdaK8iUX3V87YXzl4csrJQcN7wY/oNQCTHdoOKXBMhd Rv4Xa0YF4obQWqk6CXA55dfnfsAlE6wJLlZO0mN/BLZqhUEim0V3k2uZRZhAJ8plt/Mb FBM744sNb+WhRt56fPtO1V/XYMQsyVzAl6DzADIkp8lXN9RRrExa9B7N6vT4NouH91Hb fSds0mVDjzkgCJFi6OMUvnpiBpB7Tg/CIrC+hhbx2nRWLkzl4o1+9LwrRfwjFhl803y6 ebE9NDw+TmzOoUrs89u+puqDSjP0pTv8n8i3KCzB1pmI+eMR/XjK/23Qi9zZqfgBuJLL bCXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sKlAHHIX3st2mXXn6FDklgw0bIL5ZcXKlGdv9dR7VTA=; b=r1+2dpf7p6tkSa0yavzKrqcmZxl8h1qE/OvQ/sbN8XGrKYtKAzhWyYPtgi4BvqhF1a 6Xs8v/sS8Ka3VeUVXi9IqTD5QAdvQCX54XqXjcr0trlYZpQP0xvZTnR1uE9bpUhyoHuQ WW3Oq9qkh2Zk/6zYjPEzjys8XPbVhtdwUC8/zXBn8Q10NXtwG0MYzHf3SgsSFWTpO3k7 V9UbmquO6AHYy0hdi4WFS/DFYP6SxOsAPjDXd7y1q0gzJczp3c8VDMZ96y5lSb/u5Rbl UdKC2DNlY0ZYGZ/or+R+T6dh0R2wAZMVvxKskCqcTlugDJQLGxKdE6uJaA+BGTa43D0N UH2g== X-Gm-Message-State: AHQUAuY8GwYJ8NRnVTiFOofWyIx1gK7/hLzPMkIo+e/Ii4s4r/hvCtvx baAiGpuV7Bjwg9jh3LicMuwYtQ== X-Google-Smtp-Source: AHgI3IbFTrMr/2JsFG3k/1Cd6GOPi7DPEZpUhApn9eMPHQeid29TpEZ509lx2sosQNF+ByhRq8F+6A== X-Received: by 2002:adf:a14d:: with SMTP id r13mr4295510wrr.169.1549387677044; Tue, 05 Feb 2019 09:27:57 -0800 (PST) Received: from [10.137.2.21] (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id e9sm20215989wro.16.2019.02.05.09.27.55 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 09:27:55 -0800 (PST) Subject: Re: Protect syscache from bloating with negative cache entries To: "Ideriha, Takeshi" , "'bruce@momjian.us'" , "Tsunakawa, Takayuki" Cc: 'Kyotaro HORIGUCHI' , "GavinFlower@archidevsys.co.nz" , "robertmhaas@gmail.com" , "tgl@sss.pgh.pa.us" , "pgsql-hackers@lists.postgresql.org" , "alvherre@alvh.no-ip.org" , "andres@anarazel.de" , "michael.paquier@gmail.com" , "david@pgmasters.net" , "Jim.Nasby@bluetreble.com" , "craig@2ndquadrant.com" References: <0A3221C70F24FB45833433255569204D1FB70EFB@G01JPEXMBYT05> <20190128.124650.227901198.horiguchi.kyotaro@lab.ntt.co.jp> <4E72940DA2BF16479384A86D54D0988A6F4156D4@G01JPEXMBKW04> <20190130.173220.35762657.horiguchi.kyotaro@lab.ntt.co.jp> <0A3221C70F24FB45833433255569204D1FB93590@G01JPEXMBYT05> <20190204224318.GA32538@momjian.us> <4E72940DA2BF16479384A86D54D0988A6F41C019@G01JPEXMBKW04> From: Tomas Vondra Message-ID: Date: Tue, 5 Feb 2019 18:27:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <4E72940DA2BF16479384A86D54D0988A6F41C019@G01JPEXMBKW04> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, I find it a bit surprising there are almost no results demonstrating the impact of the proposed changes on some typical workloads. It touches code (syscache, ...) that is quite sensitive performance-wise, and adding even just a little bit of overhead may hurt significantly. Even on systems that don't have issues with cache bloat, etc. I think this is something we need - benchmarks measuring the overhead on a bunch of workloads (both typical and corner cases). Especially when there was a limit on cache size in the past, and it was removed because it was too expensive / hurting in some cases. I can't imagine committing any such changes without this information. This is particularly important as the patch was about one particular issue (bloat due to negative entries) initially, but then the scope grew quite a it. AFAICS the thread now talks about these workloads: * negative entries (due to search_path lookups etc.) * many tables accessed randomly * many tables with only a small subset accessed frequently * many tables with subsets accessed in subsets (due to pooling) * ... Unfortunately, some of those cases seems somewhat contradictory (i.e. what works for one hurts the other), so I doubt it's possible to improve all of them at once. But that makes the bencharking even more important. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services