Re: Avoid useless retrieval of defaults and check constraints in pg_dump -a

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Avoid useless retrieval of defaults and check constraints in pg_dump -a
Date: 2020-09-10 12:31:32
Message-ID: 65BBC477-AAEF-4356-B7D5-C41624EE5330@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 12 Jul 2020, at 07:48, Julien Rouhaud <rjuju123(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2020-09-10 12:43:11 Re: Yet another fast GiST build
Previous Message Kasahara Tatsuhito 2020-09-10 12:11:21 Re: Get memory contexts of an arbitrary backend process