pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Size of PostgreSQL backup ./. Sybase DUMP
Date: Sat, 17 Apr 2021 15:29:19 +0200
Message-ID: <409c895e-af72-00fb-9397-64066c7a7062@gmx.net> (raw)
In-Reply-To: <YHqHU06R2V9ZzOhs@c720-r368166.fritz.box>
References: <YHmVYdr2uuMIz38Q@c720-r368166.fritz.box>
	<616119102ade0feacd7f0a1ec376859a26ffe83d.camel@cybertec.at>
	<YHqHU06R2V9ZzOhs@c720-r368166.fritz.box>

Matthias Apitz schrieb am 17.04.2021 um 08:59:
> As I said, the Sybase DUMP command dumps a single database, i.e. works
> more like pg_dump of PostgreSQL. Ofc, they're like apples and oranges,
> but the netto data of the tables must be written to disk, and as I said
> above in both cases compressed with gzip.
>
> Even more, the pg_basebackup does not only write the netto data of the
> database,  but also system tables and configuration information of the
> PG server. That made me asking, why it's less than the half in size as
> the gzip'ed DUMP of Sybase.
>
> One reason I could imagine is, that Sybase's DUMP writes all the pages,
> even the unused pages into the output file. But this is a guess, because
> I never investigated the internals of Sybase's DUMP command.

Actually pg_basebackup writes the data of **all** databases, not just one.

I wonder if the difference is because Sybase uses a single container file
for each database. And that container file might be bigger than the actual
content due to deleting data, or dropping tables. Postgres uses one file
per table (multiple files if the table size exceeds 1GB). So if you drop
a table in Postgres the space is immediately freed.

I know that in SQL Server there is a way to shrink the database files
(=containers). If that is possible in Sybase as well, you could try
and compare the size then.







view thread (5+ messages)

Message-ID: <409c895e-af72-00fb-9397-64066c7a7062@gmx.net>
Permalink:  ../409c895e-af72-00fb-9397-64066c7a7062@gmx.net/
Also on:    postgresql.org/message-id/409c895e-af72-00fb-9397-64066c7a7062@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: shammat@gmx.net
  Subject: Re: Size of PostgreSQL backup ./. Sybase DUMP
  In-Reply-To: <409c895e-af72-00fb-9397-64066c7a7062@gmx.net>
  References: <YHmVYdr2uuMIz38Q@c720-r368166.fritz.box> <616119102ade0feacd7f0a1ec376859a26ffe83d.camel@cybertec.at> <YHqHU06R2V9ZzOhs@c720-r368166.fritz.box> <409c895e-af72-00fb-9397-64066c7a7062@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox