Re: Extract numeric filed in JSONB more effectively - Mailing list pgsql-hackers

From Andy Fan
Subject Re: Extract numeric filed in JSONB more effectively
Date
Msg-id CAKU4AWrGci1GyJ-WhwwT05+6hEWYuH_jFc8Vc=oNp0OzKCEDDg@mail.gmail.com
Whole thread Raw
In response to Re: Extract numeric filed in JSONB more effectively  (Andy Fan <zhihui.fan1213@gmail.com>)
Responses Re: Extract numeric filed in JSONB more effectively
List pgsql-hackers

Is there a reason not to transform the _tz flavors of
jsonb_path_query and jsonb_path-query_first?

I misunderstood the _tz flavors return timestamp,  after some deep
reading of these functions, they just work at the comparisons part.
so I will add them in the following version.  

_tz favors did return timestamp..  the reason is stated in the commit
 messge of patch 2. 

try to apply jsonb extraction optimization to  _tz functions.

both jsonb_path_query_tz and jsonb_path_query_tz_first returns
the elements which are timestamp comparable, but such elements
are impossible to be cast to numeric or boolean IIUC. Just provides
this commit for communication purpose only. 

so v14 is attached, changes include:
1. Change the typmod for internal type from 0 to -1.
2. return NULL for non-simplify expressions from the planner 
support function, hence shallow copy is removed as well.

Things are not addressed yet:
1.  the error message handling. 
2.  if we have chances to optimize _tz functions, I guess no.
3.  function naming issue. I think I can get it modified once after
all the other issues are addressed. 

--
Best Regards
Andy Fan
Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Is it possible to change wal_level online
Next
From: Ryoga Yoshida
Date:
Subject: Bug fix for psql's meta-command \ev