Re: Avoid useless retrieval of defaults and check constraints in pg_dump -a - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Avoid useless retrieval of defaults and check constraints in pg_dump -a
Date
Msg-id 65BBC477-AAEF-4356-B7D5-C41624EE5330@yesql.se
Whole thread Raw
In response to Avoid useless retrieval of defaults and check constraints in pg_dump -a  (Julien Rouhaud <rjuju123@gmail.com>)
Responses Re: Avoid useless retrieval of defaults and check constraints in pg_dump -a
List pgsql-hackers
> On 12 Jul 2020, at 07:48, Julien Rouhaud <rjuju123@gmail.com> wrote:

> Currently, getTableAttrs() always retrieves info about columns defaults and
> check constraints, while this will never be used if --data-only option if used.
> This seems like a waste of resources, so here's a patch to skip those parts
> when the DDL won't be generated.

Given how unintrusive this optimization is, +1 from me to go ahead with this
patch.  pg_dump tests pass.  Personally I would've updated the nearby comments
to reflect why the check for dataOnly is there, but MMV there.  I'm moving this
patch to Ready for Committer.

I'm fairly sure there is a lot more we can do to improve the performance of
data-only dumps, but this nicely chips away at the problem.

cheers ./daniel


pgsql-hackers by date:

Previous
From: Kasahara Tatsuhito
Date:
Subject: Re: Get memory contexts of an arbitrary backend process
Next
From: Heikki Linnakangas
Date:
Subject: Re: Yet another fast GiST build