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 1vxnz2-00H9kJ-39 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Mar 2026 15:17:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vxnz1-00DI95-1E for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Mar 2026 15:17:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vxnz0-00DI8w-39 for pgsql-hackers@lists.postgresql.org; Wed, 04 Mar 2026 15:17:55 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vxnyz-00000000OK6-2XfO for pgsql-hackers@lists.postgresql.org; Wed, 04 Mar 2026 15:17:54 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-b935cd1c6f3so1074041366b.3 for ; Wed, 04 Mar 2026 07:17:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772637471; cv=none; d=google.com; s=arc-20240605; b=d6Z2d70mYdCPY8MKktD/1NBpc9CaQIkrvz+5owbQpzElAtgOV9cJhK6bvslqu8i5Kk j9F8Oq6EjAffpaaPiom2uR3OxBKV7bx9pdKLLVmSyokxSkzq/CP7Mut9G2cjuzwiZZFx ppomXwXAJlWB5xEFI6VVoDoALQ5MQiq5xmevsO7YOfQXYwM1s458o6EnbAK7uLatODYa I0c3e+08FtB7jlRaXvpeuxNVT0LQRPLYwC7AjmAPA0TmN2QbiD7H2n7whLJb8Y4w9pQG /YMMXAKO8sB+2PCN79gRXvel8jop70kg08SExB9VN4CM+qcifHn05Kc95JhlxBkn4UNx XIWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eSveJ1XbRCXd/k0Js/vkQQCNJfWP8pqD4WKHCaL7cjk=; fh=ub6gmJJQGMyx3QG2Y+vtyToqHKdF+DxTtu59vkhtoVc=; b=VnX2TUrpQc188/UrZTTxuszDYqcg5lSnWukQvzoPSpva7Zl5dtr1SdKd3XkkHprMDM sGSijnonUtR9+Uc4BeV0jttuoV1ZBDE/bB8p8VZA55JYkI3GUx3teRejYvn+H/oqAnfK oztyLymc0ctKStd+NbpIscbSdK/cIfE25nS3yPPJ5uLKPCegKtItcbcs1rlGZ13VYJNC wFLuolk0FXvl6qN98Ru/IsSrLUfUtmSp4pLyE7hSGvuq+IS4kubgGzpcO+ftwTRBSeHD vUv9le9q3ksOx1MYhAa9vGoQyNLdBi7Nis9+UJX9kX2VfC+9Gg29HHyCV98c2dcvjK9Q gXVw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772637471; x=1773242271; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eSveJ1XbRCXd/k0Js/vkQQCNJfWP8pqD4WKHCaL7cjk=; b=cF7qpLaZvdG+Hs9863nlDrRo0xqO+RASMzPUINBmUQJaEMl326HvgZEy83xWlNHodB qo0YMepCbrTwJ2AxQ5dimlzY26pqtpugvmiN6dJ4luyKok2QesYeCVjj4b2VPaTxYu7m /nWq/xrioDM7XHdql6uUlK9ROh1ShuAtc86GxgcbjhQdY8OnxsfD0oQiOE9NNqsypS/E okO2rwq5b7Je3I//uogaE66v2dz2FgYmCdnd9TNsI7aXP2YuL1jD5xVEdTjwaX1eTjId 47VnKiS1sg8ul5PcMX0Q/NxQ4bgSiv1aJxfjoicnsZXCtkrx6vPkpsECOQejiw6oKu0I HVEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772637471; x=1773242271; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eSveJ1XbRCXd/k0Js/vkQQCNJfWP8pqD4WKHCaL7cjk=; b=DpCKguSOxynl2pdzmlJ4S5UClcDmIaPD2DaNOITZgOicKHEvN9FpbQcZ90zz+hBDJZ 3vHK1mgudw8gfyyqYTSQe8EMcIodNjJ17WisITNRvVIS6tDrqNF6BXYQ0tQGAe5vabJT SN5BVTNVCgD1AY8+p3wmYzd/p19htCl6HGaCYP/SGcdfnzWNYqdalpaZ3B/hqGvG973M V+51dncnFJmlVfNc/zI1607bjVQNO+HrOoQN2dec8NH92IS5kqAZIxC5DRVRUuf+lzrb lWzMqxBtSfKHu/2Gc7Dbsu5oBIb4ZPAvyz+TfCahPI/yr8lPsg38AXrIy9Ux79okY97z Phzw== X-Forwarded-Encrypted: i=1; AJvYcCWIx1lrX6Lv5i6GEiIsAGuAhP59BlHTyk3UhhoVCman0anfdXc3YTNhyMed1FD73PuVnZBOaO3/g6xG+MpW@lists.postgresql.org X-Gm-Message-State: AOJu0YyfrrM4UpjXMMQxpXK7KxvF/d8mrgXlo8lnYSsinRcYI06L0Cfs 6d0m1Cr8a1uMn7hZ09mYKFnlu6pl0Id0O6lhSipwRTdWZLCqqEJL6EyUs8Goq1yJ+bzhS043dAd Cy6wuNs8ZgH+Z7EA24Km3IZ80CoUtDKc= X-Gm-Gg: ATEYQzyG7WCTHBqTJ60GEB8TqAd6K8uSe+F1xW0FBxxARH568uNpMxOwax7RvSnDxsF wNWx7SZ3Lpq1mZURxbjI3GDKzYxzDwXugYbrqj4yFNol0Yr90Ak4TL/ghdclaoLggp20+ubDIIq qRiKOBWVOG7xGDCSJaV4j2BdaTJQZ2fKpHC39avYAZQNImv0yoL4p+y8Jot4OChrMYgqDiBZ7sn fXc0nw5aDqcCS6QB3hGNlQ/AGzgGuAe9/Ia6TZXPxgnUEcYjJgiGTbfgHTMEGEOxVF8SwTZCkPX /6ANpHLJZmRAnzxTjKqtacplZW/NA87ajIy5Z6Bzarpgseldmg== X-Received: by 2002:a17:907:1caa:b0:b87:4c37:7fd8 with SMTP id a640c23a62f3a-b93f1587651mr159177466b.49.1772637471141; Wed, 04 Mar 2026 07:17:51 -0800 (PST) MIME-Version: 1.0 References: <1136161.1769654478@sss.pgh.pa.us> In-Reply-To: From: Robert Haas Date: Wed, 4 Mar 2026 10:17:37 -0500 X-Gm-Features: AaiRm50ZwvlEvUP_Gv4-3Tcl2OrbJwc36wSsWHLxrSkoj3JolZZCw4JwghiZoow Message-ID: Subject: Re: pg_plan_advice To: "David G. Johnston" Cc: Alexandra Wang , Richard Guo , Lukas Fittl , Tom Lane , Jacob Champion , Dian Fay , Matheus Alcantara , Jakub Wartak , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Feb 27, 2026 at 8:16=E2=80=AFPM David G. Johnston wrote: > I have a mind to walk through the readmes and sgmls but its going to be i= n chunks. Here's one for the readme for pg_plan_advice with a couple of pr= eliminary sgml changes. While I'm grateful for the feedback, I feel like you tend to suggest a lot of edits that seem like they're just substituting your idiosyncratic preferences for mine e.g. writing "types of scan" vs. "scan types," or writing "additional, separate join problems" vs. "independent join problems" or "judiciously" vs. "conservatively". I don't really consider these to be improvements, nor do I necessarily think they're worse, but I just don't see the point in litigating this kind of stuff. If I've written something that is legitimately unclear, or factually incorrect, or there's a spelling or punctuation mistake, I'm happy to correct that kind of stuff, but I don't really want to go through and replace a bunch of words that I liked with a bunch of synonyms that you picked. Also, when you just provide a diff like this, it's not that clear to me why you're suggesting particular changes, which makes it hard to decide whether I agree with them. And in a lot of cases I don't. Looking at some particular examples: +isn't going to work any more. That's expected. It should be resilient to +changes in the statistics, including any CREATE STATISTICS related changes= . This is broadly true but seems a bit obvious to mention in a README. If we were going to mention it, I'd think it would go in the user-facing documentation. But I don't quite see why we should mention it at all. If plan advice couldn't override changes caused by statistics, what would even be the point of it? Also, it's not categorically true in all situations, because as discussed elsewhere, we have limitations like lack of control over aggregation strategy. Tags such as NESTED_LOOP_PLAIN specify the method that should be used to -perform a certain join. More specifically, NESTED_LOOP_PLAIN(x (y z)) says +perform a certain join - with the target appearing directly on the inner s= ide +of the join list first. Thus, NESTED_LOOP_PLAIN(x (y z)) says that the plan should put the relation whose identifier is "x" on the inner side of a plain nested loop (one without materialization or memoization) and that it should also put a join between the relation whose identifier i= s This seems like you're adding a second explanation of what the paragraph already goes onto say, except that the existing explanation is more precise and detailed. -useless in practice. It gives the planner too much freedom to do things th= at +problematic in practice. It gives the planner too much freedom to do things that I mean, I stand by the word I picked. I don't want to weaken it. -This means that if advice can say that a certain optimization or technique -should be used, it should also be able to say that the optimization or -technique should not be used. We should never assume that the absence of a= n -instruction to do a certain thing means that it should not be done; all -instructions must be explicit. +In other words, advice tags must define whether they encourage or discoura= ge +certain optimizations or techniques. (NO_GATHER is an example of the latte= r. +There is no generic "NOT" syntax, e.g., NOT(HASH_JOIN(dim2 dim4).)) My text explains an important design principle that future hackers must keep in mind when modifying this system to avoid breaking everything. Your replacement text just describes how it works today. Considering that this is a README for hackers, I think that's much worse. - advice" mini-language. It is intended to allow stabilization of plan cho= ices + advice" domain specific language (DSL). It is intended to allow stabilization of plan choices There's a debate to be had about whether it's better to say mini-language or domain specific language here, but it's hard for me to decide which is better if all you provide is a diff replacing A with B. I definitely think it's worse to write (DSL) here. There is no point in defining an acronym if we're never going to use it anywhere. --=20 Robert Haas EDB: http://www.enterprisedb.com