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 1hjqKA-0005FO-5C for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Jul 2019 19:26:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hjqK8-0007KJ-Mt for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Jul 2019 19:26:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjqK8-0007Dq-Av for pgsql-hackers@lists.postgresql.org; Sat, 06 Jul 2019 19:26:16 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjqK1-000425-LB for pgsql-hackers@postgresql.org; Sat, 06 Jul 2019 19:26:14 +0000 Received: by mail-pl1-x62a.google.com with SMTP id b7so6146071pls.6 for ; Sat, 06 Jul 2019 12:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=FWeWpH1bMfMB83cZC/0mNCXV8Z9FTvnf/4pbvaq8fVc=; b=NhSHdDtJ6Syw7naMKvCv4WzRHd0nHQKLsXXxEzbYAU8TKgS3ZfwlMI+M2/MieyyGwL Tb+1CJH4lLM0mocWMTZn9S7IUr1Lg9p4Nqez0O4cWKTFTAm5TTUIdYEbxI7i/ZuANY4V dBpZoZOLlytPGXjj0Sck60958+sjEDxAhhcBBglkQuxGJZO3nj7M3LlfxMdHoWaw5Tre Nt0SEIqLv1v7o3zgIb0cc+SSOVB1v+sLmp4OKNkKUWDp5wUdjPXWWqlYgzzjUcnvSPdN EYCknm5faqRje7B/VHotcsjxPZsPY79vJxhDlR2qhiDz4vR/510c/qgcPuBzpE8x23Xw QIpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=FWeWpH1bMfMB83cZC/0mNCXV8Z9FTvnf/4pbvaq8fVc=; b=KbJ+dtVA8c4Kt4QNYQAoVexFdcZx+H95Gq4YIoMsmkC1Ozf0FMYG20M+a6ZIfBYu7M rf3C2x35ZsEKVuxViZ7cWbun7dBNdFTB3yHniFM9TTZM4JD70uBL/8LiJqkw3iML5GN7 LmrPap375+A6DwKtJREux5ZG6Mw5scnK4DZtIM29CqOSETxEKrqEsl+uB/oXOOd2XoB9 b4KodPxh9E7GaH5yk8YNyQ1ij2GyQBAJzKAaun9UkLzCONQnYzlu6aTjQEL6qffM2eY0 uGfmy2L/7eF85px725pnmLOnde3CIfOwvrWQx3Y7VzcwOgh4aip9u2sOG29U5xN/Ic46 ARBw== X-Gm-Message-State: APjAAAXGi+ufk7gPSJCGw9Ttkn4VVUiMo8kz164uA9+cJ4ObZ5MQGyx5 +pPMTdap9NYPHofOGrYtZaDOmb4qV7M= X-Google-Smtp-Source: APXvYqxLaLjOVLfFeUuOZ5NnUlTtE2y8Y26yhYwB+VtEsp+aIfxSenUdZaD3XgVeT+snNEVd6kb65w== X-Received: by 2002:a17:902:aa88:: with SMTP id d8mr12317631plr.274.1562441168441; Sat, 06 Jul 2019 12:26:08 -0700 (PDT) Received: from jdavis.lan (c-71-204-186-7.hsd1.ca.comcast.net. [71.204.186.7]) by smtp.gmail.com with ESMTPSA id j13sm11747737pgh.44.2019.07.06.12.26.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 06 Jul 2019 12:26:07 -0700 (PDT) Message-ID: <2ab176f136f0fda560f63cd091875bf21c4fe7df.camel@j-davis.com> Subject: Re: range_agg From: Jeff Davis To: Paul A Jungwirth , David Fetter Cc: Pgsql Hackers Date: Sat, 06 Jul 2019 12:26:06 -0700 In-Reply-To: References: <16d71dc8-34cf-5ebd-1ce5-ccd93c0a14f9@illuminatedcomputing.com> <20190705174531.GE24679@fetter.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 2019-07-05 at 10:57 -0700, Paul A Jungwirth wrote: > I take it that a multirange contains of *disjoint* ranges, so instead > of {[1,2), [2,3), [6,7)} you'd have {[1,3), [6,7)}. Jeff does that > match your expectation? Yes. > I just realized that since weighted_range_agg and covering_range_agg > return tuples of (anyrange, integer) (maybe other numeric types > too?), > their elements are *not ranges*, so they couldn't return a > multirange. > They would have to return an array of those tuples. I think you are right. I was originally thinking a multirange and an array of weights would work, but the multirange would coalesce adjacent ranges because it would have no way to know they have different weights. Regards, Jeff Davis