Skip site navigation (1) Skip section navigation (2)

Re: cyclical redundancy checksum algorithm(s)?

From: Gene Wirchenko <genew(at)ocis(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: cyclical redundancy checksum algorithm(s)?
Date: 2006-09-27 20:25:27
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
"Karen Hill" <karen_hill22(at)yahoo(dot)com> wrote:

>I just finished reading one of Ralph Kimball's books.  In it he
>mentions something called a cyclical redundancy checksum (crc)
>function.  A crc function is a hash function that generates a checksum.
>I am wondering a few things.  A crc function would be extremely useful
>and time saving in determining if a row needs to be updated or not (are
>the values the same, if yes don't update, if not update).  In fact
>Ralph Kimball states that this is a way to check for changes.  You just
>have an extra column for the crc checksum.  When you go to update data,
>generate a crc checksum and compare it to the one in the crc column.
>If they are same, your data has not changed.
>Yet what happens if there is a collision of the checksum for a row?

     Then you get told that no change has occurred when one has.  I
would call this an error.

>Ralph Kimball did not mention which algorithm to use, nor how to create
>a crc function that would not have collisions.   He does have a PhD,
>and a leader in the OLAP datawarehouse world, so I assume there is a
>good solution.

     Your error.  Having a Ph.D. does not stop someone from being

>Is there a crc function in postgresql?  If not what algorithm would I
>need to use to create one in pl/pgsql?

     I think you are focusing on irrelevant minutiae.  Is the
performance really that bad that you have go to odd lengths to up it?
If you think so, is this because you have actually tested it, or is it
just a feeling?  You could be setting yourself up for a lot of work
that may be error-prone and just plain not work and for very little.


Gene Wirchenko

Computerese Irregular Verb Conjugation:
     I have preferences.
     You have biases.
     He/She has prejudices.

In response to


pgsql-general by date

Next:From: Chris BrowneDate: 2006-09-27 20:26:12
Subject: Re: PostgreSQL HA questions
Previous:From: Tom LaneDate: 2006-09-27 20:13:34
Subject: Re: [GENERAL] Restart after power outage: createdb

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group