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 1hzQxr-00053B-3y for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Aug 2019 19:35:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hzQxq-0000rZ-0R for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Aug 2019 19:35:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzQxp-0000rS-Jy for pgsql-hackers@lists.postgresql.org; Sun, 18 Aug 2019 19:35:41 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzQxn-0005Ze-6x for pgsql-hackers@postgresql.org; Sun, 18 Aug 2019 19:35:41 +0000 Received: by mail-io1-xd42.google.com with SMTP id x4so16264169iog.13 for ; Sun, 18 Aug 2019 12:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UEZa6GG06UuRwDuBcERkIh/5fIKL3S/YLkTRxD4rIEE=; b=jM2ecVO82iwRIymdw4PvqZrymUOaSlmTtT9e3jubgEQgeP+3daB3igSwCWD2goQSGE a/xC7zmh7qy9UNJpw9Tn20bmNkgU04VyvgR00dbl0+D+Y7Vj8Y2REzD6QMASouOMo9W3 5bMd+kAlqqmLLm0ZOyyqhuNCG4yUxwaTlHQvJjSrkyP6Tn7+rjIvzLEMkSwOG32iKrFY a0fvXu0l1L5O/9Vw4dJ9AzdPnd8gx3Q7wObmLNRtrYuQamzvALKbRZci9Np5J8VI4+US 9eKaHs2Xpdh+waTQIMqq5MLRw40iOh7mba9zaJfmwcropkdv5EASnWI0bPu/GePQtfFs gYjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UEZa6GG06UuRwDuBcERkIh/5fIKL3S/YLkTRxD4rIEE=; b=LtUQmog0tHhTwFMeaLtuGU+g9lklInRKlzHN0HyySlfv1fRy8ouEUUqj/wXp6NVWQT z1gctUIyjzLv7J1l7sSt2zApJEv/Y1wXFxMPx7RKujq6pCd8OuZ/HZeCuxSZ9gZqKcF1 /TOrPhdd6wPDr9HvWjJtXPkwcV8MCcgZCw1jL0/tT7vFEWtCLot9Z93QsS0FkbMxODah FbPPuM95yD9NQKyvnsEF8aQYX27RFBh/0eOpui4x/PthHd/ZvJnysTyvD7nlcAjO24EM UyDulwIT7/0PSWDDsNcaUw25rLDOngVQMTt6gdyQBImi/e3kPe8ujAX8Ntahc5c4qmG8 nrgg== X-Gm-Message-State: APjAAAWuKoi55cmbJ197MqjNIh+UIeWAOEfK5K/VT7Jrq+djKuIFJZ2o kDFhN5y3zwc0Gul8EiCqYoL4qwGLvFc= X-Google-Smtp-Source: APXvYqzaPZNbthDAcB+Sp2U9N08y2sta0oK2iPltRjiw2XaNy7KQd7BQA8j3ttCAqSK90/CzDcKf0g== X-Received: by 2002:a05:6638:691:: with SMTP id i17mr22926263jab.70.1566156936077; Sun, 18 Aug 2019 12:35:36 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id w23sm10161463ioa.51.2019.08.18.12.35.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Aug 2019 12:35:35 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id A5416800897; Sun, 18 Aug 2019 14:35:33 -0500 (CDT) Date: Sun, 18 Aug 2019 14:35:33 -0500 From: Justin Pryzby To: Heikki Linnakangas Cc: Ashwin Agrawal , Ashutosh Sharma , PostgreSQL mailing lists Subject: Re: Zedstore - compressed in-core columnar storage Message-ID: <20190818193533.GL11185@telsasoft.com> References: <22678.1555355981@sss.pgh.pa.us> <5ceff1bd.1c69fb81.704ee.a5b1SMTPIN_ADDED_BROKEN@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Aug 15, 2019 at 01:05:49PM +0300, Heikki Linnakangas wrote: > We've continued hacking on Zedstore, here's a new patch version against > current PostgreSQL master (commit f1bf619acdf). If you want to follow the > development in real-time, we're working on this branch: > https://github.com/greenplum-db/postgres/tree/zedstore Thanks for persuing this. It's an exciting development and I started looking at how we'd put it to use. I imagine we'd use it in favour of ZFS tablespaces, which I hope to retire. I've just done very brief experiment so far. Some thoughts: . I was missing a way to check for compression ratio; it looks like zedstore with lz4 gets ~4.6x for our largest customer's largest table. zfs using compress=gzip-1 gives 6x compression across all their partitioned tables, and I'm surprised it beats zedstore . . What do you think about pg_restore --no-tableam; similar to --no-tablespaces, it would allow restoring a table to a different AM: PGOPTIONS='-c default_table_access_method=zedstore' pg_restore --no-tableam ./pg_dump.dat -d postgres Otherwise, the dump says "SET default_table_access_method=heap", which overrides any value from PGOPTIONS and precludes restoring to new AM. . It occured to me that indices won't be compressed. That's no fault of zedstore, but it may mean that some sites would need to retain their ZFS tablespace, and suggests the possibility of an separate, future project (I wonder if there's some way a new meta-AM could "enable" compression of other index AMs, to avoid the need to implement zbtree, zhash, zgin, ...). . it'd be nice if there was an ALTER TABLE SET ACCESS METHOD, to allow migrating data. Otherwise I think the alternative is: begin; lock t; CREATE TABLE new_t LIKE (t INCLUDING ALL) USING (zedstore); INSERT INTO new_t SELECT * FROM t; for index; do CREATE INDEX...; done DROP t; RENAME new_t (and all its indices). attach/inherit, etc. commit; . Speaking of which, I think LIKE needs a new option for ACCESS METHOD, which is otherwise lost. Cheers, Justin