Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dOPHI-0004ZO-6G for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jun 2017 14:09:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dOPHH-0000W9-Lt for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jun 2017 14:09:39 +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 1dOPFd-0004O3-4R for pgsql-hackers@postgresql.org; Fri, 23 Jun 2017 14:07:57 +0000 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dOPFW-000227-5Z for pgsql-hackers@postgresql.org; Fri, 23 Jun 2017 14:07:55 +0000 Received: by mail-wr0-x229.google.com with SMTP id c11so67383653wrc.3 for ; Fri, 23 Jun 2017 07:07:49 -0700 (PDT) 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=/Guxvl+m3tglcvOHx+Q9/8LkF675mK/XHBjGEE7xcmE=; b=sq04CRnrf1RMJg/xG5NfZpqCxFifqoo3h4NHMAwfjFuXE2z9xJ8u/d5prARHEIDhCu NggXgZIH2q9PMnj601C+z1ccC4sIXLbN1RMI3kA2xAO7Gy4pafryncWnzSWgqBhwWHMK uhboUrIwGsh79vFQGY5uyWJTzP1pzjRzw7cqfhnfzpTJBnJrEg0ghXlGoXo5a86bUlFE qaPCGZZt7/QEou6/+vX8NuHbkTQV0Vq5yuCR4vDLsA21Y394gvLsbDL6N60hCJUU7YX3 rRqIgfbBwkYHIYIvKsxfszEA4gQlmF5hXZ/aQYLRdgRfF4qZ+K2CejgjLOuLEs0pjqXv 2Xrw== 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=/Guxvl+m3tglcvOHx+Q9/8LkF675mK/XHBjGEE7xcmE=; b=LJkoEGIiN7oRjSwv0r8yPgMbQfOsxBZbq4jq9PcxGq3x70Xsd/+MrTR7hx4QTOTUPa FY2MvgGU3wwXWMkBgr3OeJGTHar9ugRcgJ/0d6bmqufmrGbwPOF8LKq3WXNoiz+5a5Ls C59dVqXNF0r9ejHdWq1kugreBarxEyodc8VW/S9iGIJuP5OoKWFu6hgf4OVr6/ng3Xcg fjlBNjTM2MEm5ay3ZlzHWcnBlN5HFiVl6zXW93qyXK0CACXnJ8jR582V8SPwqk6E0rBe bEve2Pf37velFnG/y0Isx9qiSYWNOIJ8GDEEFIpiuAFciSmqoNXscVzPpgQO+S0Q/K5X PNuA== X-Gm-Message-State: AKS2vOx2fqOieHqf9EccdOEbWGBl4WVlSbs/vDbrBVmGzdzun5LPgJWN LnV9EbYb3jfGR/0iPDtrLSjyGHYsNvZN4Q9K4ieRx91+hyn2qlz+BuqwEPA8qJOEbvD5LQkSmkM V3w2v6vgiczYngp0SmnDzsqnLJ0frxOJZb9OE3HqEYW8wkavldMZkrbTvknAB68bC2awF0banwk s= X-Received: by 10.28.134.3 with SMTP id i3mr5676962wmd.1.1498226868068; Fri, 23 Jun 2017 07:07:48 -0700 (PDT) Received: from [10.137.2.17] (ip-89-177-46-65.net.upcbroadband.cz. [89.177.46.65]) by smtp.gmail.com with ESMTPSA id x8sm3943932wrd.29.2017.06.23.07.07.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2017 07:07:47 -0700 (PDT) Subject: Re: Pluggable storage To: Teodor Sigaev , Michael Paquier , Robert Haas Cc: Haribabu Kommi , Alvaro Herrera , Pg Hackers References: <20160824182201.GA232997@alvherre.pgsql> <20161013202642.ksiuyx72gu6wgupf@alvherre.pgsql> <8b2510f0-ab89-dbf1-5b1c-5d686a5e33b8@sigaev.ru> From: Tomas Vondra Message-ID: <9b5728fc-c266-5f71-9a69-7668ad231e05@2ndquadrant.com> Date: Fri, 23 Jun 2017 16:07:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Thunderbird/54.0a2 MIME-Version: 1.0 In-Reply-To: <8b2510f0-ab89-dbf1-5b1c-5d686a5e33b8@sigaev.ru> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi, On 6/23/17 10:38 AM, Teodor Sigaev wrote: >> 1. Table AM with a 6-byte TID. >> 2. Table AM with a custom locator format, which could be TID-like. >> 3. Table AM with no locators. > > Currently TID has its own type in system catalog. Seems, it's possible > that storage claims type of TID which it uses. Then, AM could claim it > too, so the core based on that information could solve the question > about AM-storage compatibility. Storage could also claim that it hasn't > TID type at all so it couldn't be used with any access method, use case: > compressed column oriented storage. > Isn't the fact that TID is an existing type defined in system catalogs is a fairly insignificant detail? I mean, we could just as easily define a new 64-bit locator data type, and use that instead, for example. The main issue here is that we assume things about the TID contents, i.e. that it contains page/offset etc. And Bitmap nodes rely on that, to some extent - e.g. when prefetching data. > > As I remeber, only GIN depends on TID format, other indexes use it as > opaque type. Except, at least, btree and GiST - they believe that > internal pointers are the same as outer (to heap) > I think you're probably right - GIN does compress the posting lists by exploiting the TID redundancy (that it's page/offset structure), and I don't think there are other index AMs doing that. But I'm not sure we can simply rely on that - it's possible people will try to improve other index types (e.g. by adding similar compression to other index types). Moreover we now support extensions defining custom index AMs, and we have no clue what people may do in those. So this would clearly require some sort of flag for each index AM. > > Another dubious part - BitmapScan. > It would be really great if you could explain why BitmapScans are dubious, instead of just labeling them as dubious. (I guess you mean Bitmap Heap Scans, right?) I see no conceptual issue with bitmap scans on arbitrary locator types, as long as there's sufficient locality information encoded in the value. What I mean by that is that for any two locator values A and B: (1) if (A < B) then (A is stored before B) (2) if (A is close to B) then (A is stored close to B) Without these features it's probably futile to try to do bitmap scans, because the bitmap would not result in mostly sequential access pattern and things like prefetch would not be very efficient, I think. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers