Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eroDe-0008Ve-VP for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Mar 2018 17:11:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eroDe-0000kV-2k for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Mar 2018 17:11:42 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1eroBz-0003O9-TY for pgsql-hackers@lists.postgresql.org; Fri, 02 Mar 2018 17:10:00 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eroBv-0006ue-Ll for pgsql-hackers@postgresql.org; Fri, 02 Mar 2018 17:09:58 +0000 Received: by mail-wr0-x242.google.com with SMTP id v65so10799651wrc.11 for ; Fri, 02 Mar 2018 09:09:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-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=pg7XLC3TrqgaavLt3qz8BhXWMn09fII0ovK9jIAS9fs=; b=uEY6n+sq0RwhkMd8Gc87fWW/Mda5gennoZSGChROEIlKvtD74obJLohOssaCVtY3YL oJhF7JNjXB9EZZtdLe92EGuf3EhyJkW8/RrPBIoLVPmVf8YwAPIhFfBb+Y7h6G3CwNB5 NgpLHzVGn0FGcN2Mow9rqN+f5e9poMHvHOIM1aGk2XaBCf37ZD9HDNrHh7Bc9ZygWzpr cQ4kjTQ88iwKOZ61qchKqg1i3gBp0O4sPq3JbKT9OkMsH0u7vbJl2A9Wsfmuf/t6AHQE 2z48h1UTqx9MepkJtUOexcj2IhRgbvkauKxf9Kcj0ugEGU0ZQBBC0vU8ClK3d92aQU8d 8Pug== 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=pg7XLC3TrqgaavLt3qz8BhXWMn09fII0ovK9jIAS9fs=; b=f8XMBwtzBQrdfSh+j1G8XcPLseV6baqMJl4AuMYh9A6DdNBNIWnwXp59Zj4HCZuZji rqBJhwyQpHx4iI59pT5J55i3tcNpEuGeEMF6W+JtgC8KwkPr9dPhAnpb8vRm/9O/aenx cJgMU3Q3mnhqfCMfmAvkfgyFjAyjUwGx/SbLfaI0FN2v0nx9Ekl0kxKKAy3dKp7BDbu2 eF0kwMISFPCOaTZx6J8iFRlZSSLOUpHqgGkdStXdwRSvpCcU/rrCsN7e4MTPJ6G2eTGX Oq9YoAVUEM7ADrUzqMUeOSr8kCEtUlT3xvSL2QzUZjJOg5Np3BJEdVJ5btXto4jhM6F1 3zxw== X-Gm-Message-State: APf1xPBgvJ1jbmOAV7bt8leK7zXytPkqkOiaK7F/wUCqbrbxAOZL6vXY cGM1K4yBtstyuPfNskgHaxy6b6zcwvicGAxNxe8P5UAU02Q2HkTiPh83/oc9soSG5irHq5Xlj8B w4g7HE9V11Xgcpd3fjcZZUSAM5rtOBkZG4iB9WqOG3e51ISB63yICK5487wKIBodBjw8xewhdgi s6OBtsvC80 X-Google-Smtp-Source: AG47ELu7NfOTHmLTC3Qox+OrJ2mLZiR6FFT/0KjNCRxkPwVw5CA0tjYMWy7OTAlYihkQ0X1X2RMS8A== X-Received: by 10.223.155.142 with SMTP id d14mr5804923wrc.93.1520010594231; Fri, 02 Mar 2018 09:09:54 -0800 (PST) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id z72sm1551566wmc.2.2018.03.02.09.09.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Mar 2018 09:09:53 -0800 (PST) Subject: Re: WIP: BRIN multi-range indexes To: Tom Lane , Andres Freund Cc: Mark Dilger , Alvaro Herrera , pgsql-hackers@postgreSQL.org 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> From: Tomas Vondra Message-ID: <4d31b358-77d9-c2d7-e0eb-319bda6456ad@2ndquadrant.com> Date: Fri, 2 Mar 2018 18:09:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <18526.1519963686@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 03/02/2018 05:08 AM, Tom Lane wrote: > Andres Freund writes: >> On 2018-02-25 01:30:47 +0100, Tomas Vondra wrote: >>> Note: Currently, this only works with float8-based data types. >>> Supporting additional data types is not a big issue, but will >>> require extending the opclass with "subtract" operator (used to >>> compute distance between values when merging ranges). > >> Based on Tom's past stances I'm a bit doubtful he'd be happy with such a >> restriction. Note that something similar-ish also has come up in >> 0a459cec96. > That restriction was lifted quite a long time ago, so now both index types support pretty much the same data types as the original BRIN (with the reltime/abstime exception, discussed in this thread earlier). >> I kinda wonder if there's any way to not have two similar but not >> equal types of logic here? > > Hm. I wonder what the patch intends to do with subtraction overflow, > or infinities, or NaNs. Just as with the RANGE patch, it does not > seem to me that failure is really an acceptable option. Indexes are > supposed to be able to index whatever the column datatype can store. > I admit that's something I haven't thought about very much. I'll look into that, of course, but the indexes are only using the deltas to pick which ranges to merge, so I think in the worst case it may results in sub-optimal index. But let me check what the RANGE patch did. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services