Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eLFip-0003kU-Vt for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Dec 2017 21:53:20 +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 1eLFio-00074t-Vc for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Dec 2017 21:53:18 +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 1eLFio-00074g-Lm for pgsql-hackers@lists.postgresql.org; Sat, 02 Dec 2017 21:53:18 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eLFil-0005Dk-MA for pgsql-hackers@postgresql.org; Sat, 02 Dec 2017 21:53:17 +0000 Received: by mail-wr0-x243.google.com with SMTP id z34so13465976wrz.10 for ; Sat, 02 Dec 2017 13:53:15 -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=i12m9PVZn4qXe3jPzym6xGkrcdLkH29ipG1FHmxqWXw=; b=XGZTyzKm1XKaHFNn8TNoCZlJEo/s+3g5cG5aJlbdt+oRyiKMG9GLZZkWWrfG7QGq3q 3Fv7oIgewX+Tt/3kAAIFJNbFlvqXiLLdJ5UrA1vRSi9era1R14XL+L1jIPDw0yVevKp2 G42MMldG9dnEIuelyIdct5IvbtCrOFLDVAIK+37IBu6nHsPkBhPXDCXot4hDmpVYki/I 091Z25XKl1ffUk+EAjuq6CLgYoZExvK4Rv94gm9ZcjJIReeBUuZ90KQCmgNYRPEJERx2 Pd9N9ssL7j+aGleUKHcD0Pp0Pn1IRMZm0hXIB96hJ5nQ7l9DVG15yrwfnycgUYIz3UOO ryKQ== 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=i12m9PVZn4qXe3jPzym6xGkrcdLkH29ipG1FHmxqWXw=; b=i9RkiAcPs64oLFWzepMy6YU8c1TZk0NHOco3JQxWy9qidTxVHzOswjIpMqyOcWjPZM oLPcUT8Vr1g7NIrwJgYhx1DxMsw5PPK8237vroinZy6pcHDZeOJ1m4HJwSP2/eHyD8fo 8E5vkVDSeRwRxR7QexE7yPC3Pg3nUIDavC02gO4TWCeDjZVXrPRhTIvXBPQg3j2cXckb Rk7qKVvCJFQnr3KtIgPnDFiAPU4tEluYiRldnTCJ4wFe9Cxisio2iLUUFEHU1KdjQkMY 5pwvCmjWy0Hf4uyY/g6OLnECJpJvk4qlVT6O9pZGCjo+epVLjEzLgM7fleHTGf5Hcv+C 2pQg== X-Gm-Message-State: AJaThX78JIi17oVnbj4IfbSr8qezCUIo3HY9rqPgpBP4pn8A4xoclVVy Qd1XAhCyTr9+msk5ImK3lWIGxA== X-Google-Smtp-Source: AGs4zMZhj5D7W9GP2di2DUdUcQ5Nl+Hj9vG5FDO7Kp7o4g7lrhHMyOGejv+zkKrz1jho14kY+nKdvw== X-Received: by 10.223.157.137 with SMTP id p9mr9117439wre.92.1512251593856; Sat, 02 Dec 2017 13:53:13 -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 p6sm8578887wrd.78.2017.12.02.13.53.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Dec 2017 13:53:12 -0800 (PST) Subject: Re: [HACKERS] Custom compression methods To: Andres Freund Cc: Robert Haas , Ildus Kurbangaliev , "pgsql-hackers@postgresql.org" , Ildar Musin References: <9a0745ab-5b62-d81f-3a6d-ec0929a4a99d@2ndquadrant.com> <20171130182009.1b492eb2@wp.localdomain> <9dc0d3ba-5fa2-a7b0-5789-fff3c60cef1c@2ndquadrant.com> <20171201215217.7ic4izdvj5cishgx@alap3.anarazel.de> <5cb1995e-a202-2739-bf46-1b6950e5bdb6@2ndquadrant.com> <20171202203839.lvbsfyu73igrdmsu@alap3.anarazel.de> From: Tomas Vondra Message-ID: Date: Sat, 2 Dec 2017 22:53:10 +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: <20171202203839.lvbsfyu73igrdmsu@alap3.anarazel.de> 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 On 12/02/2017 09:38 PM, Andres Freund wrote: > Hi, > > On 2017-12-02 16:04:52 +0100, Tomas Vondra wrote: >> Firstly, it's going to be quite hard (or perhaps impossible) to find an >> algorithm that is "universally better" than pglz. Some algorithms do >> work better for text documents, some for binary blobs, etc. I don't >> think there's a win-win option. > > lz4 is pretty much there. > That's a matter of opinion, I guess. It's a solid compression algorithm, that's for sure ... >> Secondly, all the previous attempts ran into some legal issues, i.e. >> licensing and/or patents. Maybe the situation changed since then (no >> idea, haven't looked into that), but in the past the "pluggable" >> approach was proposed as a way to address this. > > Those were pretty bogus. IANAL so I don't dare to judge on bogusness of such claims. I assume if we made it optional (e.g. configure/initdb option, it'd be much less of an issue). Of course, that has disadvantages too (because when you compile/init with one algorithm, and then find something else would work better for your data, you have to start from scratch). > > I think we're not doing our users a favor if they've to download > some external projects, then fiddle with things, just to not choose > a compression algorithm that's been known bad for at least 5+ years. > If we've a decent algorithm in-core *and* then allow extensibility, > that's one thing, but keeping the bad and tell forks "please take > our users with this code we give you" is ... > I don't understand what exactly is your issue with external projects, TBH. I think extensibility is one of the great strengths of Postgres. It's not all rainbows and unicorns, of course, and it has costs too. FWIW I don't think pglz is a "known bad" algorithm. Perhaps there are cases where other algorithms (e.g. lz4) are running circles around it, particularly when it comes to decompression speed, but I wouldn't say it's "known bad". Not sure which forks you're talking about ... regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services