Ilja:

> On Wednesday, November 19, 2003 2:32 AM Ilja Booij wrote:

> Hi,
> <snip>
> On Nov 18, 2003, at 7:46 PM, Gary Murphy wrote:
>>
>> <snip>
>> For a more radical storage saving approach we could consider storing
>> only
>> one copy of a message for all recipients within the database

> Quick question. Why remove physmessage? Can't you use it to your
> advantage here? The physmessage table already makes sure that multiple
> copies of a single  message will only be stored as messageblocks once.
> You should be able to use this to allow multiple users to use the same
> physmessage. Or is there something I'm not taking into account here?
>
> cheers,
> Ilja
I glanced at your physmessage table and thought the change would not
suffice; but I missed the fact that it points to messgeblks as well as
messages.

Yes we are basically doing the same thing.  You are using physmessage and
it's one-to-many relationship with messages and messageblks to create a
many-to-many relationship between mailboxes and messageblks.  I created the
many-to-many relationship directly by moving all user specific fields from
the messages table to a new recipients table.

I believe your choice is better, in that, it requires many less changes to
the underlying db_ methods, so I'll back mine out and proceed with yours.  I
may need one new db_ method to add a user mailbox to an existing message.
db_copymsg accomplishes this exact thing but leaves a bit of a risk that the
first recipient could potentially change some of the flags before other
users are added. The first message could, however, be protected via no
db_update_message() until all subsequent messages are added and then bulk
db_update_message()s performed, though the cost is greater than a new
method. Another option would be to provide db_copymsg with an additional
parameter meaning "new message don't copy flags".
    .... Gary .....

Reply via email to