Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIP2b-0002x2-4G for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Nov 2017 01:13:57 +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 1eIP2Y-00059m-Ud for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Nov 2017 01:13:54 +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 1eIP2Y-00059c-BG for pgsql-hackers@lists.postgresql.org; Sat, 25 Nov 2017 01:13:54 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eIP2Q-0006mX-PO for pgsql-hackers@postgresql.org; Sat, 25 Nov 2017 01:13:52 +0000 Received: by mail-wm0-x230.google.com with SMTP id u83so25109773wmb.5 for ; Fri, 24 Nov 2017 17:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Ymp479prVMHIhNie8T5lBo6HxdfgQj3avZrNKjPq+ik=; b=urY47HSncqMOApa+xEb1s/drJrdMwSRBubw/Q6uTw7IV73BVrKImtaO/rKIHKuhhYz bUdOVOeyOY8la+KKrQYYhsWBz4sNVCTHp9FXkRHbkLF1A6lVhfajtyUgS8jbbfyCXkoP Ys7jWqla8KKt4jIu4HT3LvKclW2uB7WEYCH9GN/J4C98SxH06s0T9IoYAk0X+cYkFYYb z+OWFx9CynIe+12pNPKJdcHx1y6hUIM1kDSoGnAaPykeRcj1Wvx3dlCJmBTgGLtx/BYL fV9i28iL2xwjrUi/4ascCfafDI/yV1Nl+EfV9C2+jICkWrQRg906MkPG6/F/0B1AH4bV MWlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ymp479prVMHIhNie8T5lBo6HxdfgQj3avZrNKjPq+ik=; b=WdEHp+Eo4yIKigsI++DbYazp3h1ZWrqFHpFkT9SlbZibVxqXBqFA0HrlhNZUS2EkIH DJQON2JNmFu9m5xRsJHdpr67EbXIsuXlSWPAmHb2w3JISMNpw9p/SVFuUr4qp50xObHd PpxIVpblRteEhu5MnwViMpOLBGQPcv/SGx7c49gAKArHcZ44/o+/ArBQtaNpzcqRIDzk WS5qcNJUmcvbECBWDBIsQa55a+K2NcZcN9Nwz6c3RTG0zaLB+M4ks9USxViaagdPiFVn fZ2C7RhUPFoNOgzVw/XoXgU7HOVNMWMH/FvfZZbXNBS9fa8mWNprfCcnAZ0tJ9Z0xbnv 3klA== X-Gm-Message-State: AJaThX4S6/o8RENmIDe8nE1hKxfQTVUEVAwHuYRnzXc6EE4LoSJE+sxz MpYR7zfZ9ySd6xycMo9uPcu55g== X-Google-Smtp-Source: AGs4zMZZBBm6urHBXv85VC7QU+PIalR77qy4p0Jag3+CQEW6hqjn155PtcCuERtDkRCnVVpOMv4OmA== X-Received: by 10.28.144.67 with SMTP id s64mr12234329wmd.83.1511572424856; Fri, 24 Nov 2017 17:13:44 -0800 (PST) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id b45sm8775486wrb.1.2017.11.24.17.13.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 17:13:44 -0800 (PST) Subject: Re: [HACKERS] Custom compression methods To: Ildus Kurbangaliev Cc: pgsql-hackers@postgresql.org, Ildar Musin References: <20170907194236.4cefce96@wp.localdomain> <20170912175505.4afa11fd@wp.localdomain> <20171102152836.60c041e4@wp.localdomain> <20171114162356.52e3d388@wp.localdomain> <62e46a47-08a8-6e06-5e4f-6f52e0a13202@2ndquadrant.com> <20171121174717.69ecd8f4@wp.localdomain> <20171123123849.5a686d7b@wp.localdomain> <57daf28d-ed76-c364-a9ca-65d0ff71a36f@2ndquadrant.com> <20171124123800.034c9208@wp.localdomain> From: Tomas Vondra Message-ID: Date: Sat, 25 Nov 2017 02:13:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171124123800.034c9208@wp.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 11/24/2017 10:38 AM, Ildus Kurbangaliev wrote: > ... > That means compressed datums now in the column with storage > specified as external. I'm not sure that's a bug or a feature. > Interesting. Never realized it behaves like this. Not sure if it's intentional or not (i.e. bug vs. feature). > Lets insert them usual way: > > delete from t2; > insert into t2 select repeat(md5(i::text),300) from > generate_series(1,100000) s(i); > \d+ > > List of relations > Schema | Name | Type | Owner | Size | Description > --------+------+-------+-------+---------+------------- > public | t1 | table | ildus | 18 MB | > public | t2 | table | ildus | 1011 MB | > > Maybe there should be more common solution like comparison of > attribute properties? > Maybe, not sure what the right solution is. I just know that if we allow inserting data into arbitrary tables without recompression, we may end up with data that can't be decompressed. I agree that the behavior with extended storage is somewhat similar, but the important distinction is that while that is surprising the data is still accessible. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services