-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Using IntegreSQL with Postgres>=v15 uses WAL_LOG block-by-block copies by default instead of the previous file-based copy strategy (FILE_COPY).
Version 15 of PostgreSQL introduced new parameter CREATE DATABASE ... STRATEGY = [strategy] and at the same time changed the default behaviour how the new databases are created from templates. The new default become WAL_LOG which copies block-by-block via the Write-Ahead Log (WAL), making I/O sequential (and much smoother) and support for concurrency without facing latency spike. This prevented the need to CHECKPOINT but made the database cloning operation potentially significantly slower. For an empty template1, you won't notice the difference. But if you try to clone a 500GB database using WAL_LOG, you are going to be waiting a long time.
The STRATEGY parameter allows us to switch back to the original method FILE_COPY to keep the behaviour, and speed. And since PostgreSQL 18, this opens the whole new set of options.
via Instant database clones with PostgreSQL 18 by Radim Marek
For Postgres>=v15 use: CREATE DATABASE %s WITH OWNER %s TEMPLATE %s STRATEGY=FILE_COPY;
Change in /pkg/manager/manager.go.