Re: Using Expanded Objects other than Arrays from plpgsql - Mailing list pgsql-hackers

From Michel Pelletier
Subject Re: Using Expanded Objects other than Arrays from plpgsql
Date
Msg-id CACxu=vL4g2pPgEg66F-ttZ5jVuMba8K31vsoEYKbTJ7q6jk0hg@mail.gmail.com
Whole thread Raw
In response to Re: Using Expanded Objects other than Arrays from plpgsql  (Michel Pelletier <pelletier.michel@gmail.com>)
Responses Re: Using Expanded Objects other than Arrays from plpgsql
List pgsql-hackers


On Fri, Dec 6, 2024 at 4:51 PM Michel Pelletier <pelletier.michel@gmail.com> wrote:

 My question is about nvals = nvals(graph) in that function above, the object is flattened and then rexpanded, even after the object was expanded and returned by wait() [1] into a r/w pointer. 
... 

mxm calls expand_matrix three times for each of the three arguments.  Ideally I'd like the already expanded rw pointer from wait() to be honored by mxm so that it doesn't re-expand the object three times but, like set_element, not at all.

My bad, sorry for the long confusing email, I figured out that I was calling the wrong macro when getting my matrix datum and inadvertently expanding RO pointers as well, I've fixed that issue, and everything is working great!  No extra expansions and my support functions are working well, I need to go through a few more places in the API to add more support but otherwise the fixes Tom has put into plpgsql have worked perfectly and the library now appears to be behaving optimally!  I can get down to doing some benchmarks and head-to-head with the C and Python bindings to compare against.

Thanks for your help Tom, I'm looking forward to the changes being released soon!  In the meanwhile I'll keep a locally patched version for ongoing testing purposes.

-Michel

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Trim the heap free memory
Next
From: Andrei Lepikhov
Date:
Subject: Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table