On 20 September 2018 at 15:19, Wei Shan <weishan.ang@xxxxxxxxx> wrote: > I believe you can use pg_prewarm to pin index or table to cache. > > https://www.postgresql.org/docs/current/static/pgprewarm.html I think the key sentence in the document you linked to is: "Prewarmed data also enjoys no special protection from cache evictions, so it is possible that other system activity may evict the newly prewarmed blocks shortly after they are read" So this is not pinning. It's merely loading buffers into shared buffers in the hope that they might be around long enough for you to make the most of that effort. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services