Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1taeKC-003pE1-E5 for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jan 2025 17:15:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1taeK9-002Otn-Ou for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jan 2025 17:15:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1taeK9-002OrH-F8 for pgsql-hackers@lists.postgresql.org; Wed, 22 Jan 2025 17:15:29 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1taeK6-000wdL-1y for pgsql-hackers@postgresql.org; Wed, 22 Jan 2025 17:15:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 50MHFNRP3937317; Wed, 22 Jan 2025 12:15:23 -0500 From: Tom Lane To: Alexander Kuzmenkov cc: Alvaro Herrera , pgsql-hackers@postgresql.org Subject: Re: Quadratic planning time for ordered paths over partitioned tables In-reply-to: References: <202501221636.mynlx5r3tba4@alvherre.pgsql> Comments: In-reply-to Alexander Kuzmenkov message dated "Wed, 22 Jan 2025 17:50:37 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3937315.1737566123.1@sss.pgh.pa.us> Date: Wed, 22 Jan 2025 12:15:23 -0500 Message-ID: <3937316.1737566123@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Kuzmenkov writes: > Yeah, I'm referencing this one in my email, but it's a series of > patches that does a major refactoring changing thousands of lines. I'm > not sure when or if it's going to land, do you think applying a quick > fix first would make sense? It makes trivial changes in one function. That "quick fix" seems extremely horrid: since there's only one static cache variable for all ECs, it's going to help only one very specific call pattern, which could easily get broken by unrelated changes. Also, maybe my performance instincts are rooted in old hardware, but I don't trust integer division with a variable divisor to be cheap. So ISTM this could as easily make things worse as better. If you offered something that was less obviously a kluge, maybe we could use it. Really I'd think the right place to be fixing this is at a higher level. Where are the repetitive find_ec_member_matching_expr calls coming from? regards, tom lane