| From: | Aleksander Alekseev <aleksander(at)timescale(dot)com> |
|---|---|
| To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Cc: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
| Subject: | Re: Remove unused fields in ReorderBufferTupleBuf |
| Date: | 2024-01-22 14:02:03 |
| Message-ID: | CAJ7c6TOkOqmQZb2sHMK2iLjR6xHYq7wPWTd8tOKAMR1E5ZuBOg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
> > I played a bit more with the patch. There was an idea to make
> > ReorderBufferTupleBufData an opaque structure known only within
> > reorderbyffer.c but it turned out that replication/logical/decode.c
> > accesses it directly so I abandoned that idea for now.
> >
> > > Alternatively we could convert ReorderBufferTupleBufData macro to an
> > > inlined function. At least it will add some type safety.
> >
> > Here is v3 that implements it too as a separate patch.
> >
>
> But why didn't you pursue your idea of getting rid of the wrapper
> structure ReorderBufferTupleBuf which after this patch will have just
> one member? I think there could be hassles in backpatching bug-fixes
> in some cases but in the longer run it would make the code look clean.
Indeed. In fact turned out that I suggested the same above but
apparently forgot:
> On top of that IMO it doesn't make much sense to keep a one-field
> wrapper structure. Perhaps we should get rid of it entirely and just
> use HeapTupleData instead.
After actually trying the refactoring I agree that the code becomes
cleaner and it's going to be beneficial in the long run. Here is the
patch.
--
Best regards,
Aleksander Alekseev
| Attachment | Content-Type | Size |
|---|---|---|
| v4-0001-Remove-ReorderBufferTupleBuf-structure.patch | application/octet-stream | 18.2 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Melih Mutlu | 2024-01-22 14:03:28 | Re: Improve WALRead() to suck data directly from WAL buffers when possible |
| Previous Message | reid.thompson | 2024-01-22 13:58:23 | Re: [DOC] Add detail regarding resource consumption wrt max_connections |