Re: Using Expanded Objects other than Arrays from plpgsql

2025-01-21 Thread Michel Pelletier
On Wed, Jan 15, 2025 at 10:09 AM Tom Lane wrote: > I noticed that v2 of this patch series failed to apply after > 7b27f5fd3, so here's v3. No non-trivial changes. > Thanks Tom! These applied cleanly to my test env and actually increased my livejournal graph benchmark by a million edges per sec

Re: Using Expanded Objects other than Arrays from plpgsql

2025-01-04 Thread Michel Pelletier
On Sat, Jan 4, 2025 at 11:35 AM Tom Lane wrote: > Michel Pelletier writes: > > I've circled back on this task to do some work improving the skeleton > code, > > but going back through our thread I landed on this point Tom made about > > usefulness vs pure skeleto

Re: Using Expanded Objects other than Arrays from plpgsql

2025-01-04 Thread Michel Pelletier
On Tue, Nov 19, 2024 at 11:45 AM Tom Lane wrote: > Pavel Stehule writes: > > út 19. 11. 2024 v 18:51 odesílatel Michel Pelletier < > > pelletier.mic...@gmail.com> napsal: > >> A couple years ago I tried to compress what I learned about expanded > >> o

Re: Using Expanded Objects other than Arrays from plpgsql

2024-12-25 Thread Michel Pelletier
On Mon, Dec 23, 2024 at 8:26 AM Tom Lane wrote: > Michel Pelletier writes: > > ... > > I agree it makes sense to have more use cases before making deeper > > changes. I only work with expanded forms, but need to call wait() to > > pre-expand the object to a

Re: Using Expanded Objects other than Arrays from plpgsql

2024-12-22 Thread Michel Pelletier
On Wed, Dec 18, 2024 at 12:22 PM Tom Lane wrote: > Michel Pelletier writes: > > 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

Re: Using Expanded Objects other than Arrays from plpgsql

2024-12-07 Thread Michel Pelletier
On Fri, Dec 6, 2024 at 4:51 PM Michel Pelletier 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 call

Re: Using Expanded Objects other than Arrays from plpgsql

2024-12-06 Thread Michel Pelletier
On Tue, Dec 3, 2024 at 4:42 PM Tom Lane wrote: > Michel Pelletier writes: > > Here's a WIP patch for a pgexpanded example in src/test/modules. > > I didn't look at your patch yet, but in the meantime here's an update > that takes the next step towards what

Re: Code cleanup for detoast a expanded datum.

2024-12-01 Thread Michel Pelletier
On Mon, Nov 18, 2024 at 7:42 PM Andy Fan wrote: > Andy Fan writes: > > > > > make check-world passed after applying this patch. > > v2 changes the places of Assert, which is missed in v1 by mistakes. > I'm not an expert in this end of the code but it looks correct to me, my only comment would b

Re: Using Expanded Objects other than Arrays from plpgsql

2024-11-24 Thread Michel Pelletier
On Tue, Nov 19, 2024 at 12:52 PM Michel Pelletier < pelletier.mic...@gmail.com> wrote: > On Tue, Nov 19, 2024 at 11:45 AM Tom Lane wrote: > >> Pavel Stehule writes: >> > another position can be src/test/modules - I think so your example is >> > "simila

Re: Using Expanded Objects other than Arrays from plpgsql

2024-11-19 Thread Michel Pelletier
On Tue, Nov 19, 2024 at 11:45 AM Tom Lane wrote: > Pavel Stehule writes: > > út 19. 11. 2024 v 18:51 odesílatel Michel Pelletier < > > pelletier.mic...@gmail.com> napsal: > >> A couple years ago I tried to compress what I learned about expanded > >> o

Re: Using Expanded Objects other than Arrays from plpgsql

2024-11-19 Thread Michel Pelletier
> > > So going back on the assumption I'm somehow not returning the right > pointer, but digging into the array code I'm pretty sure I'm following the > same pattern and tracing my code path is calling EOHPGetRWDatum when I > return the object, I can't get it to stop on DeleteExpandedObject, so I >

Re: Using Expanded Objects other than Arrays from plpgsql

