pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: James(王旭) <wangxu@gu360.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to gracefully keep my specific index in memory ?
Date: Tue, 13 Aug 2019 11:42:37 +0800
Message-ID: <tencent_17D6E29A5E11CF007746933E@qq.com> (raw)
In-Reply-To: <27c1fc51f3372828740c45a97d2a76bbaf1f667c.camel@cybertec.at>
References: <tencent_5F1047874E05A0A3690A1BC9@qq.com>
	<27c1fc51f3372828740c45a97d2a76bbaf1f667c.camel@cybertec.at>

Thanks Laurenz Albe for reply.


Unfortunately this index is only frequently used during a certain period of time(such as 9:30am - 12:00am) .I usually encounter slow load of this index during some other time.
Then it seems to me the only answer for this case would be the pgprewarm and pg_cron ?
 
 
------------------ Original ------------------
From:  "Laurenz Albe"<laurenz.albe@cybertec.at>;
Date:  Mon, Aug 12, 2019 08:24 PM
To:  "James(王旭)"<wangxu@gu360.com>; "pgsql-general"<pgsql-general@postgresql.org>; 

Subject:  Re: How to gracefully keep my specific index in memory ?

 

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

view thread (3+ messages)

Message-ID: <tencent_17D6E29A5E11CF007746933E@qq.com>
Permalink:  ../tencent_17D6E29A5E11CF007746933E@qq.com/
Also on:    postgresql.org/message-id/tencent_17D6E29A5E11CF007746933E@qq.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: wangxu@gu360.com, laurenz.albe@cybertec.at
  Subject: Re: How to gracefully keep my specific index in memory ?
  In-Reply-To: <tencent_17D6E29A5E11CF007746933E@qq.com>
  References: <tencent_5F1047874E05A0A3690A1BC9@qq.com> <27c1fc51f3372828740c45a97d2a76bbaf1f667c.camel@cybertec.at> <tencent_17D6E29A5E11CF007746933E@qq.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox