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 1kzNgR-0001s3-HI for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jan 2021 17:42:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kzNgQ-0001An-FK for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jan 2021 17:42:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzNgQ-0001Af-8E for pgsql-hackers@lists.postgresql.org; Tue, 12 Jan 2021 17:42:18 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kzNgN-0001vM-D8 for pgsql-hackers@lists.postgresql.org; Tue, 12 Jan 2021 17:42:16 +0000 Received: by mail-ej1-x634.google.com with SMTP id e18so3245091ejt.12 for ; Tue, 12 Jan 2021 09:42:14 -0800 (PST) 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=xPujdX7JsQF3Vxh8+fIVSj0/gbKhYh0E/Ywa7ah5PPQ=; b=V9YIHD6U9ePtAL0Hvhwf9YsHaD1gfA/qmT+m/MWlLw12T1tYe/p0dzBlhvTtdiBfkq 79aBXKGQNedxo+rO09jwqPSJKjfZeQieoAMBVnha4e/Zy7f4wcHgrbnc/r8QiDw2Pe2d ppccfNk8A8WMUauGl8cqNaZDJYwSPA6z+zpfxiqZ9BaNTiqZwHByZ/mmT1QK2vjVS0iW OLU80LAp3rzB5blT6VU4yxEwqqg56AbcqnBy7zL9YnFptnvZSJZ9Voq3v12Q/PYwAj6r 90YcxhX+EP7hhVGJN3qqb48aGrar39vcv1f/LJg1s25r+/7eiVdNZ9ZofLU8umeOtxis 0YgA== 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=xPujdX7JsQF3Vxh8+fIVSj0/gbKhYh0E/Ywa7ah5PPQ=; b=O2jaCfVzEoIAJgdPJOCta3c6Wx/5w8XV2AxgQNwaNpf9nlOqQlOi+2BJI2LVyxbbcN q7ndqWy7azdcEgDlMh9J0IJr0y2QWJjf5jJ7ZveFzpYmA0fY8o1a7m0BC2NmP8QEjDS3 96ynubSf+LGk6us/92BbSCi5V/g3ZKTOhVOeDfG2mfP2cET+VD/GYEqmnHd7UElPw/JW Z7DwhLMsg/whTnpD4TxLZuxwh+vvbQOLf3SEcmN72edFv9Bi2iCJMUBNLKWNHduLZOni L2RWidJaTTri91RK3Zsc4Om8SolxbBvREdv3ceLGTJy6LGLj4CUjtjNnE4xVr3W7EasR UmEA== X-Gm-Message-State: AOAM533JY44wsd//K8/oUYQfkFvqeGus+jR7f48VeAngoI1poHLwpk22 eyaqyCIEV4JJn5wGXBv6hSXnLmeQPzYtUcJB8QVCJ4gx219qUqMtBoH5ZwWLvQI+HyfI/t2EdcO JNF/HyLt6DwI2V9SulNcYAAH5IC36Xdo6CHxdVuYNEP7P1JUSSBXHoLeB+zPzQx/q79fenO8bVw VJ+4/bhslWz8FZ1HhcSjWlcRrVqfkZ1GNkZTtX8aV3WhqigiWQ1rTJBRwNBXqfNxNfl55bdI+9l 6H6sZr5kJEDhJwNZFatqyyKzw1EQm/uKgxDsf5V4rMn8UH2Z/nelA== X-Google-Smtp-Source: ABdhPJzfnq0a/1uhgPWb8TH49bfFjNbTh8sH5qBKrvRpA2VqJRl2rJULaeGh0a6Jhfn2JTntnach0Q== X-Received: by 2002:a17:906:f1c8:: with SMTP id gx8mr3994345ejb.524.1610473333245; Tue, 12 Jan 2021 09:42:13 -0800 (PST) Received: from [10.137.0.20] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id rl7sm1446403ejb.107.2021.01.12.09.42.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Jan 2021 09:42:12 -0800 (PST) Subject: Re: WIP: BRIN multi-range indexes To: John Naylor Cc: Anastasia Lubennikova , PostgreSQL Hackers References: <20201001222127.GA24173@alvherre.pgsql> <160434032777.4948.12542847889193566385.pgcf@coridan.postgresql.org> <20201102232545.zw4xir577gq55ogj@development> <88b3831d-8afa-4135-a420-27b12bf9fae4@enterprisedb.com> <1fdcbd2a-ff0f-fb81-d227-22279d5cbcb7@enterprisedb.com> <061b24c0-87eb-51a7-17d6-e1ba8c59fd23@enterprisedb.com> From: Tomas Vondra Message-ID: <8a40b7e4-357e-b0c2-e8b7-72001993fc32@enterprisedb.com> Date: Tue, 12 Jan 2021 18:42:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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: Precedence: bulk On 1/12/21 6:28 PM, John Naylor wrote: > On Sat, Dec 19, 2020 at 8:15 PM Tomas Vondra > > > wrote: > > [12-20 version] > > Hi Tomas, > > The measurements look good. In case it fell through the cracks, my > earlier review comments for Bloom BRIN indexes regarding minor details > don't seem to have been addressed in this version. I'll point to earlier > discussion for convenience: > > https://www.postgresql.org/message-id/CACPNZCt%3Dx-fOL0CUJbjR3BFXKgcd9HMPaRUVY9cwRe58hmd8Xg%40mail.gmail.com > > > https://www.postgresql.org/message-id/CACPNZCuqpkCGt8%3DcywAk1kPu0OoV_TjPXeV-J639ABQWyViyug%40mail.gmail.com > > Whooops :-( I'll go through those again, thanks for reminding me. > > The improvements are fairly minor: > > > > 1) Rejecting bloom filters that are clearly too large (larger than page) > > early. This is imperfect, as it works for individual index keys, not the > > whole row. But per discussion it seems useful. > > I think this is good enough. > > > So based on this I'm tempted to just use the version with two hashes, as > > implemented in 0005. It's much simpler than the partitioning scheme, > > does not need any of the logic to generate primes etc. > > Sounds like the best engineering decision. > > Circling back to multi-minmax build times, I ran a couple quick tests on > bigger hardware, and found that not only is multi-minmax slower than > minmax, which is to be expected, but also slower than btree. (unlogged > table ~12GB in size, maintenance_work_mem = 1GB, median of three runs) > > btree          38.3s > minmax         26.2s > multi-minmax  110s > > Since btree indexes are much larger, I imagine something algorithmic is > involved. Is it worth digging further to see if some code path is taking > more time than we would expect? > I suspect it'd due to minmax having to decide which "ranges" to merge, which requires repeated sorting, etc. I certainly don't dare to claim the current algorithm is perfect. I wouldn't have expected such big difference, though - so definitely worth investigating. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company