[316] in Moira

home help back first fref pref prev next nref lref last post

...the members relation in the Moira database...

daemon@ATHENA.MIT.EDU (Mark Rosenstein)
Thu Jun 27 19:27:39 1991

Date: Thu, 27 Jun 91 19:16:22 -0400
From: Mark Rosenstein <mar@MIT.EDU>
To: mellon@Pa.dec.com
Cc: moira@ATHENA.MIT.EDU
In-Reply-To: Ted Lemon's message of Mon, 24 Jun 91 20:08:19 PDT <9106250308.AA01139@nigiri.pa.dec.com>

Yes, the documentation is out of date.  We renamed the members
relation to be imembers when we changed the format.  That's because it
now contains information about indirect memberships as well.  This
lets us determine in constant time if someone is a member of a list
which is a member of another list, etc.

One of the new fields is called direct, and is a boolean indicating if
this member is a direct member of the parent list or only a member
because of membership in some intermediate list.  ref_count is a count
of the number of ways a member is a member of a list.  

For instance:
	list L1 contains member M1 and member L2
	list L2 contains member M1 and member M2
The following membership records will exist:
	list L1 member M1 Direct 1 ref_count 2
	list L1 member L2 Direct 1 ref_count 1
	list L1 member M2 Direct 0 ref_count 1
	list L2 member M1 Direct 1 ref_count 1
	list L2 member M2 Direct 1 ref_count 1
In this example, M2 is an indirect member of L1, and M1 is a member of
L1 in two different ways (directly and as a member of the sub-list
L2).

The ref_counts are necessary for add_member_to_list and
delete_member_from_list to run in reasonable time.  One thing yet to
be done is to have dbck (the database consistancy checker) verify the
ref_count and indirect values.
					-Mark

home help back first fref pref prev next nref lref last post