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 1qVo7d-001Gtv-Jc for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Aug 2023 07:05:45 +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 1qVo7b-00Bhsc-3W for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Aug 2023 07:05: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.94.2) (envelope-from ) id 1qVo7a-00BhsL-Mw for pgsql-hackers@lists.postgresql.org; Tue, 15 Aug 2023 07:05:42 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qVo7X-000ErB-JN for pgsql-hackers@postgresql.org; Tue, 15 Aug 2023 07:05:41 +0000 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6bca38a6618so4361918a34.3 for ; Tue, 15 Aug 2023 00:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692083137; x=1692687937; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zj2OEZvVQjRLbpTKiykgpBHyItVubo/VxGDnKTsZOH4=; b=famDlbapiFNx8kRpwR5f3CwETfmzmkV6M27EcW7jolKUjgOQwJKANk+TZKvrTJWrpE zvfELpQQAUYBcrvYMCSBBOt2IeCe4iJ3hyA4EN/tmW9PkozxYhnkDg2rbhiq9EOrAmv/ QNKVKR1akulgpw4PePDNBUdddzODfLJgtCCAOLG6/BiYsdO1Qm3ahF8b4Lma/8PZMvH8 5gKlw2QVAkvhQoa0DwW51kZcjmV6cBPDkTl2VpUJPNt7grbtUZxspqMG1oWP5WdwypaX TJbfcWskwmaXkNknWMUthI152P0BkeWOlQTkUEfwD9fCeACQfxY1YFdGQhL6rDZNKRjk et2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692083137; x=1692687937; 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=zj2OEZvVQjRLbpTKiykgpBHyItVubo/VxGDnKTsZOH4=; b=EN8iXHPiBKL3zQudnhNy9Z9QdhOaPlpz/tjqbDqWcNDGNwkZ6+mzx4t/mLSKaO++SH yB0hInTLpvSM7D/3rMYD7hd4Gv5EKj+sBMaqFz/XOrsMi+FIL4BOAHDF3qcAoipGmSCu GpYELVZKdznTnphLsM1ypkPG5om5yjnXDNecJw2nn3k122OQNekQNn/g/Ak5EGxh1NjT JxANkuV5UD00wsJyl6FxP9glbh1l02eIdo5j0BBhf31GvIAHhToK695jP23YmjG09SGN YoLZsBHTd93zJJjSpxtTi05XYn2PVj2L8EN0VU0PtCzwARPX9RseTxqE33IOV3PcnhJY Jbfw== X-Gm-Message-State: AOJu0Yy3EAMvznxPxNlS1my0fPmvjbi4MBDgJAj5sX1iGXEvOGX89q+b myGLdsRob7jW3AFlDnO074ipf3Dum7m64sCnuvY= X-Google-Smtp-Source: AGHT+IH6By4eYqvNTip+QKT49Vf4wUtvzX3YC9p+dbYyeRXQTtdsh8ekATFEW/U/OPK4fZgamTq2sWXfkM44wVA4Fz0= X-Received: by 2002:a05:6871:591:b0:1ad:4c06:15c with SMTP id u17-20020a056871059100b001ad4c06015cmr13377154oan.18.1692083137622; Tue, 15 Aug 2023 00:05:37 -0700 (PDT) MIME-Version: 1.0 References: <3507485.1691090027@sss.pgh.pa.us> <900892914fdc3f477b101d699efb40e0@anastigmatix.net> <903341.1692022214@sss.pgh.pa.us> In-Reply-To: From: Andy Fan Date: Tue, 15 Aug 2023 15:05:26 +0800 Message-ID: Subject: Re: Extract numeric filed in JSONB more effectively To: Pavel Stehule Cc: Tom Lane , Chapman Flack , jian he , pgsql-hackers Content-Type: multipart/alternative; boundary="0000000000005936420602f0ce9b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005936420602f0ce9b Content-Type: text/plain; charset="UTF-8" > > a) effectiveness. The ending performance should be similar like your > current patch, but without necessity to use planner support API. > So the cost is we need to create a new & different framework. > > b) because you can write only var := j->'f', and plpgsql forces cast > function execution, but not via planner. > var a := 1 needs going with planner, IIUC, same with j->'f'. c) nothing else. It should not to require to modify cast function > definitions > If you look at how the planner support function works, that is pretty simple, just modify the prosupport attribute. I'm not sure this should be called an issue or avoiding it can be described as a benefit. I don't think the current case is as bad as the other ones like users needing to modify their queries or type-safety system being broken. So personally I'm not willing to creating some thing new & heavy. However I'm open to see what others say. -- Best Regards Andy Fan --0000000000005936420602f0ce9b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


a) effectiveness. The ending performan= ce should be similar like your current patch, but without necessity to use = planner support API.
=C2=A0
So= the cost is we need to create a new & different framework.=C2=A0=C2=A0=
=C2=A0
b) because you can write only var :=3D j-&= gt;'f', and plpgsql forces cast function execution, but not via pla= nner.
=C2=A0
var a :=3D 1 need= s going with planner,=C2=A0 IIUC,=C2=A0 same with j->'f'.=C2=A0= =C2=A0

c) nothing el= se. It should not to require to modify cast function definitions
=
=C2=A0
If you look at ho= w the planner support function works,=C2=A0 that is
pretty simple= ,=C2=A0 just modify the prosupport attribute. I'm not sure
th= is should be called an issue or avoiding it can be described
as a= benefit.=C2=A0

I don't think the current case= is as bad as the other ones like
users needing to modify their q= ueries or type-safety system
being broken. So personally I'm = not willing to creating some
thing new & heavy. However I'= ;m open to see what others say.=C2=A0=C2=A0
=C2=A0
--
Best Regards
Andy Fan
--0000000000005936420602f0ce9b--