Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h41oX-0000CL-Fv for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2019 11:12:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h41oV-0005gP-22 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2019 11:12:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h41lQ-0008SZ-In for pgsql-hackers@lists.postgresql.org; Wed, 13 Mar 2019 11:09:36 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h41lN-0004lf-V6 for pgsql-hackers@postgresql.org; Wed, 13 Mar 2019 11:09:36 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 7ADF021C401D for ; Wed, 13 Mar 2019 14:09:32 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from mail-it1-f176.google.com (mail-it1-f176.google.com [209.85.166.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (not verified)) by mail.postgrespro.ru (Postfix) with ESMTPSA id 0AB7E21C4023 for ; Wed, 13 Mar 2019 14:09:32 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1552475372; bh=VAfb3PPXISrBABsJcv4Y7u7GcOisQ94Tpj8Fcl7d/VQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=Fd+fGq2MguKtN7A8xPdySZlU88gEcHhiE/kfiQRUJ6eKn2+LT2dQqGx1ExmtQRYpX cvzJ2Nus6l4fRWWb/Hj0EU/AAzHTjpEICIiwkweMbZQ9k7r7EsFjE5yLs/NraiMwmQ RHaERJxNXD9WU0ZjToz41R1wds0uiOoMxI3XzGHo= Received: by mail-it1-f176.google.com with SMTP id l139so2179264ita.5 for ; Wed, 13 Mar 2019 04:09:31 -0700 (PDT) X-Gm-Message-State: APjAAAWNgqQ00Pw7sBDw/3kGnnjj5X0U7Ayi+lO04nN7u53fA3l4rWVo 57VaJJ2uTXvqeE26Ct6u8kJ6NxhIEPMIXakb0Lg= X-Google-Smtp-Source: APXvYqz88TG+98ZNaTppymaRGmDkjN72cVF33fGorMd/qRGqTRphjz0xFwBRnjJ/dRzaE57vsKgGHjqNyjgSOBksU1M= X-Received: by 2002:a24:3554:: with SMTP id k81mr1171554ita.41.1552475370567; Wed, 13 Mar 2019 04:09:30 -0700 (PDT) MIME-Version: 1.0 References: <20180123200537.gfx5hxcp5k5hktpe@alvherre.pgsql> <821c4c1d-592e-8916-e323-04607b11777e@2ndquadrant.com> <104E8BB8-35FF-4AA8-9871-6AFF04E4CAF3@gmail.com> <0afde2fc-e160-004f-8fe2-c65302ac3760@2ndquadrant.com> <22674.1517874015@sss.pgh.pa.us> <3e924a4c-6ca0-cc10-aebb-5004fc002800@2ndquadrant.com> <20180302035538.gkqgtcv6kmn2cklw@alap3.anarazel.de> <18526.1519963686@sss.pgh.pa.us> <1c1c1ced-1f79-a0ee-e5cd-858ca3eb9d74@2ndquadrant.com> <49cb668f-d6f9-3493-681d-7d40b715ef64@postgrespro.ru> <90be37f9-07ea-0f90-4bc6-6bdb68f4f190@2ndquadrant.com> In-Reply-To: From: Alexander Korotkov Date: Wed, 13 Mar 2019 14:09:19 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: WIP: BRIN multi-range indexes To: Tomas Vondra Cc: Nikita Glukhov , Tom Lane , Andres Freund , Mark Dilger , Alvaro Herrera , pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Mar 13, 2019 at 12:52 PM Tomas Vondra wrote: > On 3/13/19 9:15 AM, Alexander Korotkov wrote: > > On Tue, Mar 12, 2019 at 8:15 PM Tomas Vondra > > wrote: > >>> 0001. Pass all keys to BRIN consistent function at once. > >>> > >>> I think that changing the signature of consistent function is bad, because then > >>> the authors of existing BRIN opclasses will need to maintain two variants of > >>> the function for different version of PosgreSQL. Moreover, we can easily > >>> distinguish two variants by the number of parameters. So I returned back a > >>> call to old 3-argument variant of consistent() in bringetbitmap(). Also I > >>> fixed brinvalidate() adding support for new 4-argument variant, and fixed > >>> catalog entries for brin_minmax_consistent() and brin_inclusion_consistent() > >>> which remained 3-argument. And also I removed unneeded indentation shift in > >>> these two functions, which makes it difficult to compare changes, by extracting > >>> subroutines minmax_consistent_key() and inclusion_consistent_key(). > >>> > >> > >> Hmmm. I admit I rather dislike functions that change the signature based > >> on the number of arguments, for some reason. But maybe it's better than > >> changing the consistent function. Not sure. > > > > I also kind of dislike signature change based on the number of > > arguments. But it's still good to let extensions use old interface if > > needed. What do you think about invention new consistent method, so > > that extension can implement one of them? We did similar thing for > > GIN (bistate consistent vs tristate consistent). > > > > Possibly. The other annoyance of course is that to support the current > consistent method we'll have to keep all the code I guess :-( Yes, because incompatible change of opclass support function signature is the thing we never did before. We have to add new optional arguments to GiST functions, but that was compatible change. If we do incompatible change of opclass interface, it becomes unclear to do pg_upgrade with extension installed. Imagine, if we don't require function signature to match, we could easily get segfault because of extension incompatibility. If we do require function signature to match, extension upgrade would become complex. It would be required to not only adjust C-code, but also write some custom script, which changes opclass (and users would have to run this script manually?). ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company