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 1l9cEN-0003kk-Da for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Feb 2021 23:15:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l9cEL-0000Cq-Dm for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Feb 2021 23:15:37 +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 1l9cEL-0000Ci-2s for pgsql-hackers@lists.postgresql.org; Tue, 09 Feb 2021 23:15:37 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l9cEH-0004Ok-9p for pgsql-hackers@lists.postgresql.org; Tue, 09 Feb 2021 23:15:36 +0000 Received: by mail-ed1-x52e.google.com with SMTP id q2so405119edi.4 for ; Tue, 09 Feb 2021 15:15:32 -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=GjozqP2nCVmwrFc9QBCtOUHT77XsEi5t6C/G46oGuHU=; b=wnBP+BWBiSZy2aEmnKWEJH4ig9St8ulqj9noQIkpbLFla9H1SOcaQ4gpGl1sS+lGa6 xGenuFa+Q7wA2FAO6uOs0gifjQfW9KNNlUXY2sA3iLfRTpb2R+zyJFdFEbHanIh9A+D/ VXy0XZj3CqgBJf/C5YlL8DhdJAq9iVZAG+AYCugA8tarVa3JjCXEkCaP2uxtGRB0sikx 7pqNx2btAxvWVy3ZLf8GoA1hrtOhO8cV4ZYkRixpcAr8OyBBdIHO7xqk5vCfQFbBm/1D vY9ANXGlP4kCSVdOMCUPXgqMdIqiDi3MZ2eqbi8Cg1i8rjpFAtbtbLFmGpUOB2fERp4Y k8PQ== 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=GjozqP2nCVmwrFc9QBCtOUHT77XsEi5t6C/G46oGuHU=; b=asVSLzVF2eFoY3X9a5KzIRsQf6aymn96FXVU+iXj6FAT6iq7B62eL+E5RgReHPQD1R +CvVcq/5l9axAPPtXyo8ajaSJktqevFdIedw7rSdzgKVKL85dRgT+TW+oxobxoYOH50u yeyRNV3hLkKwBAENLBZ4xM+cYL9LxTDHfcS8O9XcA0H5Vq64kduQUZSGQtcWvSwTK/N+ VhT3k1q6DJ439Y2JmtXC2Fe0FB6IYfPyYSE+75ru3ibEGUMRVHI2rXE5q3xqij6P5Piz m5Kdw3LywX7KYW9ZO2fVV6mdtYydTYhCmxw1gzmznFPvUA1v7+L/gvAbu3yGUqIj62Pt s/bg== X-Gm-Message-State: AOAM533marxf83yv693Rw+B25W5IOYJwNc287DoevQLpO9I+4n25nU9W z9BO6pAnZmSO7faS0El2LG8Kp2mdAJjPBI5uutKTSF0nIiJ6Ea4QdXa+iDOIzO11rTIbqB/u2OZ uFRId3ikuJHayIS40kec4HuzUlj2szeAi5TkPwBm06S/e96NnWVO9wxnVhR9kf8eVgowBD9Zzse 0G2bX3oezhEoQcX7NEK0TiG2brjyfIy7g71AkDuW8X5NUiDo8qY12952kK/aWiPgZqM2nOCRUwv bWnY9w2M6G8PCNMCXKPI8blGwxFg9YGIoDSSqWHcvL5Wz6mmNjcvA== X-Google-Smtp-Source: ABdhPJyANml40PDlDKGydZmu92kiPHKPgSCM2N/TUZwc2PfKqfM0GgaNLghQTtop3n8wIraAr0UOMQ== X-Received: by 2002:aa7:dbd4:: with SMTP id v20mr504961edt.330.1612912530390; Tue, 09 Feb 2021 15:15:30 -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 k9sm12480530edo.30.2021.02.09.15.15.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Feb 2021 15:15:29 -0800 (PST) Subject: Re: WIP: BRIN multi-range indexes To: John Naylor Cc: 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> <79869c9d-95a2-0940-76a8-29c348707a66@enterprisedb.com> From: Tomas Vondra Message-ID: <0e2f18d5-cd6d-764b-3912-512e9c722b8a@enterprisedb.com> Date: Wed, 10 Feb 2021 00:15:25 +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: 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: Precedence: bulk On 2/9/21 3:46 PM, John Naylor wrote: > On Wed, Feb 3, 2021 at 7:54 PM Tomas Vondra > > > wrote: > > > > [v-20210203] > > Hi Tomas, > > I have some random comments from reading the patch, but haven't gone > into detail in the newer aspects. I'll do so in the near future. > > The cfbot seems to crash on this patch during make check, but it doesn't > crash for me. I'm not even sure what date that cfbot status is from. > Yeah, I noticed that too, and I'm investigating. I tried running the regression tests on a 32-bit machine (rpi4), which sometimes uncovers strange failures, and that indeed fails. There are two or three bugs. Firstly, the allocation optimization patch does this: MAXALIGN(sizeof(ScanKey) * scan->numberOfKeys * natts) instead of MAXALIGN(sizeof(ScanKey) * scan->numberOfKeys) * natts and that sometimes produces the wrong result, triggering an assert. Secondly, there seems to be an issue with cross-type bloom indexes. Imagine you have an int8 column, with a bloom index on it, and then you do this: WHERE column = '122'::int4; Currently, we end up passing this to the consistent function, which tries to call hashint8 on the int4 datum - that succeeds on 64 bits (because both types are byval), but fails on 32-bits (where int8 is byref, so it fails on int4). Which causes a segfault. I think I included those cross-type operators as a copy-paste from minmax indexes, but I see hash indexes don't allow this. And removing those cross-type rows from pg_amop.dat makes the crashes go away. It's also possible I simplified the get_strategy_procinfo a bit too much. I see the minmax variant has subtype, so maybe we could do this instead (I recall the integer types should have "compatible" results). There are a couple failues where the index does not produce the right number of results, though. I haven't investigated that yet. Once I fix this, I'll post an updated patch - hopefully that'll make cfbot happy. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company