Re: Adjacency List or Nested Sets to model file system hierarchy? - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Adjacency List or Nested Sets to model file system hierarchy?
Date
Msg-id b42b73150702120609m48420be3ubc8df4ef5c2b79b3@mail.gmail.com
Whole thread Raw
In response to Adjacency List or Nested Sets to model file system hierarchy?  (Bill Moseley <moseley@hank.org>)
Responses Re: Adjacency List or Nested Sets to model file system hierarchy?  (Richard Broersma Jr <rabroersma@yahoo.com>)
List pgsql-general
On 2/11/07, Bill Moseley <moseley@hank.org> wrote:
> I'm looking for a little guidance in representing a file system --
> well just the file and directory structure of a file system.
>
> Often articles on representing a hierarchy discuss the advantages of
> using Nested Sets (or nested intervals) it seems.  I'm not clear how
> well they apply to a file system-like hierarchy, though.
>
> The examples (and my limited understanding) of Nested Sets have the
> leaf nodes at the end of the branches, where in a file system a node
> can have both leaf nodes (files) and branches (directories).
>
> Also, the Nested Sets seem to solve problems I don't have -- such as
> finding all descendants of a given node.
>
> My simple requirements are:
>
>     -- Quickly be able to lookup content by a full "path" name
>
>     -- Provide "directory" views that shows parent, list of contents
>        including any "sub-directories".
>
>     -- To be able to easily move branches.
>
> It will not be a large collection of "files" in the tree, so that's
> not an issue.
>
> Seems like an Adjacency List along with a de-normalized "path" column
> in the leaf nodes would meet the requirements.  But, as I see nested
> sets discussed so often I wonder which is a better approach.

Can you describe in a little bit more detail about what you mean by
'Adjaceny LIst'?

merlin

pgsql-general by date:

Previous
From: Shane Ambler
Date:
Subject: Re: getting postgres to emulate mysql/sqlserver bit datatype
Next
From: Tom Lane
Date:
Subject: Re: getting postgres to emulate mysql/sqlserver bit datatype