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 1hx9My-0007Ta-LP for pgsql-general@arkaria.postgresql.org; Mon, 12 Aug 2019 12:24:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hx9Mx-00025I-4p for pgsql-general@arkaria.postgresql.org; Mon, 12 Aug 2019 12:24:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hx9Mw-00025B-Me for pgsql-general@lists.postgresql.org; Mon, 12 Aug 2019 12:24:10 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hx9Mp-0000mY-Ip for pgsql-general@postgresql.org; Mon, 12 Aug 2019 12:24:09 +0000 Received: by mail-wr1-x42a.google.com with SMTP id g17so104372619wrr.5 for ; Mon, 12 Aug 2019 05:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=2VzMsCFXonHXuskbtID1eSkAEsFLvwpBxnFECWX1A0Y=; b=bpKq9u7+KE4IQeJ60GP0sjvZLfpkabf2z88pRLfAPlLNxbUJyoIX2dOGJwR7EjDyo8 uHmYoadi2Mg5uGypXofwRUGFHh7XJqFrqDWlZW2Xwwc6/TzLoTu9NRN5JZVL8Y8defSm Jmx8difG+QERQIF9KFkWsKMTeefQFzP9Dv7QpS9+uQL2mx3TePBqpXCbyVP4FMttKDVO YYy6wqZ3MSn7PT5U7VzeqQ0vuASHDhTn+MqKdqNzNyNDh1wV5pkygbxanVL4ppFNhxgi qgxk1kEpO2PxUhiGlJBbQocea5MofRPJfA4KpGiGWtBcBloCCNkyTNizJpnfaVROuNu2 zhnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=2VzMsCFXonHXuskbtID1eSkAEsFLvwpBxnFECWX1A0Y=; b=cBvcReY5HQqHOr3m0vm/l4S5I+c/MuLe+MaoGZB222f1PjNa1Riwlcdzc07r/HmLcf xpQ0CU63AqDLSf8b+Xn7VAAxGLUXUu249Gx66ig21j0POjfdKzdlYCeAFiZC6rmKzGyy 3wuTaa0W6wbdsoQ00OwwbUzkfON3f2UVrOobRbowJYQ/YTN9vV9JY/Meb8K47Q1jtO+X yiHZV5MuEMpJyZ5i08l/VjWuesHWVmscgKUqLL+5OpB9zy8i2F+cKf8UIon92zurNWkE gt6G/cb7/BSztglZwOM+IncePhyuuGPWJjQ8N/J+HgciuJkb5wqwSbBjHk3rVhYSZgFK PquA== X-Gm-Message-State: APjAAAWpH89tElWAPx0u9NiUqntJJ9JCku49u5Yl4y1ctuYZmfe2Yy0X +WVUWdvcxJpcfZ8tntK0WOerDYrXqa4= X-Google-Smtp-Source: APXvYqyYs2K/NaaE6qnP6eEWwSmv721OJumlCSa+3UKIGQ3Kne9L9PRMTnj9hLYWwObFProPvw53uw== X-Received: by 2002:adf:ff8e:: with SMTP id j14mr6147531wrr.141.1565612641407; Mon, 12 Aug 2019 05:24:01 -0700 (PDT) Received: from localhost.localdomain ([212.186.219.234]) by smtp.gmail.com with ESMTPSA id h97sm30452054wrh.74.2019.08.12.05.24.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 05:24:01 -0700 (PDT) Message-ID: <27c1fc51f3372828740c45a97d2a76bbaf1f667c.camel@cybertec.at> Subject: Re: How to gracefully keep my specific index in memory ? From: Laurenz Albe To: =?UTF-8?Q?James=28=E7=8E=8B=E6=97=AD=29?= , pgsql-general Date: Mon, 12 Aug 2019 14:24:00 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk James(王旭) wrote: > As the title,How to keep a specific index in memory gracefully? > > After some statistical query, I can determine that not all indexes can be fit into memory, > but one of the most frequently used indexes(say idx_xyz) can be definitely fit into > memory(specifically ,[the size of idx_xyz]=20% x [memory size]). > > I know there's pgprewarm, but I feel with pgprewarm I can't keep things under control, e.g. no realtime monitor, being squeezed out of memory ,.etc. > > Is it possible that I can simply do something like "select idx_xyz into xxx" and keep the specific index in memory forever? If the indexes are frequently used, they should remain cached anyway. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com