Re: Optimize JsonbContainerTypeName by reordering type checks - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: Optimize JsonbContainerTypeName by reordering type checks
Date
Msg-id 64d650e6-84bb-410b-9d1e-f9cef3f1401c@proxel.se
Whole thread Raw
In response to Re: Optimize JsonbContainerTypeName by reordering type checks  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
On 1/4/26 12:21 PM, David Rowley wrote:
> I'd say this is wishful thinking. You're saying that with the overhead
> of planning, executor startup, most of executor run and executor
> shutdown and subsequent cleanup, you're expecting a speedup from
> swapping the order of operations in this function when you're calling
> it once!? That could be true if the function was very expensive, but
> this is not an expensive function. It'll amount to a few dozen
> instructions for the function out of several 10s of millions, when you
> consider the cost of processing the entire query.

On top of this the idea the scalars are a less common thing is dubious. 
Why would that be? I would assume it depends on the input data. So even 
if it had been a speedup, which perf output does not seem to indicate 
that it would be, it would have slowed down some workloads while 
speeding up others.

Andreas





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Error position support for ComputeIndexAttrs
Next
From: Jacob Jackson
Date:
Subject: Proposal: Add a UNIQUE NOT ENFORCED constraint