Subject Re: Performance Penalty for String Joins?
Author ra8009
I'm in the habit (maybe a bad one) of just using VARCHAR. What is the
advantage to CHAR?

You're right about that UPC PK possibly being an issue too. I'm going
to change it. Thanks!

--- In, Helen Borrie <helebor@t...>
> At 05:21 PM 8/03/2004 +0000, you wrote:
> >I have a field that can be either a bigint or a string. It will hold a
> >UPC bar code. This field will be a primary key for the table. Is there
> >any performance penalty for joining on a string field vs a bigint?
> Not with the size you are talking about (14 chars?) But, two things:
> 1 - if the barcode comes from an external source, there is a potential
> integrity problem in using it as the PK.
> 2 - you should always use character types for barcodes - ideally
CHAR, but
> if it's possible you will need to accept different variants at some,
> VARCHAR would be better.
> /heLen