Re: Fastest way to duplicate a quite large database - Mailing list pgsql-general

From John McKown
Subject Re: Fastest way to duplicate a quite large database
Date
Msg-id CAAJSdjiC-44Q89-u4yj++z=oxdmA5zUDPXaDX6YHFwOj5DaSwA@mail.gmail.com
Whole thread Raw
In response to Fastest way to duplicate a quite large database  (Edson Richter <edsonrichter@hotmail.com>)
Responses Re: Fastest way to duplicate a quite large database
List pgsql-general
On Tue, Apr 12, 2016 at 9:25 AM, Edson Richter <edsonrichter@hotmail.com> wrote:
Hi!

I have a database "Customer" with about 60Gb of data.
I know I can backup and restore, but this seems too slow.

Is there any other option to duplicate this database as "CustomerTest" as fast as possible (even fastar than backup/restore) - better if in one operation (something like "copy database A to B")?
I would like to run this everyday, overnight, with minimal impact to prepare a test environment based on production data.

​Hum, I don't know exactly how to do it, but on Linux, you could put the "Customer" database in a tablespace which resides on a BTRFS filesystem. BTRFS can do a quick "snapshot" of the filesystem and you can then set things for "incremental backup", as talked about here: https://btrfs.wiki.kernel.org/index.php/Incremental_Backup . From some reading, btrfs is a performance dog compared to others.
interesting take using various filesystems for PostgreSQL: http://www.slideshare.net/fuzzycz/postgresql-on-ext4-xfs-btrfs-and-zfs
<quote from above>
...
So we managed to take fork a 15 GB database in 6 seconds with only a small hiccup in performance. We are ready to start up the forked database.
...
<quote/>

I got a number of hits searching on "postgresql btrfs" using Google search.


Thanks,

--
Atenciosamente,

Edson Carlos Ericksson Richter


--
How many surrealists does it take to screw in a lightbulb? One to hold the griffon and one to fill the bathtub with brightly colored LEDs.

Maranatha! <><
John McKown

pgsql-general by date:

Previous
From: Edson Richter
Date:
Subject: Re: Fastest way to duplicate a quite large database
Next
From: Adrian Klaver
Date:
Subject: Re: Freezing localtimestamp and other time function on some value