Re:Pgtestdb's template cloning approach to testing is fast
by brandur on Sunday August 02, 2026 @12:25AM
(#49141084)
Thanks for that — I didn't know about `clone` (and important to note it's non-default) and now intend to try it out.
Re:Pgtestdb's template cloning approach to testing is fast
by spellboots on Sunday August 02, 2026 @08:37AM
(#49143978)
I'm actually curious if this is faster than a tmpfs clone, I suspect it might be as depending on how many underlying files it's copying, it might effectively be doing "nothing" for each file.
Obviously operations after that will be a lot slower reading / writing to a normal disk
Re:Pgtestdb's template cloning approach to testing is fast
by CodesInChaos on Sunday August 02, 2026 @06:59AM
(#49143251)
I assume it's only fast for large databases when running on a filesystem that supports copy-on-write? In particular, I assume it won't benefit from CoW on a tmpfs?
Re:Pgtestdb's template cloning approach to testing is fast
by spellboots on Sunday August 02, 2026 @08:35AM
(#49143958)
I do know that if it's not supported by the underlying filesystem if falls back to the default.
What I don't know is if it's faster to copy than a regular copy on a ram tmpfs - since it may be essentially be doing "nothing" - updating some pointers instead of copying stuff in ram.
So if your workload is limited by copy not execution speed it might be worth testing.
However at that point you're running on a regular FS so if you're trying to benefit test speed by having all your regular postgres operations on a ramdisk, that part will end up being slower.
Only supported on linux and macos AFAIK
https://www.postgresql.org/docs/18/runtime-config-resource.h...