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 1pNBz8-00012p-D9 for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Feb 2023 12:13:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pNBz7-0000Yo-C8 for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Feb 2023 12:13:05 +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 1pNBz7-0000Yb-4S for pgsql-bugs@lists.postgresql.org; Wed, 01 Feb 2023 12:13:05 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pNBz4-0002Ht-LX for pgsql-bugs@lists.postgresql.org; Wed, 01 Feb 2023 12:13:04 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 075D032006F2; Wed, 1 Feb 2023 07:12:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 01 Feb 2023 07:12:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1675253578; x=1675339978; bh=J SLOtkILACKNht/mzD/YjtXRv81u7eOvM3qWospuRDU=; b=ayOimIhTuN1bt0P/t B4VTMq/dwF5E750xvt7YOBWg9Frlyj12FxL5Vyq7oyP2FBJnY3QPX7bvhCT1tfVz boiH1ophg/XyTpCizvuYQC/4klxsEXmAXNduuPMnCr8UiLSYrG2stbzLnO6s/y0Z wl8I+Mi0mJ/CAFlnTV/FmJ24/TuZdIUxG6n+pgNNoSgDV7OSzFtpKOMhpBytQ+1u 9g5oPCwmdJMNCXG4KiS4A/xeSvYPDaiCUaWmd+831hyVf6RB/g3KyTyMAYsC5lBv 3gqZ+5nqRNtd/K7jS/arBrG1HAP9Pe3DlFvn112gYid+UKaE6eNtGcwO/yDCQBxg iGGIw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudefiedgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Feb 2023 07:12:58 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 2427E9B; Wed, 1 Feb 2023 12:57:41 +0100 (CET) Date: Wed, 1 Feb 2023 12:57:41 +0100 From: Alvaro Herrera To: David Rowley Cc: Pavel Stehule , Duncan Sands , pgsql-bugs@lists.postgresql.org Subject: Re: range_agg extremely slow compared to naive implementation in obscure circumstances Message-ID: <20230201115741.qfcjbm4jyji4etvn@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Jan-31, David Rowley wrote: > It might be better if we had multirange_canonicalize() deserialize > these once and used some representation that could more easily be > qsorted. I'm not planning on doing any work on it though. Yeah, maybe it would be possible to have an in-memory representation that doesn't require any deparsing, and keep the compact representation to be used only for in-data-page storage. How to do this within the constraints of the Datum abstraction is not clear to me. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "El sabio habla porque tiene algo que decir; el tonto, porque tiene que decir algo" (Platon).