From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Jeff Janes <jeff(dot)janes(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Pg_upgrade speed for many tables |
Date: | 2012-11-05 21:10:17 |
Message-ID: | 20121105211017.GD19099@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Nov 5, 2012 at 01:07:45PM -0800, Jeff Janes wrote:
> On Mon, Nov 5, 2012 at 12:49 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > On Mon, Nov 5, 2012 at 03:30:32PM -0500, Tom Lane wrote:
> >> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> >> > On Mon, Nov 5, 2012 at 9:14 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> >> BTW, does pg_upgrade run pg_restore in --single-transaction mode?
> >> >> That would probably make synchronous_commit moot, at least for that
> >> >> step.
> >>
> >> > It doesn't use pg_restore at all - it uses the dump from pg_dumpall, which
> >> > you can't reload with pg_restore.
> >>
> >> Sorry, I should've said psql --single-transaction. Although that isn't
> >> going to work either given the presence of \connect commands in the
> >> script. I wonder whether pg_dumpall ought to have some sort of "one
> >> transaction per database please" option.
> >
> > pg_dumpall is already doing lots of gymnastics with SQL, and pg_upgrade
> > splits the output file into db/user creation and object creation, so I
> > am hesitant to add anything more in there.
> >
> > I was surprised by the scale of the performance improvement, but a
> > simple table creation test confirmed that improvement, irregardless of
> > pg_upgrade. Perhaps we should suggest synchronous_commit=off for
> > pg_dumpall restores, particularly when using --schema-only.
>
> Or have options for pg_dump and pg_restore to insert "set
> synchronous_commit=off" into the SQL stream?
You can already do that with PGOPTIONS:
PGOPTIONS="-c synchronous_commit=off" pg_restore ...
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2012-11-05 21:14:47 | Re: Pg_upgrade speed for many tables |
Previous Message | Jeff Janes | 2012-11-05 21:07:45 | Re: Pg_upgrade speed for many tables |