Can we ask postgres to use caching for specific tables and don't use it for few tables at all?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With