Re: Custom tuplesorts for extensions

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: Custom tuplesorts for extensions
Дата
Msg-id CAPpHfdtpkouxcLhUh5AP+MjbT1Bq1_MQzOYBDz5Z6DbL1kHELw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Custom tuplesorts for extensions  (Pavel Borisov <pashkin.elfe@gmail.com>)
Список pgsql-hackers
Hi, Pavel!

Thank you for your feedback.

On Thu, Jun 23, 2022 at 2:26 PM Pavel Borisov <pashkin.elfe@gmail.com> wrote:
>> Some PostgreSQL extensions need to sort their pieces of data. Then it
>> worth to re-use our tuplesort. But despite our tuplesort having
>> extensibility, it's hidden inside tuplesort.c. There are at least a
>> couple of examples of how extensions deal with that.
>>
>> 1. RUM table access method: https://github.com/postgrespro/rum
>> RUM repository contains a copy of tuplesort.c for each major
>> PostgreSQL release. A reliable solution, but this is not how things
>> are intended to work, right?
>> 2. OrioleDB table access method: https://github.com/orioledb/orioledb
>> OrioleDB runs on patches PostgreSQL. It contains a patch, which just
>> exposes all the guts of tuplesort.c to the tuplesort.h
>> https://github.com/orioledb/postgres/commit/d42755f52c
>>
>> I think we need a proper way to let extension re-use our core
>> tuplesort facility. The attached patchset is intended to do this the
>> right way. Patches don't revise all the comments and lack code
>> beautification. The intention behind publishing this revision is to
>> verify the direction and get some feedback for further work.
>
>
> I still have one doubt about the thing: the compatibility with previous PG versions requires me to support code paths
thatI already added into RUM extension. I won't be able to drop it from extension for quite long time in the future. It
couldbe avoided if we  backpatch this, which seems doubtful to me provided the volume of code changes. 
>
> If we just change this thing since say v16 this will only help to extensions that doesn't support earlier PG
versions.I still consider the change beneficial but wonder do you have some view on how should it be managed in
existingextensions to benefit them? 

I don't think there is a way to help extensions with earlier PG
versions. This is a significant patchset, which shouldn't be a subject
for backpatch. The existing extensions will benefit by simplification
of maintenance for PG 16+ releases. I think that's all we can do.

------
Regards,
Alexander Korotkov



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jelte Fennema
Дата:
Сообщение: Re: WIP Patch: Add a function that returns binary JSONB as a bytea
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Custom tuplesorts for extensions