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 1u2uJi-007buM-Ub for pgsql-general@arkaria.postgresql.org; Thu, 10 Apr 2025 15:59:50 +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 1u2uJg-00DmiY-5y for pgsql-general@arkaria.postgresql.org; Thu, 10 Apr 2025 15:59:48 +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 1u2uJf-00DmiQ-RJ for pgsql-general@lists.postgresql.org; Thu, 10 Apr 2025 15:59:48 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u2uJd-004Y3r-2O for pgsql-general@lists.postgresql.org; Thu, 10 Apr 2025 15:59:47 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-72bb97260ceso344313a34.1 for ; Thu, 10 Apr 2025 08:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744300783; x=1744905583; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LKljJxrGN3ripugBRauaj44Xdmyup8NlVgCA3YJ/WFY=; b=TlADEQiyhZYaoDWQyPBUeGK4ZC6SjGbtMUimARp64m/91g0kvNot3dgfcjtOhc5GHH 9mTsc1LSwinsZ+44mHQYYDGwvJDvfuqxXo5Yb+HtLQAexhCHb+Ol1WvmsJSvqVv0+K4V olbO9RvapOzlYdVR76emU10uKI1w5GSeSAcdRcCT9V0D+HOrWr1FEpnTr9F4wKFLnBuj 8VFsFJqsPInlGoXFLOdPYswEKVbUpaAqfCSq+eCQrlaPk7PjsVY+e1XE33vgVPtfYHL3 Qvq6S7cv7dQ7+hpAhq30RV1DxxEyo8BmT9bhWSeErNU8mOoyzoD9aqEjuI55Fa34gGr7 w6xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744300783; x=1744905583; h=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=LKljJxrGN3ripugBRauaj44Xdmyup8NlVgCA3YJ/WFY=; b=ucyfphvPCF0C91+RL/SrVw1Gk4bGfwQFqSHA3kzLzQVl0X826/xT5oczbfSQMU3FKY jO0rXPXevGPsGyeMGrVsZ/GyLSQEj2czQg1dsf+EHbRc3TVCvsDZP46mS1bpnp4yzN3B FkiCg1QTrniQTl6o5qyiq+XdMpwZwh6NFhSO6ZE3qLySHR0M/yNksb+6SJXo4so75u6v XRwKLHazXKWj8CRVv1JoyY2ElYYlLvGurjypK0Nim0voJCmzX1xYM4PG/I+3DjiSVo99 izLq2J3RBVC2NzJZnyfLUfOVtmHfNqRVRheTF90nccXydSMz1PCA351mTjiOzGxxM5pL Yk6w== X-Forwarded-Encrypted: i=1; AJvYcCX1SJzsg/tPm2DFyDmUJCoIIKYUWe/OWB6JzP3QNgI0iu+UXPDJ16qv65KNo2brnQi2+mGIEnPsKXEJmoZx@lists.postgresql.org X-Gm-Message-State: AOJu0YwZSHTER+v/dTuOmnueKYmDmBSiWH5MMfroM8+BUY89QhKPOecm i5UupeebFLg3PmshjqN7rvcJCC1bs8VGPunptzpZzkbfYBPbxc8JE4lFjsxBwF2tA+aKhktN+LH IOXRNHhmAbCqt9BccnTPtFMPvR9s= X-Gm-Gg: ASbGnct89YxUL95esMI6UJkt4qkyoIniiOJZYJwFjL82lDwz6fEP5z5YEzK52oMH95t tVQnap47boHoZg9iHv7MmypCPch45zWMQeTPDQIEMI9JFHuy/KV0e9izAjoeGzl6JwP6WSC1AHJ 14l4SJlZEhbYQ07LNe9qbcbFzIrIME9Co= X-Google-Smtp-Source: AGHT+IF1/4L+EgCNFq9C4waJ4Eg8S9AFyyRkJ4pe/2yQDpZWI3eshhMHMuOKKoyy3ptMgmYwLcFisWRDfnLb4pwRHrM= X-Received: by 2002:a05:6870:cd91:b0:2c7:7317:c847 with SMTP id 586e51a60fabf-2d0b3887360mr1912156fac.33.1744300783570; Thu, 10 Apr 2025 08:59:43 -0700 (PDT) MIME-Version: 1.0 References: <662101e2-5ca5-4bf5-9307-2519efde8690@ya.ru> <8687df7d49bc4b28b41c7cf4e9ad1e15d383b2fa.camel@cybertec.at> In-Reply-To: From: "David G. Johnston" Date: Thu, 10 Apr 2025 08:59:05 -0700 X-Gm-Features: ATxdqUF6Q6yocqUqLH-G6kj_IoqeSsPeeuD8Ss1Y21xoZ0Z1Xx6GUNC7OcaPIr4 Message-ID: Subject: Re: Interesting case of IMMUTABLE significantly hurting performance To: Nico Williams Cc: Adrian Klaver , Laurenz Albe , Olleg Samoylov , "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000961fff06326eaca9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000961fff06326eaca9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 10, 2025 at 8:49=E2=80=AFAM Nico Williams wrote: > On Wed, Apr 09, 2025 at 02:43:11PM -0700, Adrian Klaver wrote: > > On 4/9/25 14:21, Nico Williams wrote: > > > That to_char is not immutable is not documented though. Though it's > > > clear when looking at the docs for the `jsonb_.*_tz()` functions. > > > > From here: > > > > https://www.postgresql.org/docs/current/catalog-pg-proc.html > > > > select proname, provolatile, prosrc from pg_proc where > proname=3D'to_char'; > > [...] > > I'm surprised to see that counted as docs, but good to know. > > Consulting pg_proc constitutes, IMO, going outside the documentation to retrieve information. It is just not high up on anyone's annoyance list to try and get this piece of information incorporated into the documentation. Partly because \df+ does show this information as well, so at least one doesn't have to go write the catalog query themself. David J. --000000000000961fff06326eaca9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Apr 10, 2025 at 8:49=E2=80=AFAM Nico Williams <= nico@cryptonector.com> wrot= e:
On Wed, Apr 09, 2025 at 02:43:= 11PM -0700, Adrian Klaver wrote:
> On 4/9/25 14:21, Nico Williams wrote:
> > That to_char is not immutable is not documented though.=C2=A0 Tho= ugh it's
> > clear when looking at the docs for the `jsonb_.*_tz()` functions.=
>
> From here:
>
> https://www.postgresql.org/docs/cur= rent/catalog-pg-proc.html
>
> select proname, provolatile, prosrc=C2=A0 from pg_proc where proname= =3D'to_char';
> [...]

I'm surprised to see that counted as docs, but good to know.


Consulting pg_proc constitutes, IMO, going outs= ide the documentation=C2=A0to retrieve information.=C2=A0 It is just not hi= gh up on anyone's annoyance list to try and get this piece of informati= on incorporated into the documentation.=C2=A0 Partly because \df+ does show= this information as well, so at least one doesn't have to go write the= catalog query themself.

David J.

--000000000000961fff06326eaca9--