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.96) (envelope-from ) id 1w8xOu-00136W-2d for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 09:34:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8xOs-00FqZ0-31 for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 09:34:43 +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.96) (envelope-from ) id 1w8xOs-00FqYr-25 for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2026 09:34:43 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w8xOq-00000000XDj-1tHQ for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2026 09:34:42 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4887f49ec5aso35274395e9.1 for ; Sat, 04 Apr 2026 02:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775295279; x=1775900079; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=XHgX8cPeOx7LAK0Hl62iHP+WwE4mSZDsq7YFE5RG5TI=; b=JHpiiQc9GhCgyKv1Jg7m8PQzxSKFwDsPffk8GrxRc4350HSLI7iHU+7XuKedTlzHS5 ant1FVw46GLQW6ECn9xRWv9oN+QmtydhEe6BkaX6S8qGtQSAjZTBIYoeKFsXxU4hxZAy E6smPofOB0md0pceoETWOkaTi/YCgCC/8j0v9qqSIuLsNtE+qOp0Sv5fb1zs1a6WkAXP flJatO7hlj1RXc5FIubfQMBGNeo9oMBRNhJebrlFQx5m7TSIx0mpQ0jCgJH6Aa06S5wV vW0F6rSRZYJlmhctVi0SaGmAUEDSKJAJQfvKAKuL2+S/IkZHNXvs8BsvizNLu+PtnDoR 3utw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775295279; x=1775900079; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XHgX8cPeOx7LAK0Hl62iHP+WwE4mSZDsq7YFE5RG5TI=; b=bHiM/7R3D3vfpEofy0VhCgS1/ZDhE8SjU1cdUCcXz8NzU4fLYJGfx6jNL4jdNNz9Zn ksaLKyBThx5wJ3Qz0wfLrI/0DBItifvVqwQrReyIMab1xs0svfDJJRXZ7vjwnMVjmjfA Fi45cxI13QpLJ2W/RaroNDmFG1QkdhU6E5adLWamHtBMveKTQmjC/YZH5XxyJCDhhgvF cPH6JNnytcZrlhxu/66EqDCl/6DgvnwEi0rIHk576dvQH8uHUmHqakCCHWS+yvBkNMqX PH4lcqbyKbcpxB5WGjYe5k2QBypFNB+amMYovH3hvvo6a6fW8TJaNJ8izWa5N/9si7rD Bpkw== X-Forwarded-Encrypted: i=1; AJvYcCULR7m7YfPLuFMhNBJS6FoMSniPiDFRPoc2h4JkU09lNzbjTuz/Ra5i83I+SmnQ0TxQY0G0p73lwSIo5bQg@lists.postgresql.org X-Gm-Message-State: AOJu0YytMs8+mtL2EcrkFke5UStPlDtlmraWj5cRzQadV4xu1x4LuTWm lMQ+vts2i8v84jit8gMTD3dLFjMypoZVkMEkmkEzy87ks2mzpju1oRTj X-Gm-Gg: AeBDieuOcbrHedz23Dr2UnEzKEWTORJUzGAZ/ALB/RaW4ChLJfMMdjdQXDfBl9UWgZD QRj26CAuRRVKKjfplYsvfaWMxYoQNRcwBOzwsiwAJbCFZUaPJ94K4hMnYEm8voHGXKQQ8+O2wQf qwYbclUD/gIae6/Z35OxePjC6AYUXzW3PETZsVnPo89Qe1BZQSvw5a+/h7suf97S383DWpOezMX WY2izXydEJaCU2eyX09+VKMnIEMkZ96xf5nt1VB0v5DxdQHV0YtD3P2ys1OTgvrBQApKrcWizO5 ikMGxZQ6CvjBE/erh9+ZM2+fakNmeYByUZA1l8XVjQjjmhKE1GxU2cATrZASz2U3aBeNIipQN8e jJKXO9xe3DcFskM7HeO+uptjSogFZlcXpgMLvoO3XEnWIIfIKYqCenj97V23/GXo4QoBhwiYd3d NrxFozYolTqd8xF3kSVoLhcsGotO5BTnTV/HMO X-Received: by 2002:a05:600c:3b23:b0:488:869c:edaf with SMTP id 5b1f17b1804b1-488996df052mr79474185e9.8.1775295279037; Sat, 04 Apr 2026 02:34:39 -0700 (PDT) Received: from [172.20.10.12] ([31.4.241.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4887e83682fsm338857995e9.7.2026.04.04.02.34.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Apr 2026 02:34:38 -0700 (PDT) Message-ID: <386d8c06-0f96-40bb-b1b1-107db209c676@gmail.com> Date: Sat, 4 Apr 2026 11:34:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_plan_advice To: Tom Lane , Robert Haas Cc: Alexander Lakhin , Lukas Fittl , PostgreSQL Hackers References: <3683430.1775173413@sss.pgh.pa.us> <3817825.1775240432@sss.pgh.pa.us> <3877210.1775272486@sss.pgh.pa.us> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: <3877210.1775272486@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/4/26 05:14, Tom Lane wrote: > Robert Haas writes: > The terms that I'm thinking in are "how much redesign will we accept > post-feature-freeze, in either pg_plan_advice or test_plan_advice, > before choosing to revert those modules entirely for v19?". I think > that running those tests serially is a sufficiently low-risk option > that it'd be okay to put it in post-freeze, even very long after. > I'm not sure that any of the other group-1 or group-2 options you > suggested would be okay post-freeze. (Of course, ultimately that'd > be the RMT's decision not mine.) > > I believe that we probably will need to do something in this > area before v19 release. If we're willing to commit to it being > "run the tests serially", then sure we can wait awhile before > actually doing that. Maybe we'll even think of a better idea > ... but what we can do about this post-freeze seems pretty > constrained to me. As you work on the code, please keep the pg_plan_advice issue [1] in mind. I came across it while designing the optimisation in [2]. Even if [2] is not added to the Postgres core, this still looks like a valid query plan and may be proposed by an extension. So, the hinting module should avoid conflicts with other extensions, just as pg_hint_plan does. [1] pg_plan_advice fails when NestLoop outer side is Sort over FunctionScan https://www.postgresql.org/message-id/78dd9572-7569-4025-984d-e07d7f381b6e@gmail.com [2] Try a presorted outer path when referenced by an ORDER BY prefix https://www.postgresql.org/message-id/19a9265c-c441-4a43-bc0d-dac533438da0%40gmail.com -- regards, Andrei Lepikhov, pgEdge