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 1qRmaI-0032WZ-Qh for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Aug 2023 04:38:43 +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 1qRmaF-003Xj0-BE for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Aug 2023 04:38:39 +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.94.2) (envelope-from ) id 1qRmaF-003Xis-0x for pgsql-hackers@lists.postgresql.org; Fri, 04 Aug 2023 04:38:39 +0000 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qRmaB-000RBY-Kb for pgsql-hackers@postgresql.org; Fri, 04 Aug 2023 04:38:38 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1bbaa549bcbso1243889fac.3 for ; Thu, 03 Aug 2023 21:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691123915; x=1691728715; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NoR/P7Mv2mWlduZ16vQd1iul9EtIKRM9lLWNeoEXaOQ=; b=MBOVS3CDuoS8yfMvd3UBlbY1hrPN2xyZoNVXx67HqSl6WNVOWstckh0zxyNSPrWG9W 1yWZvG7K0IPKBofHaYxMJEPl/Ab55W2xMsK4pBRfeY3F/qPNRkAF+brKET7b1hFx64GO TkKwatG4uqi4krMkLFKge5BFLgdlXGihald49zkqU3tX4Rb8MvzOHvt13wShWWbzl+Yn 8EUwpBXTqbFAnHJtK75pky04qm2kY56zFPQOeS8Y+G1noJnJMsH+iCvXJoJqwnPmNgFU W6xZJWAnV76LKqE4ENHfAoLagOigvyqfp0M18UpMtzJlFBNS6StLxhawhFducMI5BRYW tp0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691123915; x=1691728715; 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=NoR/P7Mv2mWlduZ16vQd1iul9EtIKRM9lLWNeoEXaOQ=; b=dSnRuSuBi3D2W7REJN6rmJ2rEbECad+aklDzlsZYSTKhY/mSBEwOcxnUCmalFLSoa8 0KkwBwI87UodQnBqrmgRBEa7srZO2/NYz6sQV9zTDJb02XtPzEjgA7lJjriWz9etZ5J+ 0HuxeX8YUmx+ajKA39Kde8rvLM0y0ITC1/9rPEuwmi99eL4IbOWOTqa24BaqjMTfOzLD aTZ60XyzyK+mEG8y75DkBqvIEWJ7QhDPj4jLAsqBuDtT+eAfTGBL5ebnYmSHiE5dfii4 QhpOkN3Ag1gq9FUSFdqdVuVMLR2fi7lJDgxxYj47W3Qko+w5nfcKMbPbyC0qnSytMDgw icVw== X-Gm-Message-State: AOJu0YyWCfqwLTpewwHLoZlrZGMC2R0McOyhiLB5v/OGGVNXZf2c+tvr cWsVd+kJVrcF+CwhGu2fNyPLVxo8pvybuwaNyOw= X-Google-Smtp-Source: AGHT+IGZUSadZ/nJSQeYxsf27eB942LQRKW+DUcBC2HTw7/U6bvJO5eepbkl/D4OQ/b6dhskeM42o7QvSzmVxKMTwmY= X-Received: by 2002:a05:6870:610f:b0:1bb:7d67:a807 with SMTP id s15-20020a056870610f00b001bb7d67a807mr991772oae.51.1691123914706; Thu, 03 Aug 2023 21:38:34 -0700 (PDT) MIME-Version: 1.0 References: <3507485.1691090027@sss.pgh.pa.us> In-Reply-To: <3507485.1691090027@sss.pgh.pa.us> From: Andy Fan Date: Fri, 4 Aug 2023 12:38:23 +0800 Message-ID: Subject: Re: Extract numeric filed in JSONB more effectively To: Tom Lane Cc: Pavel Stehule , jian he , pgsql-hackers Content-Type: multipart/alternative; boundary="00000000000035179c06021178cd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000035179c06021178cd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Tom: On Fri, Aug 4, 2023 at 3:13=E2=80=AFAM Tom Lane wrote: > Andy Fan writes: > >> If you use explicit cast, then the code should not be hard, in the > >> rewrite stage all information should be known. > > > Can you point to me where the code is for the XML stuff? > > I think Pavel means XMLTABLE, which IMO is an ugly monstrosity of > syntax --- but count on the SQL committee to do it that way :-(. > Thanks for this input! > > As far as the current discussion goes, I'm strongly against > introducing new functions or operators to do the same things that > we already have perfectly good syntax for. "There's more than one > way to do it" isn't necessarily a virtue, and for sure it isn't a > virtue if people have to rewrite their existing queries to make use > of your optimization. > I agree, this is always the best/only reason I'd like to accept. > > > I do like the idea of attaching a Simplify planner support function > to jsonb_numeric (and any other ones that seem worth optimizing) > I have a study planner support function today, that looks great and I don't think we need much work to do to get our goal, that's amzing. For all the people who are interested in this topic, I will post a planner support function soon, you can check that then. --=20 Best Regards Andy Fan --00000000000035179c06021178cd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Tom:

On Fri, Aug 4, 2023 at 3:13=E2=80=AFAM Tom La= ne <tgl@sss.pgh.pa.us> wrote= :
Andy Fan <<= a href=3D"mailto:zhihui.fan1213@gmail.com" target=3D"_blank">zhihui.fan1213= @gmail.com> writes:
>> If you use explicit cast, then the code should not be hard, in the=
>> rewrite stage all information should be known.

> Can you point to me where the code is for the XML stuff?

I think Pavel means XMLTABLE, which IMO is an ugly monstrosity of
syntax --- but count on the SQL committee to do it that way :-(.

Thanks for this input!=C2=A0
=C2=A0

As far as the current discussion goes, I'm strongly against
introducing new functions or operators to do the same things that
we already have perfectly good syntax for.=C2=A0 "There's more tha= n one
way to do it" isn't necessarily a virtue, and for sure it isn'= t a
virtue if people have to rewrite their existing queries to make use
of your optimization.

I agree, this is = always the best/only reason I'd like to accept.=C2=A0
=C2=A0<= /div>


I do like the idea of attaching a Simplify planner support function
to jsonb_numeric (and any other ones that seem worth optimizing)
=C2=A0
I have a study planner support function today,= =C2=A0 that looks great and
I don't think we need much work t= o do to get our goal, that's amzing.

For all t= he people who are interested in this topic, I will post a=C2=A0
p= lanner support function soon,=C2=A0 you can check that then.

--
Best Regards
Andy F= an
--00000000000035179c06021178cd--