Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we ask postgres to use caching for specific tables?

Can we ask postgres to use caching for specific tables and don't use it for few tables at all?

like image 663
Sujit Avatar asked Feb 15 '11 16:02

Sujit


People also ask

Does Postgres do caching?

Postgres manages a “Shared Buffer Cache”, which it allocates and uses internally to keep data and indexes in memory. This is usually configured to be about 25% of total system memory for a server running a dedicated Postgres instance, such as all Heroku Postgres instances.

Does PostgreSQL cache views?

No. A view is basically a macro - your view definition gets merged with the query against it and then executed. Indeed, caching the execution plan would make little sense.

What is cached table?

You use cache tables to store data that you access frequently but that does not change often. A cache table can improve query performance by storing the data locally instead of accessing the data directly from the data source.


1 Answers

No, you cannot control what is going to be cached.

But if that is a frequently accessed table, it will be cached anyway. If it's not accessed frequently it will not be cached.

So I don't see a reason for trying to control this.

like image 189
a_horse_with_no_name Avatar answered Nov 15 '22 08:11

a_horse_with_no_name