Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juOwy-00034L-5w for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 23:30:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1juOwx-0004M6-3M for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 23:30:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juOww-0004Lo-R7 for pgsql-hackers@lists.postgresql.org; Sat, 11 Jul 2020 23:30:30 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1juOws-0004Mv-T4 for pgsql-hackers@postgresql.org; Sat, 11 Jul 2020 23:30:29 +0000 Received: by mail-ej1-x635.google.com with SMTP id lx13so10235920ejb.4 for ; Sat, 11 Jul 2020 16:30:26 -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; bh=jQ+ejC+20R5vYm9mF8dQWOtZCkNTI57+fK5WSubu97A=; b=nHZXaJYm4PjrWLpwwtmw5zxYwNg6SimzFAntC4wTxyYWnoSZfQbyHhXVSLnLm9VvPf sVCN1y+XXzYRPLLurJrwTDkv0Ja9qXJDEnyA0PZxFoQ0rCkOJMyTs26uXio8yek3pvpc TM7jN3H0bh8+HvNzuSFPGk0d4SiAoAV+0B1yxsP8Htp0pUFz9HWHxovHK85ZvvYPszEy Xk4I0KQsvF0YrsPS4++hR5a/ciadQmXldVO2UWy5UhHylf5LM7WzqPUcLAx63O15VFWS lENnw3l9igb73bsEk4mK7TfY+Ozm1KmWgcK/J4lQ+cLLgpZ2qiXJl/uHkY09NEpaVKLz T1GQ== 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; bh=jQ+ejC+20R5vYm9mF8dQWOtZCkNTI57+fK5WSubu97A=; b=b9NlJ9NTDhIAr/Hrd8QmaNNJ/HPaopDNbcktIYbRFSdMPFeJL6q3TtrWx/os5+wBE1 7c1mHohiwUnvewIvOYGR0LIzek9gECgasOdsko86/eFmaTYIUeLos2oncrJ4LteZNwhe Z8x2YHxXGF6BXcqSABtAmz/xke4nluOBvqJUx2gxRn7NA1zlXhnlmblaArACIKKSPM86 CUNdgExwmQYZvJnot7+lKycGlgePUIECJA2/aoQMk/VXOhGUoElLTxub17wD181wQlv7 ha3TBGGT1rp6rvXcTeQtYXJN2qLVszoZCiVZ9FOaQVzeCc63pGHEOvPfced5XMEoMNEn zflg== X-Gm-Message-State: AOAM530Vp8iQoLQMrrR7cXGvv600yp1VJkDHiWYRWlWGyVXotQQ/NpYT 8dkLG9Hi9gj9dyutSYa5sHXGlw== X-Google-Smtp-Source: ABdhPJxjkl8tjxfRXJclrRHTdhZnxpd7MRr4gIL/6Z6LXtL8NecHg6V40O2BLD76gqR+oYRnDtNIew== X-Received: by 2002:a17:906:c1d8:: with SMTP id bw24mr57120058ejb.91.1594510225993; Sat, 11 Jul 2020 16:30:25 -0700 (PDT) Received: from localhost (ip-86-49-253-141.net.upcbroadband.cz. [86.49.253.141]) by smtp.gmail.com with ESMTPSA id t2sm8025838eds.60.2020.07.11.16.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jul 2020 16:30:24 -0700 (PDT) Date: Sun, 12 Jul 2020 01:30:22 +0200 From: Tomas Vondra To: Sascha Kuhl Cc: Masahiko Sawada , Alexander Korotkov , Michael Paquier , Alvaro Herrera , Tom Lane , Andres Freund , Mark Dilger , pgsql-hackers Subject: Re: WIP: BRIN multi-range indexes Message-ID: <20200711233022.7gfiaknavvnd4lvr@development> References: <20200405155317.rpmkqdj7far7mwkx@development> <20200405165954.m2odnthc7sbdctwg@development> <20200703005737.dw5i2uwd6i3gv5lf@development> <20200710120914.6kydpi3kfr2icpfq@development> <20200711112416.mzyibbacgymhrntb@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Jul 11, 2020 at 03:32:43PM +0200, Sascha Kuhl wrote: >Tomas Vondra schrieb am Sa., 11. Juli 2020, >13:24: > >> On Fri, Jul 10, 2020 at 04:44:41PM +0200, Sascha Kuhl wrote: >> >Tomas Vondra schrieb am Fr., 10. Juli >> 2020, >> >14:09: >> > >> >> On Fri, Jul 10, 2020 at 06:01:58PM +0900, Masahiko Sawada wrote: >> >> >On Fri, 3 Jul 2020 at 09:58, Tomas Vondra < >> tomas.vondra@2ndquadrant.com> >> >> wrote: >> >> >> >> >> >> On Sun, Apr 05, 2020 at 08:01:50PM +0300, Alexander Korotkov wrote: >> >> >> >On Sun, Apr 5, 2020 at 8:00 PM Tomas Vondra >> >> >> > wrote: >> >> >> ... >> >> >> >> > >> >> >> >> >Assuming we're not going to get 0001-0003 into v13, I'm not so >> >> >> >> >inclined to rush on these three as well. But you're willing to >> >> commit >> >> >> >> >them, you can count round of review on me. >> >> >> >> > >> >> >> >> >> >> >> >> I have no intention to get 0001-0003 committed. I think those >> changes >> >> >> >> are beneficial on their own, but the primary reason was to support >> >> the >> >> >> >> new opclasses (which require those changes). And those parts are >> not >> >> >> >> going to make it into v13 ... >> >> >> > >> >> >> >OK, no problem. >> >> >> >Let's do this for v14. >> >> >> > >> >> >> >> >> >> Hi Alexander, >> >> >> >> >> >> Are you still interested in reviewing those patches? I'll take a >> look at >> >> >> 0001-0003 to check that your previous feedback was addressed. Do you >> >> >> have any comments about 0004 / 0005, which I think are the more >> >> >> interesting parts of this series? >> >> >> >> >> >> >> >> >> Attached is a rebased version - I realized I forgot to include 0005 >> in >> >> >> the last update, for some reason. >> >> >> >> >> > >> >> >I've done a quick test with this patch set. I wonder if we can improve >> >> >brin_page_items() SQL function in pageinspect as well. Currently, >> >> >brin_page_items() is hard-coded to support only normal brin indexes. >> >> >When we pass brin-bloom or brin-multi-range to that function the >> >> >binary values are shown in 'value' column but it seems not helpful for >> >> >users. For instance, here is an output of brin_page_items() with a >> >> >brin-multi-range index: >> >> > >> >> >postgres(1:12801)=# select * from brin_page_items(get_raw_page('mul', >> >> >2), 'mul'); >> >> >-[ RECORD 1 >> >> >> ]---------------------------------------------------------------------------------------------------------------------- >> >> >> >> >> >----------------------------------------------------------------------------------------------------------------------------------- >> >> >---------------------------- >> >> >itemoffset | 1 >> >> >blknum | 0 >> >> >attnum | 1 >> >> >allnulls | f >> >> >hasnulls | f >> >> >placeholder | f >> >> >value | >> >> >> {\x010000001b0000002000000001000000e5700000e6700000e7700000e8700000e9700000ea700000eb700000ec700000ed700000ee700000ef >> >> >> >> >> >700000f0700000f1700000f2700000f3700000f4700000f5700000f6700000f7700000f8700000f9700000fa700000fb700000fc700000fd700000fe700000ff700 >> >> >00000710000} >> >> > >> >> >> >> Hmm. I'm not sure we can do much better, without making the function >> >> much more complicated. I mean, even with regular BRIN indexes we don't >> >> really know if the value is plain min/max, right? >> >> >> >You can be sure with the next node. The value is in can be false positiv. >> >The value is out is clear. You can detect the change between in and out. >> > >> >> I'm sorry, I don't understand what you're suggesting. How is any of this >> related to false positive rate, etc? >> > >Hi, > >You check by the bloom filter if a value you're searching is part of the >node, right? > >In case, the value is in the bloom filter you could be mistaken, because >another value could have the same hash profile, no? > >However if the value is out, the filter can not react. You can be sure that >the value is out. > >If you looking for a range or many ranges of values, you traverse many >nodes. By knowing the value is out, you can state a clear set of nodes that >form the range. However the border is somehow unsharp because of the false >positives. > >I am not sure if we write about the same. Please confirm, this can be >needed. Please. > Probably not. Masahiko-san pointed out that pageinspect (which also has a function to print pages from a BRIN index) does not understand the summary of the new opclasses and just prints the bytea verbatim. That has nothing to do with inspecting the bloom filter, or anything like that. So I think there's some confusion ... regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services