"pg_prewarm makes most sense if your database and your RAM are really really large (XXX GB or more)"
A benchmark preferably with databases of sizes that make sense.
"pg_prewarm makes most sense if your database and your RAM are really really large (XXX GB or more)"
A benchmark preferably with databases of sizes that make sense.
Is there another case justifying a pre-fetching?
If I'm right pg_prewarm if not adequate with a SSD storage device, moreover "makes most sense if your database and your RAM are really really large" is sound as the amount of head moves is (typically) proportional to the DB size.
IMHO the most significant overall performance indicator here is the ratio R/D, where R is the size of the RAM available to PostgreSQL (mainly shared_buffers and the kernel buffercache), and D stands for the size of often used database objects (data, indices...).
Multiple runs of a benchmark in contexts where this ratio is 1, then 0.5, then 0.01... often produces interesting results.
That's extremely common for index based accesses. Which in turn are a large fraction of queries in most use cases.
> If I'm right pg_prewarm if not adequate with a SSD storage device,
For SSDs random accesses and small accesses are still substantially slower than bulk reading data into memory.
It can also be helpful when you have network attached storage (eg. EBS volume in AWS) since even if it is SSD you still have the network latency for each IO.
Filling terabytes of memory from non-local storage (even if it is SSD) can take some time and benefits from parallel sequential readaheads instead of doing many small, random reads.