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 1u39Im-00BIyZ-2h for pgsql-general@arkaria.postgresql.org; Fri, 11 Apr 2025 07:59:52 +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 1u39Ik-006TVm-4Z for pgsql-general@arkaria.postgresql.org; Fri, 11 Apr 2025 07:59:50 +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 1u39Ij-006TRK-OW for pgsql-general@lists.postgresql.org; Fri, 11 Apr 2025 07:59:50 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u39Ih-004fg9-2n for pgsql-general@lists.postgresql.org; Fri, 11 Apr 2025 07:59:49 +0000 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3f8ae3ed8adso920818b6e.3 for ; Fri, 11 Apr 2025 00:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744358386; x=1744963186; 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=RR/NU4fzyRFwMAQ33PsT91TPJye+cSEeDhvgu2LTedQ=; b=G07W6oNboz+WVV5ncbIwk9Ewf9054oS2UGtP/FYbFcU0uz65XQOZXHy+loT7LlT6wi GuGL43+Q1IjqBz7f1lMPL2XfY+6ODRknsXJglYNbRPge9qQeI6SPd9or8J3UgIcZhcBw o0236CxNxz8WZ6gmBQvJCbpBvFXryAM4EUmvhjOUeVPf7IU1yQcDufQu8YCJSrY6MWfM 78k34xzg+yzy8lrerBAp2DMYC3MMfETwbic7YOZe+9KDoI3eucYeACJjeyiCDREyNo8u sHlhw8uKaBAzTciGFwWYW1iZFxvQ4bre0gE9sPd4zMXEoD/7ZFBxX9ACltMNa5HxbkX+ Xyyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744358386; x=1744963186; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RR/NU4fzyRFwMAQ33PsT91TPJye+cSEeDhvgu2LTedQ=; b=QHhv3syJ2i7xQGpMkhPkCKj6ss7JEi9G/Zt1aiBVi9JkXoMoDcmUGOUd+/ZvsW5qzP bX6GnM9AsuRX50VINxyNLaDkQTvRh3tYJpa7p5VO2EMr8ierCoOoLQveKJyHd+Sevxzn Z25IV5Flghv5jO9cLiEaS57LOiwW089EBIo++Nu0SiVsnPJVRyE3KAXEb9ucqaqmDYe3 StmQuwK1ez2qZTfJwrpEBqNg/PMyfA7ji6imKWUwVAy5VN8WFmyPL99tlIx5ZzUWrkFH D2to2XcPutEOJDiznDvSjOZhyUBKZu9/d0mdZoCNETLVpijPr1+FxRG9eUZcJTe90EK0 RR1g== X-Forwarded-Encrypted: i=1; AJvYcCXZlCjLSLCV5KztTdGsrAkPNwn0BGm+1YGe1SH8pRO9MBYuxRVLJsYXgLei9bRKDtjr0tMBe4Xd9B/FifTB@lists.postgresql.org X-Gm-Message-State: AOJu0Yx3ZGGL+AgKniALZANkpbsWFzTCfGXa0bMnOubNk+SezoC7t0O5 +6s+EkOqEJcby4RfZy+Ez/Zk8AEFBST4tXRFAlStY3X9bXzGPSCvND119Yf7wu0hRpeGOngd8yQ 03XuuEAfojnbUJDlydRQXLF5Yzy8= X-Gm-Gg: ASbGncuL0E6X0uYc6Wd/rw45z0Jrzk6PD5FpV9mwsOpLxgrN64lFL/4Paq6kdYYCter onWyDiKwPuCjNZACK9o4Pu0KWZiaGJvASr5tZZF4WD0CgE0cqmmkhl87GtcX4p3MLSEXfMO4vAk XWmNVpMGiosxL4Odcx+T0mUbra X-Google-Smtp-Source: AGHT+IEVS6Fd6x1Hfjn5arcA4+ozjmSPhiYXwsmONL5sRkDQnYAmcs35RNXotiQ4KuoWyA/+74c1PgnNhAMmhxiXloc= X-Received: by 2002:a05:6808:3197:b0:3f7:c4ee:c0c with SMTP id 5614622812f47-40085104415mr1041380b6e.38.1744358385946; Fri, 11 Apr 2025 00:59:45 -0700 (PDT) MIME-Version: 1.0 References: <662101e2-5ca5-4bf5-9307-2519efde8690@ya.ru> <8687df7d49bc4b28b41c7cf4e9ad1e15d383b2fa.camel@cybertec.at> <752812.1744343513@sss.pgh.pa.us> In-Reply-To: <752812.1744343513@sss.pgh.pa.us> From: Dominique Devienne Date: Fri, 11 Apr 2025 09:59:18 +0200 X-Gm-Features: ATxdqUHqGziV3qKOZEezw-HyW1HCClB6xCOpmBS-Keu3YoUU-ImrIxr9r3z0UP8 Message-ID: Subject: Re: Interesting case of IMMUTABLE significantly hurting performance To: Tom Lane Cc: Merlin Moncure , "David G. Johnston" , Nico Williams , Adrian Klaver , Laurenz Albe , Olleg Samoylov , "pgsql-generallists.postgresql.org" 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, Apr 11, 2025 at 5:52=E2=80=AFAM Tom Lane wrote: > Merlin Moncure writes: > > I guess the real problems here are lack of feedback on a number of fron= ts: > > *) the server knows the function is not immutable but lets you create i= t > > anyway, even though it can have negative downstream consequences > > That's debatable I think. If you know what you're doing, you're going > to be annoyed by warnings telling you that you don't. True, but that's typically what pragmas in the code are for then, to explicitly suppress warnings. Or a new option in the CREATE FUNCTION command. Better safe than sorry, and I prefer useful "on-by-default" warnings for the non-experts, which can be disabled, than silence. PS: And FWIW, I removed all attributes from the functions I'm writting, based on your aerlier advice Tom.