Re: Making jsonb_agg() faster

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Making jsonb_agg() faster
Date: 2025-12-06 01:35:51
Message-ID: A8FC96CD-BA0E-43A2-A49D-B6C13030D34A@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Dec 6, 2025, at 07:14, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> v5, rebased over a couple of recent patches. No substantive changes.
>
> I'd kind of like to get this pushed soon, because it keeps getting
> sideswiped ... does anyone have further comments?

Actually I traced v4 again this week. I tried to find out something to comment, but ended up I didn’t find anything significant.

My only nit commit is still about the hard-coded 12:
```
+ case TIMETZOID:
+ /* pass-by-reference */
+ oldcontext = MemoryContextSwitchTo(outcontext);
+ v->val.datetime.value = datumCopy(v->val.datetime.value,
+ false, 12);
```

I commented this before and you explained. But I still think it may deserve a comment for why 12 is here, otherwise future reader may also get the same confusion as when I first time read this code.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Manni Wood 2025-12-06 01:39:56 Re: Speed up COPY FROM text/CSV parsing using SIMD
Previous Message Sami Imseih 2025-12-06 01:27:50 Re: [Proposal] Adding callback support for custom statistics kinds