Re: Breaking compile-time dependency cycles of Postgres subdirs?

From: Christian Convey <christian(dot)convey(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Breaking compile-time dependency cycles of Postgres subdirs?
Date: 2014-02-10 11:45:18
Message-ID: CAPfS4Zy8i=wsBQQ9Yq5Ak8LxPSq5cYBquNntY5OOGJR796ODkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 9, 2014 at 8:06 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Fri, Feb 7, 2014 at 7:39 AM, Christian Convey
> <christian(dot)convey(at)gmail(dot)com> wrote:
> > This question is mostly just curiosity...
>
> As someone very new to this code base, I think these cycles make it a
> little
> > harder to figure out the runtime and compile-time dependencies between
> the
> > subsystems these directories seem to represent. I wonder if that's a
> > problem others face as well?
>
> There are probably some cases that could be improved, but I have my
> doubts about whether eliminating cycles is a reasonable goal.
> Sometimes, two modules really do depend on each other. And, you're
> talking about this not just on the level of individual files but
> entire subtrees. There are 90,000 lines of code in src/backend/access
> (whose headers are in src/include/access) and more than 38,000 in
> src/backend/storage (whose headers are in src/include/storage);
> expecting all dependencies between those modules to go in one
> direction doesn't feel terribly reasonable. If it could be done at
> all, you'd probably end up separating code into lots of little tiny
> directories, splitting apart modules with logically related
> functionality into chunks living in entirely different parts of the
> source tree - and I don't think that would be an improvement.
>
>
Thanks Robert. IMHO, whether or not it would be beneficial depends on
which files (or definitions within files) had to be broken out into
additional subdirectories in order to break the cycles. If it could be
accomplished with at most a few additional subdirectories that were also
intuitively meaningful groupings of files/definitions, it could be a win.
But if not, I agree it would be a step backwards.

Still, I'm thinking this might be a problem we need to partially solve if
we're going to support a pluggable storage manager, particularly if we
allow a pluggable storage manager to use the system's buffer system and/or
block I/O system. I guess it depends on exactly what we want from a
pluggable storage manager.

- Christian

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-02-10 11:57:29 Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Previous Message Marti Raudsepp 2014-02-10 10:33:27 Re: PoC: Partial sort