Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGoFW-0008A1-Td for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Nov 2017 15:44:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGoFW-00068F-Ex for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Nov 2017 15:44:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eGoFW-000685-2G for pgsql-hackers@lists.postgresql.org; Mon, 20 Nov 2017 15:44:42 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eGoFS-0005l2-FA for pgsql-hackers@postgresql.org; Mon, 20 Nov 2017 15:44:40 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 76D7221C172E; Mon, 20 Nov 2017 18:44:36 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from wp.localdomain (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 37C1F21C0909; Mon, 20 Nov 2017 18:44:36 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1511192676; bh=PcYwAvh8vfabyG2eIDbET4Cel7C2R9vLx++5efLzr7I=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=itM7DbBaZJySZTGdV3aCU15pPb30zal+EV+zc+Z38pYxpmEcF+0f3RX8r1vH8HM76 3pVZBMeQiVHLOiJqdUychP3hHMTsxo/7fnFMghLLgjwNdvLw2cOoh86zZdgAn3dGnv poHHN/iAAqSHO3no0rT7Oi8sEeqsk2GIeL1GOmHc= Date: Mon, 20 Nov 2017 18:44:35 +0300 From: Ildus Kurbangaliev To: Tomas Vondra Cc: =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0KjQuNGI0LrQuNC9?= , Andres Freund , Robert Haas , Oleg Bartunov , Craig Ringer , Peter Eisentraut , PostgreSQL Hackers Subject: Re: [HACKERS] Custom compression methods Message-ID: <20171120184435.13698aee@wp.localdomain> In-Reply-To: References: <20170907194236.4cefce96@wp.localdomain> <20170912175505.4afa11fd@wp.localdomain> <5c84382f-1065-e9e8-dde8-4c1f5ae1007b@2ndquadrant.com> <20171102124101.5a28ecab@wp.localdomain> <20171115120928.31bee414@wp.localdomain> <20171120124428.6154f23f@wp.localdomain> <58471b21-2f8c-9fa9-63ca-4c37883b8307@2ndquadrant.com> <321450D5-FFDE-46A6-B10B-26B5E0D3BF49@gmail.com> Organization: Postgres Professional X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 20 Nov 2017 16:29:11 +0100 Tomas Vondra wrote: > On 11/20/2017 04:21 PM, =D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9 =D0=A8= =D0=B8=D1=88=D0=BA=D0=B8=D0=BD wrote: > >=20 > > =20 > >> On Nov 20, 2017, at 18:18, Tomas Vondra > >> >> > wrote: > >> > >> > >> I don't think we need to do anything smart here - it should behave > >> just like dropping a data type, for example. That is, error out if > >> there are columns using the compression method (without CASCADE), > >> and drop all the columns (with CASCADE). =20 > >=20 > > What about instead of dropping column we leave data uncompressed? > > =20 >=20 > That requires you to go through the data and rewrite the whole table. > And I'm not aware of a DROP command doing that, instead they just drop > the dependent objects (e.g. DROP TYPE, ...). So per PLOS the DROP > COMPRESSION METHOD command should do that too. >=20 > But I'm wondering if ALTER COLUMN ... SET NOT COMPRESSED should do > that (currently it only disables compression for new data). If the table is big, decompression could take an eternity. That's why i decided to only to disable it and the data could be decompressed using compression options. My idea was to keep compression options forever, since there will not be much of them in one database. Still that requires that extension is not removed. I will try to find a way how to recompress data first in case it moves to another table. --=20 --- Ildus Kurbangaliev Postgres Professional: http://www.postgrespro.com Russian Postgres Company