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 1hE7oQ-0002he-Lt for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Apr 2019 07:38:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hE7oM-0008CK-VO for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Apr 2019 07:38:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hE7oM-000881-Fj for pgsql-hackers@lists.postgresql.org; Wed, 10 Apr 2019 07:38:22 +0000 Received: from cyclops.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hE7oH-0002wP-5L for pgsql-hackers@postgresql.org; Wed, 10 Apr 2019 07:38:19 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 4560021C3EED; Wed, 10 Apr 2019 10:38:14 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.200] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 155B221C3EEB; Wed, 10 Apr 2019 10:38:14 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1554881894; bh=yUF7HX6PHLCbBjEi+CnEY/iTX9Dmp/WJf17N4n59c50=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=qmrquU7nIaJfiX3HYj/xxojtaxi2zev9Cqx/UYKBF1svEUQBGd6WfB4ueVNgFbLFC OrqBiHv6f2fX0I3rAbkoFXAFg7sK2NkyBFZcZcJI6OOmR+mWh8yWafx1NVSkoeroRQ eg7Lmq1Irt/OHxGljMMPGrTfRFS6R7IeSqMisdtE= Subject: Re: Zedstore - compressed in-core columnar storage To: Heikki Linnakangas , Amit Kapila , Ashwin Agrawal Cc: PostgreSQL mailing lists References: <7ab5be5f-6404-b52b-e6bf-c1c891ceabb1@iki.fi> From: Konstantin Knizhnik Message-ID: Date: Wed, 10 Apr 2019 10:38:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <7ab5be5f-6404-b52b-e6bf-c1c891ceabb1@iki.fi> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10.04.2019 10:25, Heikki Linnakangas wrote: > On 10/04/2019 09:29, Amit Kapila wrote: >> On Tue, Apr 9, 2019 at 5:57 AM Ashwin Agrawal >> wrote: >>> Row store >>> --------- >>> >>> The tuples are stored one after another, sorted by TID. For each >>> tuple, we store its 48-bit TID, a undo record pointer, and the actual >>> tuple data uncompressed. >>> >> >> Storing undo record pointer with each tuple can take quite a lot of >> space in cases where you can't compress them. > > Yeah. This does depend on compression to eliminate the unused fields > quite heavily at the moment. But you could have a flag in the header > to indicate "no undo pointer needed", and just leave it out, when it's > needed. > >> Have you thought how will you implement the multi-locker scheme in >> this design?  In zheap, we have used undo for the same and it is easy >> to imagine when you have separate transaction slots for each >> transaction.  I am not sure how will you implement the same here. > I've been thinking that the undo record would store all the XIDs > involved. So if there are multiple lockers, the UNDO record would > store a list of XIDs. Alternatively, I suppose you could store > multiple UNDO pointers for the same tuple. > > - Heikki > > I also a little bit confused about UNDO records and MVCC support in Zedstore. Actually columnar store is mostly needed for analytic for read-only or append-only data. One of the disadvantages of Postgres is quite larger per-record space overhead caused by MVCC. It may be critical if you want to store huge timeseries  with relatively small number of columns (like measurements of some sensor). It will be nice to have storage format which reduce this overhead when it is not needed (data is not updated). Right now, even without UNFO pages, size of zedstore is larger than size of original Postgres table. It seems to be very strange. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company