Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gceVv-0003Wl-8X for pgsql-general@arkaria.postgresql.org; Thu, 27 Dec 2018 22:52:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gceVt-00011t-9L for pgsql-general@arkaria.postgresql.org; Thu, 27 Dec 2018 22:52:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gceVr-00011k-8a for pgsql-general@lists.postgresql.org; Thu, 27 Dec 2018 22:52:25 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gceVk-00010g-CF for pgsql-general@lists.postgresql.org; Thu, 27 Dec 2018 22:52:22 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 4471222121 for ; Thu, 27 Dec 2018 17:52:15 -0500 (EST) Received: from web4 ([10.202.2.214]) by compute2.internal (MEProxy); Thu, 27 Dec 2018 17:52:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= message-id:from:to:mime-version:content-transfer-encoding :content-type:subject:date:references:in-reply-to; s=fm1; bh=SIw KZ/GOFWszCX1WYKn+tETzPi2hy18omzSspMTCCMM=; b=bSS8KUeWjGyrfQ9U7dH o+9IMicgZ7cGX8tiFdzoo/BekJsKmV18D0yzo/N1vCez/u1aJG2GE+TABFWBHHgU yQJqdNMOv5r8DjvD1G6ZM5grVZEP1L9WGgiRj7QeuhtSfo1BETBiUwtgAOebNvaV fzCwTzBAvRUoOgXXyKdRkHRjMNBvX7xTrVlkObF4GAn12PbOmxCwv64HhAL0Ejdh U8L3U4sIIUa8vsS4ZyOwkGc25+zPv+kx8z7p5XobAnEjlAsHxQL0uB4zB2j2oerd pll1bGxV0Zrv3GgCJIre7XXOp0bgABp8bRnMbcsl4+ull5r5FghQ29ImS08Sgh41 Isw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=SIwKZ/GOFWszCX1WYKn+tETzPi2hy18omzSspMTCC MM=; b=eBFxj6zWUDF1b8OXfIBJd0coYCOhlv59ojF37kr0KT3yqr8ApWkJKliBU rZgdnjDc50ZWp/KQMEFTbLXf5hloSBI902EEX8W1+ufR3Rkq52gcAkd6X24CGJ0I kMDwJejvDU8+31iTKI6ImaZvqlav1JoevXRdp8a8U4J4fjugjRiyfQLw3umpdfgj z5M+ywkDfsC/6rr53y8GjR+PSHjQTr+4ixxRXxgAC+IKfR8V13mf5oERGP3aGUTU ybh2N6RqCHHVCxyuzq1xc/qpJLW/aW4MgDLJXO0FIW2M1KGW+n4RUhCq/Y+qD78z Mlp1OcBw8atLZZp1uPLpBZlzFVUUg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrtdeggddtgeculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefkhffvggfgtgfouffffhgjsegrje erreertdejnecuhfhrohhmpeftrghvihcumfhrihhshhhnrgcuoehsrhhkrhhishhhnhgr sehfrghsthhmrghilhdrtghomheqnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrhhkrh hishhhnhgrsehfrghsthhmrghilhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 99) id E1CA2BA782; Thu, 27 Dec 2018 17:52:14 -0500 (EST) Message-Id: <1545951134.1308620.1619555704.45725FCC@webmail.messagingengine.com> From: Ravi Krishna To: pgsql-general@lists.postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: multipart/alternative; boundary="_----------=_154595113413086200" X-Mailer: MessagingEngine.com Webmail Interface - ajax-2f590f9a Subject: Re: Question about unlogged to logged conversion Date: Thu, 27 Dec 2018 17:52:14 -0500 References: In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --_----------=_154595113413086200 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Thu, Dec 27, 2018, at 5:23 PM, Bhavin Gandhi wrote: > Hello, > I'm trying to understand for a given unlogged table of a specific size > and # of rows, if I do "alter table" on it to convert it to logged > table, is there a performance difference between 9.5, 9.6 and 10? in > other words are there specific improvements in this area that may not > be available in all Postgres versions?>=20 Unlogged tables are not stored in the catalog like a regular table. When it is converted to a logged table , the entire operation is logged (goes into wal logs) in one single transaction, blocking the entire table during the process. IMO this makes unlogged -> logged workflow not a right fit for large tables.=C2=A0 In other products I have used, large tabl= es are set to unlogged mode before bulk load and then set back to normal logged mode. --_----------=_154595113413086200 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset="utf-8"

On Thu, Dec 27, 2018, at 5:23 PM, Bhavin Gandhi wrote:
Hello,
I'm trying to understand for a given unlogged table of a specific size and # of rows, if I do "alter table" on it to convert it to logged table, is there a performance difference between 9.5, 9.6 and 10? in other words are there specific improvements in this area that may not be available in all Postgres versions?


Unlogged tables are not stored in the catalog like a regular table. When it is converted to a logged table , the entire operation is logged (goes into wal logs) in one single transaction, blocking the entire table during the process. IMO this makes unlogged -> logged workflow not a right fit for large tables.  In other products I have used, large tables are set to unlogged mode before bulk load and then set back to normal logged mode.
--_----------=_154595113413086200--