Re: Making jsonb_agg() faster - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Making jsonb_agg() faster
Date
Msg-id 617666.1755277022@sss.pgh.pa.us
Whole thread Raw
In response to Re: Making jsonb_agg() faster  (jian he <jian.universality@gmail.com>)
Responses Re: Making jsonb_agg() faster
List pgsql-hackers
jian he <jian.universality@gmail.com> writes:
> outcontext will always be NULL in 0001.
> that means copyScalarSubstructure is never really called.
> it also means that JsonbInState->MemoryContext  was always as NULL in 00001
> maybe we don't need JsonbInState->MemoryContext in 0001
> So 0001 refactoring change would be less invasive.

I think you're missing the point: per the commit message for 0001,

    The real reason for doing it is to provide a mechanism whereby
    pushJsonbValue() can be told to construct the JsonbValue tree
    in a context that is not CurrentMemoryContext.  That happens
    when a non-null "outcontext" is specified in the JsonbInState.
    No callers exercise that option in this patch, but the next
    patch in the series will make use of it.

If we didn't add the outcontext option in this step, we'd just
have to do so in the next one.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Benoit T
Date:
Subject: Re: pg_stat_statements: Add `calls_aborted` counter for tracking query cancellations
Next
From: Andres Freund
Date:
Subject: Re: index prefetching