Moving src/backend/utils/misc/rbtree.c to src/backend/lib

Lists: pgsql-hackers
From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Moving src/backend/utils/misc/rbtree.c to src/backend/lib
Date: 2014-12-22 10:16:11
Message-ID: 5497EF6B.3090302@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Geoghegan suggested [1] moving rbtree.c to src/backend/lib, which
I think makes a lot of sense. Now that we have several other general
purpose data structures in src/backend/lib (linked lists, a binary heap,
and a pairing heap), rbtree.c would definitely be better placed in
src/backend/lib, too.

The usual objection to moving things is that it makes back-patching
harder. It also might break third-party code that use it (since
presumably we would also move the .h file). Nevertheless, I feel the
advantages outweigh the disadvantages in this case.

Any objections?

- Heikki


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Moving src/backend/utils/misc/rbtree.c to src/backend/lib
Date: 2014-12-22 15:19:48
Message-ID: 19040.1419261588@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> writes:
> Peter Geoghegan suggested [1] moving rbtree.c to src/backend/lib, which
> I think makes a lot of sense. Now that we have several other general
> purpose data structures in src/backend/lib (linked lists, a binary heap,
> and a pairing heap), rbtree.c would definitely be better placed in
> src/backend/lib, too.

> The usual objection to moving things is that it makes back-patching
> harder. It also might break third-party code that use it (since
> presumably we would also move the .h file). Nevertheless, I feel the
> advantages outweigh the disadvantages in this case.

> Any objections?

A look at the git history says that rbtree.h/.c have not been touched
(except by copyright/pgindent commits) since 9.0, so probably the
backpatch argument doesn't have much force.

However, wasn't there some speculation about removing rbtree entirely?
If we're going to end up doing that, moving the files first is just
unnecessary thrashing.

regards, tom lane


From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Moving src/backend/utils/misc/rbtree.c to src/backend/lib
Date: 2014-12-22 15:24:05
Message-ID: 54983795.8020001@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 12/22/2014 05:19 PM, Tom Lane wrote:
> However, wasn't there some speculation about removing rbtree entirely?

Not that I recall. It's still used for GIN bulk loading. There might be
better ways to do that, but there hasn't been any serious discussion on
that.

There was some discussion on replacing the existing binary heap usage
with the pairing heap, in MergeAppend and in tuplesort.c, but that's a
different story.

- Heikki


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Moving src/backend/utils/misc/rbtree.c to src/backend/lib
Date: 2014-12-22 15:44:50
Message-ID: CA+TgmobgF-D7BHBF0G-yn5w+Ug+50EwC1goYMmwhb4ZqwKTJCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Dec 22, 2014 at 5:16 AM, Heikki Linnakangas
<hlinnakangas(at)vmware(dot)com> wrote:
> Peter Geoghegan suggested [1] moving rbtree.c to src/backend/lib, which I
> think makes a lot of sense. Now that we have several other general purpose
> data structures in src/backend/lib (linked lists, a binary heap, and a
> pairing heap), rbtree.c would definitely be better placed in
> src/backend/lib, too.
>
> The usual objection to moving things is that it makes back-patching harder.
> It also might break third-party code that use it (since presumably we would
> also move the .h file). Nevertheless, I feel the advantages outweigh the
> disadvantages in this case.

I agree.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company