But how, exactly, do databases use mmap?
The right answer is that they shouldn't. A database has much more information than the operating system about what, how and when to cache information. Therefore the database should handle its own I/O caching using O_DIRECT on Linux or the equivalent on Windows or other Unixes.<p>The article at <a href="https://www.scylladb.com/2017/10/05/io-access-methods-scylla/" rel="nofollow">https://www.scylladb.com/2017/10/05/io-access-methods-scylla...</a> is a bit old (2017) but it explains the trade-offs