Re: pg_dump versus ancient server versions

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: pg_dump versus ancient server versions
Date: 2021-10-25 23:12:56
Message-ID: 20211025231256.GA31568@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 25, 2021 at 11:38:51AM -0400, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > On 10/25/21 10:23, Tom Lane wrote:
> >> (Hmmm ... but disk space could
> >> become a problem, particularly on older machines with not so much
> >> disk. Do we really need to maintain a separate checkout for each
> >> branch? It seems like a fresh checkout from the repo would be
> >> little more expensive than the current copy-a-checkout process.)
>
> > If you set it up with these settings then the disk space used is minimal:
> >      git_use_workdirs => 1,
> >      rm_worktrees => 1,
>
> Maybe we should make those the defaults? AFAICS the current
> default setup uses circa 200MB per back branch, even between runs.
> I'm not sure what that is buying us.

Maybe git's shared/"alternates" would be helpful to minimize the size of
.git/objects?

I'm not sure - it looks like the BF client does its own stuff with symlinks.
Is that for compatibility with old git ?
https://github.com/PGBuildFarm/client-code/blob/main/PGBuild/SCM.pm

If you "clone" a local location, it uses hard links by default.
If you use --shared or --reference, then it uses references to the configured
"alternates", if any.

In both cases, .git/objects requires no additional space (but the "checked out"
copy still takes up however much space).

$ mkdir tmp
$ git clone --quiet ./postgresql tmp/pg
$ du -sh tmp/pg
492M tmp/pg

$ rm -fr tmp/pg
$ git clone --quiet --shared ./postgresql tmp/pg
$ du -sh tmp/pg
124M tmp/pg

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2021-10-25 23:28:13 Re: Allow pg_signal_backend members to use pg_log_backend_memory_stats().
Previous Message Tom Lane 2021-10-25 22:52:18 Re: pg_dump versus ancient server versions