Eric Soroos wrote:


Why can't you store the msg_block fingerprint in the msg_block table? Like (with mysql syntax)
CREATE TABLE messageblks (
    messageblk_idnr bigint(21) NOT NULL auto_increment,
    physmessage_id bigint(21) NOT NULL default '0',
    messageblk longtext NOT NULL,
    blocksize bigint(21) NOT NULL default '0',
===>    fingerprint bigint(21),
    PRIMARY KEY  (messageblk_idnr),
    KEY physmsg_index (physmessage_id),
===>    KEY (fingerprint),
    FOREIGN KEY (`physmessage_id`) REFERENCES `physmessage`
        (`id`) ON DELETE CASCADE
===>    UNIQUE (messageblock, fingerprint),
    ) TYPE=InnoDB;


You can. That's effectively what I was doing in my message, except that you're not seeing it in the messageblk view. You probably don't want a unique constraint on messageblk, since the idea of the fingerprint is that it's a 1:1 mapping of the messageblk down to 128 bits.

I agree with you if I had written "UNIQUE (fingerprint)", but my belief is that the combination of both keys should be unique.

/Magnus



Reply via email to