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 1jtrqH-0003aM-NB for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2020 12:09:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtrqG-0002zB-5B for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2020 12:09:24 +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 1jtrqF-0002z4-TG for pgsql-hackers@lists.postgresql.org; Fri, 10 Jul 2020 12:09:23 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jtrqC-0008Sy-L9 for pgsql-hackers@postgresql.org; Fri, 10 Jul 2020 12:09:23 +0000 Received: by mail-ej1-x643.google.com with SMTP id w16so5790662ejj.5 for ; Fri, 10 Jul 2020 05:09:20 -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=Jz1uMmnvc/RL0sLdpgQEfZMRgO/ye8+SiEK6IsL0Gbg=; b=fyQmg+3HNkQ2qbd30eiUSZkRiw3zxHkjpsr+CRzCOlv+dmpzNhiJqPVuua1A6pWqFT BUFpx6+yu/gDeYmTAFMDGrflBdbuUVV9MpR/K0X7nACB6YNDcoBj/n6ddH0KYhXQUc1w 1p3eS77mrKMIoZ7pELodvYabtUZ0710o39FxzukiH/HXjer0KyG56KSJx8W1O+Vc/xAE RGOGQATaitRA9adSs26TWTz9yfxpfBOB8j2aaJ0G3hxKS/CmzZ1CXQtxW2F7UZUhdclQ zVacM1h4QlaxUJn62NjysJRKdKvw0fKCaGm5atNPJC8ICXXl+MfscVyZiGBsaqWOSNI/ R9WQ== 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=Jz1uMmnvc/RL0sLdpgQEfZMRgO/ye8+SiEK6IsL0Gbg=; b=F6ZvR+390V6mN5H5DoskDo6ybjUL2tP75Wb3NaPmGa63yTdFpor7+DxC3lBvHK0TzB IRqaD+G4RRk7H1YoNUbsyW9sOY5oxVP3ZQu2F5Z1+gzZV+gJzbAek3cRL8oH27jNZEny mba0VC0FLPZxjmaoZbR6aoVLWFuV9jhYP8iCaNkcC7hc3rv64NyQpUsc9rzUu4f/XHh7 6/QgqnhMhjoMdfex8OoeJIh2LwZIIWxA/3xhJa3C+zhTiRprZiR5D/E4eUeiKwp6XkhB dQBDy7ZhUCqdC/3CTn8OQ4DILRmjRcUbcQ6KJDvPaw3VdYdy2NgHgAlK9DFWTtHnxv20 0jqA== X-Gm-Message-State: AOAM533FfLDQxAmrpGMOMrPrhwf9A7U/+mwgZhsM3tGHKPU4rJ1p5Evw fzqPwvTrnWSMIEgzd3eWGLYBFw== X-Google-Smtp-Source: ABdhPJzEt5wffWG1ArxEYDsh+r1Apl4LapLq7EjRSHbyFBskzHp0See0ZYOQUl2FOrMO77scoJqx8w== X-Received: by 2002:a17:906:dbe9:: with SMTP id yd9mr7138358ejb.75.1594382959307; Fri, 10 Jul 2020 05:09:19 -0700 (PDT) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id v25sm4153594edr.74.2020.07.10.05.09.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 05:09:17 -0700 (PDT) Date: Fri, 10 Jul 2020 14:09:14 +0200 From: Tomas Vondra To: Masahiko Sawada Cc: Alexander Korotkov , Michael Paquier , Alvaro Herrera , Tom Lane , Andres Freund , Mark Dilger , pgsql-hackers Subject: Re: WIP: BRIN multi-range indexes Message-ID: <20200710120914.6kydpi3kfr2icpfq@development> References: <20190926190148.piwdqnfc2brargqq@development> <20191201015502.GF2355@paquier.xyz> <20200402022904.xssjyfupdaj2ejyp@development> <20200405155317.rpmkqdj7far7mwkx@development> <20200405165954.m2odnthc7sbdctwg@development> <20200703005737.dw5i2uwd6i3gv5lf@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 Fri, Jul 10, 2020 at 06:01:58PM +0900, Masahiko Sawada wrote: >On Fri, 3 Jul 2020 at 09:58, Tomas Vondra 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? >Also, I got an assertion failure when setting false_positive_rate reloption: > >postgres(1:12448)=# create index blm on t using brin (c int4_bloom_ops >(false_positive_rate = 1)); >TRAP: FailedAssertion("(false_positive_rate > 0) && >(false_positive_rate < 1.0)", File: "brin_bloom.c", Line: 300) > >I'll look at the code in depth and let you know if I find a problem. > Yeah, the assert should say (f_p_r <= 1.0). But I'm not convinced we should allow values up to 1.0, really. The f_p_r is the fraction of the table that will get matched always, so 1.0 would mean we get to scan the whole table. Seems kinda pointless. So maybe we should cap it to something like 0.1 or so, but I agree the value seems kinda arbitrary. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services