Skip to content

Comment on Prewarming PostgreSQL I/O cachesparent

Comments

Pre-fetching may be interesting if the first SQL query using prefetched data picks a small set of data stored on a disk plate here, then another one stored far away (distant cylinder), then back, then again far away, and so on... On a mechanical HDD the implied head movements may considerably slow this first query down.

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.