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 1lQFl8-0004Fb-Qr for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Mar 2021 20:42:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lQFl7-000081-Pd for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Mar 2021 20:42:13 +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 1lQFl7-00007u-Ft for pgsql-hackers@lists.postgresql.org; Sat, 27 Mar 2021 20:42:13 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lQFl4-0002Gc-Da for pgsql-hackers@lists.postgresql.org; Sat, 27 Mar 2021 20:42:13 +0000 Received: by mail-ed1-x536.google.com with SMTP id dm8so10094456edb.2 for ; Sat, 27 Mar 2021 13:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-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=xoWTOFqW6YD/TLgjXnIqWg5O91uqC3FOnpAIFMyvlI0=; b=yaRpCgLWLNk1JKMeKqUh8TJT4IC6VCludwtPWlOhAcsXS4nvOWm9lCX7v3TUhs1PY9 CmEDu9w+aCVAPSU+dv2u1ZnMgilMOciW3vLZB4a+FxU+UCYvxnzeyf84evGuniCezqlQ mUWOlkWKIw/ZwG3OfF6FqSRTIlb34HY4c3zPOcris2tri7TU784vDc17hoDiRixIfV+X HCaWC9XBGHB33wrsLhl9IXjLrtW9JTE1rVcNP3Azyo5HMNcT3zSLD08JdMWZJx23J0br pFVaLjrgIQEUZNciDhscVeTcokAEK8sPkzIFu/hax4aJgZSTJXHWZj8rEU6IPcRisnV4 ab/g== 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=xoWTOFqW6YD/TLgjXnIqWg5O91uqC3FOnpAIFMyvlI0=; b=GSJcwDUauJLRdoZd43lhnbzDnEfBRcFX+YDM5OZmWoSk1eVI9DFVzTTcrOS0qkazYA uNaPkKRqjQ50OFd97c6p0BWSDC0eiDwjEB4/BnBBaSmXBiD46G0zFUAMwDA5VZsu3XeS 6oV5ZdAqEa+gLAc8X3/pXE7h8QY9Nw+q7WeYkocpKQ/ZsG3QGVP1/Vm+FDmU2QqPTz3e oxgBVPasFd3Nq5sisHhNuk0olV/jotLbchWA8raqQ4NuPnB7r4hN9wwMzEIwf+U6Tw5t G19vwHNRKFVcGRcqxQrKxXOv5jmSWTzEzSi2VF5rziFKUKNO6BtcBXqfLkgT/WT7R3XZ Kp8A== X-Gm-Message-State: AOAM533pRbSxpmgB2lR41OzyywYbUA2jSL46T/FM6wBGqxc0FCyF2JWK AbO0TcDanXTpFFjJHBZNmKEZlk4m5Z+98KyVjnU4wzp+URwsUcYdUQQ7TFc1uaS76G51oXODDgh yqjwQDYuD63sthDjZSBHZVf1xda7iaOGTt+nn+wBsJ+IQZSuwGDudmuh0LvJIMf5MgRH3WAtiY0 rmvyt31YxhNHh2pgLDB55T+YsZo+ck/Yl1DLIcceEMgoD1OAUiLcqF5SDmkGHdWXnqfEf81z4lc v9gAUJi4V+4HqNJOwzauZe3kLzHeEBjwe4tQib7YJX+GQ6KOq8W9g== X-Google-Smtp-Source: ABdhPJxSSsTLN5jsWERHukmJlBBUoe6xdmfMFvnbaHn5byb7wZElBHQ3C9T4iMJxWtkXkj5zlQ4AsA== X-Received: by 2002:a05:6402:13ca:: with SMTP id a10mr21662784edx.320.1616877728609; Sat, 27 Mar 2021 13:42:08 -0700 (PDT) Received: from [10.137.0.4] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id gz20sm5751773ejc.25.2021.03.27.13.42.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Mar 2021 13:42:07 -0700 (PDT) Subject: Re: WIP: BRIN multi-range indexes To: Alvaro Herrera Cc: John Naylor , PostgreSQL Hackers References: <20210327180913.GA3088@alvherre.pgsql> From: Tomas Vondra Message-ID: Date: Sat, 27 Mar 2021 21:42:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210327180913.GA3088@alvherre.pgsql> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/27/21 7:09 PM, Alvaro Herrera wrote: > On 2021-Mar-26, Tomas Vondra wrote: > >> Hi, >> >> I've pushed both the bloom and minmax-multi indexes today. > > One thing I've been wondering all along is how useful are these > BRIN-backed bloom indexes compared to contrib-supplied bloom indexes. > My guess is that the BRIN implementation has some advantage, or you > would not have worked so much on it. But what is it? > The contrib/bloom indexes are a completely different type of index. They are not BRIN but a completely separate AM. The bloom filters are per-row (so the index is larger than BRIN) and it's useful when you have table with many attributes, and need to test various combinations of them. create table t (a int, b int, c int); insert into t select 10 * random(), 10 * random(), 10 * random() from generate_series(1,1000000) s(i); analyze t; create index bloom_idx on t using bloom (a,b,c) with (length=80, col1=4, col2=4, col3=4); create index brin_bloom_idx on t using brin (a int4_bloom_ops, b int4_bloom_ops, c int4_bloom_ops); test=# \di+ List of relations Schema | Name | Table | Access Method | Size | Description --------+----------------+-------+---------------+-------+------------- public | bloom_idx | t | bloom | 15 MB | public | brin_bloom_idx | t | brin | 88 kB | (2 rows) So it's a completely different kind of animal, perhaps closer to btree than to BRIN. I'm sure there are cases where contrib/bloom works better than brin/bloom, but also the other way around. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company