Re: :old.clob and :new.clob in triggers

From: Mladen Gogala <gogala.mladen_at_gmail.com>
Date: Sat, 19 Jun 2010 01:51:01 +0000 (UTC)
Message-ID: <hvh7q5$9uo$4_at_news.eternal-september.org>



On Fri, 18 Jun 2010 12:10:05 -0700, Vladimir M. Zakharychev wrote:

> And in addition to what I just wrote consider this: to compute the
> hashes, you will inevitably need to fully read both LOBs. When doing
> byte-wise comparison, you stop reading and comparing at the first
> mismatch, which might be close to the beginning. So hashing and byte-
> wise comparison are equally I/O-intensive only in the worst case when
> both LOBs are of the same length and the very last byte is different, in
> other cases byte-wise comparison is cheaper.

The trick is to store MD5 sums in the same table. That way, you can compute the hash outside the database and store it together with the document. Searches and comparisons then become very fast and easy. I apologize for not elaborating properly. I do agree with everything you said. Computing MD5 hash on the fly would be suicidal.

-- 
http://mgogala.byethost5.com
Received on Fri Jun 18 2010 - 20:51:01 CDT

Original text of this message