pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to gracefully keep my specific index in memory ?
3+ messages / 2 participants
[nested] [flat]
* How to gracefully keep my specific index in memory ?
@ 2019-08-12 09:51 James(王旭) <wangxu@gu360.com>
2019-08-12 12:24 ` Re: How to gracefully keep my specific index in memory ? Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 1 reply; 3+ messages in thread
From: James(王旭) @ 2019-08-12 09:51 UTC (permalink / raw)
To: pgsql-general
Hello:
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?
Best regards,
James
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How to gracefully keep my specific index in memory ?
2019-08-12 09:51 How to gracefully keep my specific index in memory ? James(王旭) <wangxu@gu360.com>
@ 2019-08-12 12:24 ` Laurenz Albe <laurenz.albe@cybertec.at>
2019-08-13 03:42 ` Re: How to gracefully keep my specific index in memory ? James(王旭) <wangxu@gu360.com>
0 siblings, 1 reply; 3+ messages in thread
From: Laurenz Albe @ 2019-08-12 12:24 UTC (permalink / raw)
To: James(王旭) <wangxu@gu360.com>; pgsql-general
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How to gracefully keep my specific index in memory ?
2019-08-12 09:51 How to gracefully keep my specific index in memory ? James(王旭) <wangxu@gu360.com>
2019-08-12 12:24 ` Re: How to gracefully keep my specific index in memory ? Laurenz Albe <laurenz.albe@cybertec.at>
@ 2019-08-13 03:42 ` James(王旭) <wangxu@gu360.com>
0 siblings, 0 replies; 3+ messages in thread
From: James(王旭) @ 2019-08-13 03:42 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-08-13 03:42 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12 09:51 How to gracefully keep my specific index in memory ? James(王旭) <wangxu@gu360.com>
2019-08-12 12:24 ` Laurenz Albe <laurenz.albe@cybertec.at>
2019-08-13 03:42 ` James(王旭) <wangxu@gu360.com>
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