In-memory disk for PostgreSQL temporary files
Recently, while debugging a performance issue of a CREATE INDEX
operation, I was reminded that PostgreSQL might produce temporary files when executing a parallel query, including parallel index creation, because each worker process has its own memory and might need to use disk space for sorting or hash tables.
Thanks to Peter Geoghegan answering this pgsql-admin email thread.
So, in order to try to speed up that index creation, I thought it would be beneficial to move those temporary files directly into memory using a tmpfs and wanted to test that theory, writing this blog post :-)