5 ms·
This is slightly OT, but I always wondered: what is the overhead of fetching cached stuff from the file system vs. having a built-in cache? Is there a way to ci
by MrBuddyCasino 13y ago
This is slightly OT, but I always wondered: what is the overhead of fetching cached stuff from the file system vs. having a built-in cache? Is there a way to circumvent going through the kernel and avoid a context switch?
In other words: could a database have only minimal built-in caching and instead rely on the OS cache?
- Negitivefrags 13y agoPostgres does rely on the OS cache. The "effective_cache_size" parameter is there for you to tell postgres how big you are expecting your OS cache to be and it is supposedly used when planning queries, presumably so it can rely on a plan having cached reads.
- jdubs 13y agoThe database has a better understanding of the workload and therefore can make more intelligent caching decisions. The file system caching system does a good job however, it's not as effective in predicting what should be cached.