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 1pvQ9X-0004fA-0a for pgsql-hackers@arkaria.postgresql.org; Sat, 06 May 2023 22:13: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 1pvQ9V-0001C0-Qw for pgsql-hackers@arkaria.postgresql.org; Sat, 06 May 2023 22:13:17 +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 1pvQ9V-0001Bq-Hh for pgsql-hackers@lists.postgresql.org; Sat, 06 May 2023 22:13:17 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pvQ9S-000vL2-58 for pgsql-hackers@lists.postgresql.org; Sat, 06 May 2023 22:13:16 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-965d73eb65fso398177366b.2 for ; Sat, 06 May 2023 15:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1683411190; x=1686003190; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Bdu0UsGW6ePEKn/qRt2ayhdhhw4eqmVuTJX/FLo8Wjo=; b=hcLQqoP0UIecQO0aDhCCKrnbqz+Ff5t/SR4s8IFLSunuWHR55xLnt6RTRERlMqzlJJ lWYajrNF2OqDGX3UwrRKEuGM0iHe67tpItjp+kHg/GYUYZg0lGRQ3FEgUfsMgJbN02po kJbE9EgtZoPt8zbOnP6+yiNbT4b5O4sKBapSMmnUIJrXcub+K82mbcAPinSjkGxT2vnr vlREbw0qXslnr5RBOGLjzVcUk7aHP1GguVa29uutdT81eSLEWYTAnlYX7T/dIoXBFgKb m25hmv6wBwbBFad7tg03k79em4iW0P97OchYQswhLpxBqAB7xcty+EUFWuNDl7S4VohP za0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683411190; x=1686003190; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Bdu0UsGW6ePEKn/qRt2ayhdhhw4eqmVuTJX/FLo8Wjo=; b=dxOT9Vp1bg57pUnyeJiRiNcJhk8zS7G55OA5ZDpxSOxGFnULly7K4cAgdRpYUNf/0F IAiyJFTD2PmXnPWyMHa3UyOAUWlFHCuCpWvDbJlFZnqMc8u0RbsKgMejIhq9vw/GGp6z QWUh+YboZcnKBwfXvSp6vi66H+EN4GGUurhLzFvB5Q3Cs6pQGDQlWH7yhjUwosOb4m8M /XjMipkRJLYpSgP/ZL7gAbVEeb8ghUjR9TTWZNhGBskv0g/TJN6YtZTt8V+rFPqyqSQ2 8sbYJIE/j38pv4f5flSoHOA70OANnu2uu6lMujisXWDEV3rXP6/NWliiAdttA8AQgykk e4sw== X-Gm-Message-State: AC+VfDxPWww2KBUXifjktiTb700vaJ0hTH7yakVRwZs8ZbNGiPrGZGb/ kF8D9uOLQt9AKGXA/Ye2VPxNaTLVrXy11KSYizUTzjsxz2EWjzd2+WLLl+Pjx3i1Pz9kG/3RzWs uQXBtaQw62PkhyhOlgILM6DqLjWIrpkl2VSQs9Hv1J91HiQpApdB2wmFRlxMmOHSAiu+eogSQF2 /8Q/DbBt7nWZTPUiXW7QyVYboYmsrAaf1GtIUArXjJTgH94SYRT2lQ X-Google-Smtp-Source: ACHHUZ6P5CwOFIKrOFPnJQYQibqSOTMZvZT/CZCtaGggRlguipDYLt2lEGhusjeG3oRiq03CpiT+9w== X-Received: by 2002:a17:907:6e0b:b0:949:5db4:7888 with SMTP id sd11-20020a1709076e0b00b009495db47888mr5367074ejc.27.1683411190398; Sat, 06 May 2023 15:13:10 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-228-220.bb.vodafone.cz. [86.49.228.220]) by smtp.gmail.com with ESMTPSA id z16-20020a170906669000b00965b2d3968csm2777207ejo.84.2023.05.06.15.13.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 May 2023 15:13:09 -0700 (PDT) Message-ID: <141202ca-4c92-e294-0bfe-e1709ee2f71b@enterprisedb.com> Date: Sun, 7 May 2023 00:13:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: Missing update of all_hasnulls in BRIN opclasses Content-Language: en-US From: Tomas Vondra To: Alvaro Herrera Cc: Justin Pryzby , Matthias van de Meent , pgsql-hackers@lists.postgresql.org References: <20230424153648.cyaifmcchslbcsrf@alvherre.pgsql> <491ba86b-6294-37bb-fe00-c91e829dfc82@enterprisedb.com> In-Reply-To: <491ba86b-6294-37bb-fe00-c91e829dfc82@enterprisedb.com> Content-Type: text/plain; charset=UTF-8 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 4/24/23 23:20, Tomas Vondra wrote: > On 4/24/23 17:36, Alvaro Herrera wrote: >> On 2023-Apr-23, Tomas Vondra wrote: >> >>> here's an updated version of the patch, including a backport version. I >>> ended up making the code yet a bit closer to master by introducing >>> add_values_to_range(). The current pre-14 code has the loop adding data >>> to the BRIN tuple in two places, but with the "fixed" logic handling >>> NULLs and the empty_range flag the amount of duplicated code got too >>> high, so this seem reasonable. >> >> In backbranches, the new field to BrinMemTuple needs to be at the end of >> the struct, to avoid ABI breakage. >> Unfortunately, this is not actually possible :-( The BrinMemTuple has a FLEXIBLE_ARRAY_MEMBER at the end, so we can't place anything after it. I think we have three options: a) some other approach? - I really can't see any, except maybe for going back to the previous approach (i.e. encoding the info using the existing BrinValues allnulls/hasnulls flags) b) encoding the info in existing BrinMemTuple flags - e.g. we could use bt_placeholder to store two bits, not just one. Seems a bit ugly. c) ignore the issue - AFAICS this would be an issue only for (external) code accessing BrinMemTuple structs, but I don't think we're aware of any out-of-core BRIN opclasses or anything like that ... regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company