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 1hG82j-0005qt-UK for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Apr 2019 20:17:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hG82i-0000K2-Ay for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Apr 2019 20:17:28 +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 1hG82h-0000Jv-Un for pgsql-hackers@lists.postgresql.org; Mon, 15 Apr 2019 20:17:28 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hG82e-0006V4-V3 for pgsql-hackers@postgresql.org; Mon, 15 Apr 2019 20:17:27 +0000 Received: by mail-wr1-x444.google.com with SMTP id w1so23643156wrp.2 for ; Mon, 15 Apr 2019 13:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-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=AU8oxtyvMThi7bwdDvFrnBj4VpOX1JAfw7Lji8cmKKY=; b=suZl7yyjc8GNRESpepKvEG0BS0FwkcjlIPTy2UD7lMofHwKSuAkFzzVy9AY9k+BVoQ AAqYcPsnWcdYHqH9RJZazL/LMBp7tb2ZEg/3VtJHfkaCzFkXPEgsxSxnWfgJOy8Hkigu LhjgRKNELA/tjIfdM4iDr81Hj5uipSQ+7LvljF4vRqYJ52SQR5oWJ4dLQrGfNA7PapXN 1QG/MtuBya2bDUVqYW9bCpwqExNwI2UDJZUMTqUbLNnqQchWUzfVHhPtuHD5usqB2zli bxoiaQVgpePBUas1bUWcNsQgem6oOxrSMHbRNkLRR4WFSCmHb6QoJyr8DYi81Acnetir /KQg== 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=AU8oxtyvMThi7bwdDvFrnBj4VpOX1JAfw7Lji8cmKKY=; b=XBILKiEr8R0TS5IEbhKZrzE0dpLDFLSydzmz1iglCRs/Gwydi++nxACf5UtAAvXcMb 3GO7FkJc0fGwyj5uECvOsoP1G5gibLzC9x16WkITbTpcrD/KZT+vL/iciNhbYirGAehU z/mwGd/hZjsGW9HX6a3E7VxKyupEAFkBouEivVnYsY75+mNrPw+ORm/tERKf+MZdnhgl uJjDY2NTmu8+pk3lXnDIZ8/65r1R2mqvAkoqfF8GNg1wbqXnJuu2n05IgkZOu7uh2s7i 9SXxAre+ZEXehoukvvJLm92vI+GADSzI2UZMBPsis5WHJgR1Dq6nJXGfvuGpNiRByjV/ u6Ig== X-Gm-Message-State: APjAAAViU/f9Pk9n1pAuIxt4ptpwOz+S2w4wu6qZ4o9sh79u5+nSpaiS lLQOaCp2Y50dkOR8muR859XlEQ== X-Google-Smtp-Source: APXvYqyMS51qpCyGVRUcbjusoY0dR1uvUoyemR5c0kI1tN9eIlrQ3dz/S6FvzmFwXmrBCieDhL4Bxg== X-Received: by 2002:adf:ea43:: with SMTP id j3mr25107553wrn.210.1555359443975; Mon, 15 Apr 2019 13:17:23 -0700 (PDT) Received: from localhost (ip-86-49-243-43.net.upcbroadband.cz. [86.49.243.43]) by smtp.gmail.com with ESMTPSA id t76sm32731856wmt.8.2019.04.15.13.17.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2019 13:17:11 -0700 (PDT) Date: Mon, 15 Apr 2019 22:17:09 +0200 From: Tomas Vondra To: Ashwin Agrawal Cc: Heikki Linnakangas , Tom Lane , Mark Kirkwood , PostgreSQL mailing lists Subject: Re: Zedstore - compressed in-core columnar storage Message-ID: <20190415201709.iuekkfen4df54pbg@development> References: <6A2B85A8-1ABD-4F85-981E-C94172D662FD@pivotal.io> <11257.1554994460@sss.pgh.pa.us> <20190414163947.owdw4gyjui36rakf@development> <20190415173254.nlnk2xqhgt7c5pta@development> <20190415181754.6dfp5lr6obpzutub@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-1444-295967 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Apr 15, 2019 at 11:57:49AM -0700, Ashwin Agrawal wrote: > On Mon, Apr 15, 2019 at 11:18 AM Tomas Vondra > wrote: > > Maybe. I'm not going to pretend I fully understand the internals. Does > that mean the container contains ZSUncompressedBtreeItem as elements? Or > just the plain Datum values? > > First, your reading of code and all the comments/questions so far have > been highly encouraging. Thanks a lot for the same. ;-) > Container contains ZSUncompressedBtreeItem as elements. As for Item will > have to store meta-data like size, undo and such info. We don't wish to > restrict compressing only items from same insertion sessions only. Hence, > yes doens't just store Datum values. Wish to consider it more tuple level > operations and have meta-data for it and able to work with tuple level > granularity than block level. OK, thanks for the clarification, that somewhat explains my confusion. So if I understand it correctly, ZSCompressedBtreeItem is essentially a sequence of ZSUncompressedBtreeItem(s) stored one after another, along with some additional top-level metadata. > Definitely many more tricks can be and need to be applied to optimize > storage format, like for fixed width columns no need to store the size in > every item. Keep it simple is theme have been trying to maintain. > Compression ideally should compress duplicate data pretty easily and > efficiently as well, but we will try to optimize as much we can without > the same. I think there's plenty of room for improvement. The main problem I see is that it mixes different types of data, which is bad for compression and vectorized execution. I think we'll end up with a very different representation of the container, essentially decomposing the items into arrays of values of the same type - array of TIDs, array of undo pointers, buffer of serialized values, etc. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services