Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puzpY-0004bI-9N for pgsql-general@arkaria.postgresql.org; Fri, 05 May 2023 18:06:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1puzpW-0005z8-K3 for pgsql-general@arkaria.postgresql.org; Fri, 05 May 2023 18:06:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puzpV-0005yz-3h for pgsql-general@lists.postgresql.org; Fri, 05 May 2023 18:06:54 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1puzpP-000mA0-J6 for pgsql-general@postgresql.org; Fri, 05 May 2023 18:06:52 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 3CF1B320098C; Fri, 5 May 2023 14:06:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 05 May 2023 14:06:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1683310003; x=1683396403; bh=4sKXd1q6nlm4H1zND3FKTo902BiXrm2GC1K vgXmRIWE=; b=JDzwxwNYZW3s5Nw0kElUBAC2v0C6Qqbvsx7ZcwvYMFyZi5p+3Jk ayQrP2qjfkd/7YzTjrD026KWBxPqfRxCPzzGYw0njtvfvyJsmBkd3UQTgd+ZzPcW vh/Sdcdv5oZi+QWR+2exSHS14ywaq6yf26wPCvqklcUQn15N9An1w0gjamkuUDQa MNglY8DT/+7kzUNwuXhXQGffGoTqDmDtIGJ/H9GuUI1Q6ScfaZejXju97gElVANF H53ersvcs0OvW/ilpZWoHcMxVYykWYhgRq3x7O+Fpke0kLC2qGTat+XrfPTd6+CF +zQI9XJ4+kmEE4Q3waacEq0xPeiY/9bV4+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1683310003; x=1683396403; bh=4sKXd1q6nlm4H1zND3FKTo902BiXrm2GC1K vgXmRIWE=; b=NcxE4bZsTiL7w7xk2bdvdP2e8+uYPoCQAg2cmxjBVpsFV/C6cMs tk4PYh11RhqDv0lEBzn4K2ua8+3gdUiYmUPs+xkul55Cfsd9yaZbknh3bnccfNNh sUIy7srZH3e2xpJ74Wz3tAJmPRqmzrFIpxw05qQ3nD8Y0NCgn0GcaWbyjhf9DZz+ QjxNygEqfqayoBSg1ANjjaTpNgqJG141XRaBSPQ44WEFostB/LFvZN91xf0YimLu DIjqEicH5QzQo4r/1gJT/PAiXSST79jc0VTuRL576TPfjUoT4DTW+TH366yf8it/ aWciMwV/SA2x1NOefeOfTbFakSc06DCps+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefvddguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhevhffkffgfgggjtgfgse htkeertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghn rdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepveehve evudettdetfeeuudffuedtjeefhffgfefgueduvefhhefhfeegvdekgedtnecuffhomhgr ihhnpehpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghr rdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 May 2023 14:06:42 -0400 (EDT) Subject: Re: Database size will be Huge difference while Restoring To: Rajmohan Masa References: <58266925-de1e-69b5-1d72-73605ed3838a@aklaver.com> Cc: pgsql-general From: Adrian Klaver Message-ID: <4e424783-9bb5-442f-5b8a-de26f35b72db@aklaver.com> Date: Fri, 5 May 2023 11:06:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 5/5/23 10:55 AM, Rajmohan Masa wrote: Please reply to list also. Ccing list. > Hi Adrian, > Are both the above the same for the original and restored database? > No, > * > * > *Backup Server Details:* > Postgres version : *PostgreSQL 14.5* > OS and version : *Windows server 2019 Datacenter* > > *Restore Server Details:* > Postgres version : *PostgreSQL 13.2* > OS and version : *Windows server 2012 R2 Datacenter* From here: https://www.postgresql.org/docs/current/app-pgdump.html "Also, it is not guaranteed that pg_dump's output can be loaded into a server of an older major version — not even if the dump was taken from a server of that version. Loading a dump file into an older server may require manual editing of the dump file to remove syntax not understood by the older server." > * > * > *_Provide the commands you used to arrive at sizes below:_ The command/process you used to determine sizes? > * > We are using a Windows server so By Using the PgAdmin4 tool, I'm taking > Backup and restore. Using what settings? > > *How was object count arrived at?* > > object count would be the same. How was the object count determined? > > *Have you looked at the Postgres log to see if there might be relevant > information?* > Yeah,I checked with Log also but from there I didn't get anything. > The dump/restore should have left some trace, have you looked through the log carefully for anything saying data was not added. In particular the a COPY failed. Where there any errors/warnings during the restore? > > Thanks& Regards, > Rajamohan M. > > > On Fri, May 5, 2023 at 9:52 PM Adrian Klaver > wrote: > > On 5/5/23 08:35, Rajmohan Masa wrote: > > Hi Team, > > I took Postgres database Backup through Directory format with > > compression.These are the details > > Postgres version? > > OS and version? > > Are both the above the same for the original and restored database? > > Provide the commands you used to arrive at sizes below. > > > Database Size: *3985 GB* > > Backup file Size will be*212 GB.* > > * > > * > > > Command used to restore the database? > > Again command used to determine size of below. > > > After that I Restored this backup file (212GB), but I'm getting > Database > > size will be 456 GB. > > > > So immediately I checked with *Table Bloats,latest statistics and > last > > vacuum status*. After that I applied "*Vacuum Full Verbose > analyze*" and > > " *Reindex*  " on that Database. Here I achieved Database size > will be > > R*educed from 3985 GB to 2582GB.* > > * > > * > > After this process,again**I took  Backup through Directory format > with > > compression.These are the details > > Database Size: *2582 GB* > > Backup file Size will be* 212 GB.* > > > > After that I Restored this backup file (212 GB), but I'm getting > > Database size will be 456 GB. > > > > How was object count arrived at? > > > Here I checked with Object Counts, I'm getting the same count in > Both Db's. > > *_ > > _* > > *_why am I unable to get Original Database size/Approximately nearby > > original DB size in restore location ?_* > > Have you looked at the Postgres log to see if there might be relevant > information? > > Where there any errors/warnings during the restore? > > > *_ > > _* > > *_ > > _* > > *_ > > _* > > Thanks & Regards, > > Rajamohan M. > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com