Re: pg_dump vs pg_basebackup

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: pg_dump vs pg_basebackup
Date: 2014-03-25 12:05:15
Message-ID: CAGTBQpaNgz3UDmGupPwV4vTeJV9oYxtcu2eNBBP00siPNo10fQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Mar 25, 2014 at 4:39 AM, David Johnston <polobo(at)yahoo(dot)com> wrote:
>> Hai,
>>
>> Can anyone tell me the difference and performance between pgdump and
>> pg_basebackup if I want to backup a large database.
>>
>> Thanks
>
> Yes. And many of their words have been written down in the documentation in
> a chapter named "Backup and Restore". Do you have a specific question about
> what is written there?
>
> I'll add that comparing the performance of both is relatively meaningless.
> You need to understand how each works then choose the correct tool for your
> situation.

I don't know if meaningless is the right word here. I have a ~450G
database, and the difference is quite meaningful to me, as it is
measured in days.

The difference being, pg_basebackup is dumber and using it is harder,
but its performance is only limited by sequential I/O capacity (which
is usually quite high). It is also used in conjunction with PITR to
get not only that, but also incremental backups, which is something
you really want for big databass. pg_dump, on the other hand, will
only do full dumps and it will be limited both by I/O and CPU power,
because the reformatting involved in making a dump is considerable. In
my experience, a base backup takes hours, while a dump takes days.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Matthew Spilich 2014-03-25 12:46:43 Stalls on PGSemaphoreLock
Previous Message David Johnston 2014-03-25 07:39:19 Re: pg_dump vs pg_basebackup