http://bugzilla.spamassassin.org/show_bug.cgi?id=3225
------- Additional Comments From [EMAIL PROTECTED] 2004-03-28 17:34 ------- Created an attachment (id=1874) --> (http://bugzilla.spamassassin.org/attachment.cgi?id=1874&action=view) Patches for SHA1 hash as CHAR(5) and tok_get_all tests The attached patches against SVN rev 9804 (1) replace the Bayes tokens with the low order 40 bits of their SHA-1, allowing them to be stored as CHAR(5) BINARY; (2) implement a tok_get_all method to be used instead of tok_get so that all tokens in a message are selected with one query to the database. The new code is enabled by two constants in Bayes.pm use constant HASH_TOKENS_FOR_DB => 1; use constant USE_TOK_GET_ALL_OPTIMIZATION => 1; If HASH_TOKENS_FOR_DB is 1 the schema should specify that the token field in the bayes_token table is CHAR(5) BINARY. This patch defines a new SHA1 function in SHA1.pm called sha1raw that returns Digest::sha1(), i.e., the SHA1 hash in binary. I did not bother to implement the slow perl version, so testing with this requires Digest::SHA1 to be installed. If we are going to use this, someone will need to add the trivial code to call the slow perl version that we already have in SHA1.pm. I did some testing using the truncated SHA-1 hash stored as a BIGINT instead of CHAR(5), but the small improvement in speed did not seem to justify the extra disk space plus extra code needed to get a 64 bit integer into and out of the database when perl doesn't have a 64 bit int type. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.