2024-11-11 Thread Michel Pelletier
> > The second expansion in matrix_out happens outside the function, so inside > there is only the one expansion for both matrix_nvals and the assignment. > Thank you! All my tests continue to pass and the change seems to work well. Hmm, well I spoke to soon looking at the wrong function without

Re: Using Expanded Objects other than Arrays from plpgsql

2024-11-11 Thread Michel Pelletier
On Fri, Nov 1, 2024 at 5:53 PM Michel Pelletier wrote: > On Fri, Nov 1, 2024 at 3:27 PM Tom Lane wrote: > >> Michel Pelletier writes: >> >> Here is a v1 patch series that does the first part of what we've been >> talking about, which is to implement the new o

Re: Using Expanded Objects other than Arrays from plpgsql

2024-11-01 Thread Michel Pelletier
On Fri, Nov 1, 2024 at 3:27 PM Tom Lane wrote: > Michel Pelletier writes: > > Here is a v1 patch series that does the first part of what we've been > talking about, which is to implement the new optimization rule for > the case of a single RHS reference to the target variabl

Re: Using Expanded Objects other than Arrays from plpgsql

2024-11-01 Thread Michel Pelletier
On Fri, Nov 1, 2024 at 3:20 PM Tom Lane wrote: > Michel Pelletier writes: > > Well, you shouldn't be using PERFORM. Not only does it not do the > right thing, but it's not optimized for expanded objects at all: > they'll get flattened both on the way into the

Re: Using Expanded Objects other than Arrays from plpgsql

2024-10-31 Thread Michel Pelletier
On Thu, Oct 24, 2024 at 11:32 AM Tom Lane wrote: > I wrote: > > ... I'm still writing up > > details, but right now I'm envisioning completely separate sets of > > rules for the prosupport case versus the no-prosupport case. > > So here is the design I've come up with for optimizing R/W expanded

Re: Using Expanded Objects other than Arrays from plpgsql

2024-10-31 Thread Michel Pelletier
volatility with expanded objects, nvals is STRICT, but set_element is STABLE. I think my logic there was because it's a mutation. This is likely another misunderstanding of mine. -Michel On Wed, Oct 23, 2024 at 7:10 PM Tom Lane wrote: > Michel Pelletier writes: > > On Wed, Oct

Re: Using Expanded Objects other than Arrays from plpgsql

2024-10-23 Thread Michel Pelletier
On Wed, Oct 23, 2024 at 9:04 AM Tom Lane wrote: > I wrote: > > One idea I was toying with is that it doesn't matter if f() > > throws an error so long as the plpgsql function is not executing > > within an exception block: if the error propagates out of the plpgsql > > function then we no longer

Re: Using Expanded Objects other than Arrays from plpgsql

2024-10-23 Thread Michel Pelletier
On Wed, Oct 23, 2024 at 8:21 AM Tom Lane wrote: > Michel Pelletier writes: > > Here's another example: > > > CREATE OR REPLACE FUNCTION test2(graph matrix) > > RETURNS bigint LANGUAGE plpgsql AS > > $$ > > BEGIN > > perform set_elem

Re: Using Expanded Objects other than Arrays from plpgsql

2024-10-22 Thread Michel Pelletier
On Tue, Oct 22, 2024 at 12:33 PM Tom Lane wrote: > Michel Pelletier writes: > But now we also have > expanded records, and with your use-case as an example of an extension > trying to do similar things, I feel like we have enough examples to > move forward. > Great! As

Re: Using Expanded Objects other than Arrays from plpgsql

