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 1tKBNr-007KYi-E8 for pgsql-hackers@arkaria.postgresql.org; Sun, 08 Dec 2024 07:07:15 +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 1tKBMo-000vWY-HT for pgsql-hackers@arkaria.postgresql.org; Sun, 08 Dec 2024 07:06:11 +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 1tKBMn-000vWO-P1 for pgsql-hackers@lists.postgresql.org; Sun, 08 Dec 2024 07:06:11 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tKBMi-001chb-QZ for pgsql-hackers@lists.postgresql.org; Sun, 08 Dec 2024 07:06:09 +0000 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-5401e6efffcso11028e87.3 for ; Sat, 07 Dec 2024 23:06:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733641563; x=1734246363; 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=/zZgNGq13u5Um50rfyxLzvxhIjnWr5bOZ1NDcwFHzzw=; b=C2Yul8pbECmHM8pL5oASh8BX/4c7hjukMcXLcr7YauMG8SvEwFJKFCqA8/lzVnfV2c NoQm7vFi4+4oMLad0nhiZ53TMyC/grc/yXXRPCGMo1Z/2xlPjrXxmORTfDgDz4fy8m5G fWrNE9dejtOB1CMhYAxXTqt/NS7WQydqrh/aQUb74D6Ix1W2EF0rJU3aihxMiT23R5i2 DUsIqd4cAnx2JrIqjI1s5PuKIYGp0j9TSfMAkllFZ8C1j4k7UTiFMy44DyfaPahuGi93 9VF/ZmhR7nRyPjJJlq+1S+mcnhPtQkvfqKngeXcshswwIIpibDwWnmsVaOWaY3r+zlSI tpcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733641563; x=1734246363; 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=/zZgNGq13u5Um50rfyxLzvxhIjnWr5bOZ1NDcwFHzzw=; b=edYaiE/c6146GhKgLQf2eDFrry5AEcbWS64NlqpqWfPl+SfcLvZeZPJEp21oe/ptnb Dpj/C8l/S2oDScYigtKnFVonAftJ/7tmzudSDcQxL6JOqQM4HzhjPe8zZ767NcsWVklg 57g2gD6r5ZWc/kXHxhXqpQsXdix7GVVTxAJisOetDJTZeCv+kiq+bGX+RM/MfFrCLmcq pBExtBqq5REhnKmbZUIQqtZwShkSAhED5td74C2OFkoExgk+bFDS8Mzlnc+hz/RPixvC gLFOYMWUeAmWYVjCZda/BcFOHhJjSv2FikEZCwmivfMePM2dCSD5FNvo8Ilcnymk5+o3 I3jw== X-Forwarded-Encrypted: i=1; AJvYcCUlor9Wm88c70pGUmNEtFOGqFFUOG5Pc8rzKPAGN9UNEz1ZWkVJAvDK34XsEXePZyb5AfkgOxz4a4/JRRNa@lists.postgresql.org X-Gm-Message-State: AOJu0Yx5KT/HwH2dq83Mj5PKoGWtuToQ2YJ+xm84AMyRZgZ/CApUvwzj PNjGMV2NsWQvG7+bzLj9ExS+N0LBWT6Z9mKzXReH3qTgKYj/db816KHiTdc++dN9jXArr67zWku uqPt0Sb0+4MSOAfsC1vRrnVxVMKo= X-Gm-Gg: ASbGncu9nBwXVP3ri5x7HPrktQpdzA6U9f9xVVpihiDbUB7hAjhy9D72VB9h1RsO1Sl HXHolGkjVwSIYBXPoHLMEfLxHwr7kSRYg X-Google-Smtp-Source: AGHT+IHfqhfSKohp4Z8+EUVJkBUhBqxXneFhwn9doHTOGxIU/y0M1ILpHk5hPCPfI3PdNrzuWRVEyo9/vw7Zb3l8bvU= X-Received: by 2002:a05:6512:b8a:b0:53e:3a7c:c19e with SMTP id 2adb3069b0e04-53e3a7cc217mr1016558e87.29.1733641562877; Sat, 07 Dec 2024 23:06:02 -0800 (PST) MIME-Version: 1.0 References: <1342498.1729444411@sss.pgh.pa.us> <1445998.1729482404@sss.pgh.pa.us> <2062830.1729625620@sss.pgh.pa.us> <2265411.1729699470@sss.pgh.pa.us> <2354718.1729737539@sss.pgh.pa.us> <2581216.1729794746@sss.pgh.pa.us> <1948345.1730500073@sss.pgh.pa.us> <3797606.1732045516@sss.pgh.pa.us> <2234661.1733272923@sss.pgh.pa.us> In-Reply-To: From: Michel Pelletier Date: Sat, 7 Dec 2024 23:05:13 -0800 Message-ID: Subject: Re: Using Expanded Objects other than Arrays from plpgsql To: Tom Lane Cc: Pavel Stehule , pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000085f6ac0628bce11e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000085f6ac0628bce11e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 6, 2024 at 4:51=E2=80=AFPM Michel Pelletier wrote: > > My question is about nvals =3D nvals(graph) in that function above, the > object is flattened and then rexpanded, even after the object was expande= d > 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 honore= d > 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 > --00000000000085f6ac0628bce11e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


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

=C2=A0My question is about nvals= =3D nvals(graph) in that function above, the object is flattened and then = rexpanded, even after the object was expanded and returned by wait() [1] in= to a r/w pointer.=C2=A0
...=C2=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">

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

My bad, sorry for the long con= fusing 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!=C2=A0 No extra expansion= s and my support functions are working well, I need to go through a few mor= e 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 behav= ing optimally!=C2=A0 I can get down to doing some benchmarks and head-to-he= ad with the C and Python bindings to compare against.

<= div>Thanks for your help Tom, I'm looking forward to the changes being = released soon!=C2=A0 In the meanwhile I'll keep a locally patched versi= on for ongoing testing purposes.

-Michel
--00000000000085f6ac0628bce11e--