2024-10-21 Thread Michel Pelletier
On Sun, Oct 20, 2024 at 8:46 PM Tom Lane wrote: > Michel Pelletier writes: > > On Sun, Oct 20, 2024 at 10:13 AM Tom Lane wrote: > (from thread https://www.postgresql.org/message-id/CACxu%3DvJaKFNsYxooSnW1wEgsAO5u_v1XYBacfVJ14wgJV_PYeg%40mail.gmail.com ) > >> But it se

Re: Make EXPLAIN generate a generic plan for a parameterized query

2022-12-27 Thread Michel Pelletier
On Wed, Dec 7, 2022 at 3:23 AM Laurenz Albe wrote: > On Tue, 2022-12-06 at 10:17 -0800, Andres Freund wrote: > > On 2022-10-29 10:35:26 +0200, Laurenz Albe wrote: > > > > > Here is a patch that > > > > > implements it with an EXPLAIN option named GENERIC_PLAN. > > > > This fails to build the docs

Re: Proposal to use JSON for Postgres Parser format

2022-10-31 Thread Michel Pelletier
On Mon, Oct 31, 2022 at 6:15 AM Matthias van de Meent < boekewurm+postg...@gmail.com> wrote: > On Mon, 31 Oct 2022 at 13:46, Alexander Korotkov > wrote: > > On Fri, Oct 28, 2022 at 4:27 PM Andrew Dunstan > wrote: > >> On 2022-10-27 Th 19:38, Andres Freund wrote: > >> > Hi, > >> > > >> > On 2022-

Re: Proposal to use JSON for Postgres Parser format

2022-10-27 Thread Michel Pelletier
On Wed, Sep 21, 2022 at 11:04 AM Matthias van de Meent < boekewurm+postg...@gmail.com> wrote: > On Tue, 20 Sept 2022 at 17:29, Alvaro Herrera > wrote: > > > > On 2022-Sep-20, Matthias van de Meent wrote: > > > > > Allow me to add: compressability > > > > > > In the thread surrounding [0] there we

Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Michel Pelletier
Hello hackers, As noted in the source: https://github.com/postgres/postgres/blob/master/src/include/nodes/pg_list.h#L6-L11 * Once upon a time, parts of Postgres were written in Lisp and used real * cons-cell lists for major data structures. When that code was rewritten * in C, we initially h

Re: PATCH: Add Table Access Method option to pgbench

2022-07-12 Thread Michel Pelletier
On Thu, 30 Jun 2022 at 18:09, Michael Paquier wrote: > On Fri, Jul 01, 2022 at 10:06:49AM +0900, Michael Paquier wrote: > > And the conclusion back then is that one can already achieve this by > > using PGOPTIONS: > > PGOPTIONS='-c default_table_access_method=wuzza' pgbench [...] > > > > So there

Re: PATCH: Add Table Access Method option to pgbench

2022-06-30 Thread Michel Pelletier
I've got CI setup and building and the tests now pass, I was missing a CASCADE in my test. New patch attached: On Thu, 30 Jun 2022 at 10:50, Michel Pelletier wrote: > On Thu, 30 Jun 2022 at 09:51, Justin Pryzby wrote: > >> On Thu, Jun 30, 2022 at 09:09:17AM -0700, Miche

Re: PATCH: Add Table Access Method option to pgbench

2022-06-30 Thread Michel Pelletier
On Thu, 30 Jun 2022 at 09:51, Justin Pryzby wrote: > On Thu, Jun 30, 2022 at 09:09:17AM -0700, Michel Pelletier wrote: > > This change was originally authored by Alexander Korotkov, I have updated > > it and added a test to the pgbench runner. I'm hoping to make the >

PATCH: Add Table Access Method option to pgbench

2022-06-30 Thread Michel Pelletier
Hello! This patch adds a `--tableam=TABLEAM` option to the pgbench command line which allows the user to specify which table am is used to create tables initialized with `-i`. This change was originally authored by Alexander Korotkov, I have updated it and added a test to the pgbench runner. I'm

Re: Proposal for adding an example "expanded" data type to contrib

2021-11-08 Thread Michel Pelletier
On Mon, Nov 8, 2021 at 8:07 AM Alvaro Herrera wrote: > On 2021-Nov-08, Michel Pelletier wrote: > > > I posted this last week to psql-general, and Pavel Stehule suggested it > > would be a good candidate for inclusion in the contrib collection and > that > > I write t

Proposal for adding an example "expanded" data type to contrib

2021-11-08 Thread Michel Pelletier
Hello, Expanded data types (types that have a different in-memory working representation than on disk) are pretty essential to a couple of projects that I work on, and while the prose documentation is great at explaining the rationale and technical overview, there isn't a complete, self-contained,