My experience with DB2 indicates that there is nothing faster than an integer. On a lot of levels this makes sense.
On DB2/LUW versions 7 and 8, I'd built several versions of the same data warehouse using different data types as the primary keys. Joins on integer keys were at least 20% faster than all other kinds of joins.
Good Luck,
Kent
>
>
>
>I subscribe to the theory if it isn't going to be used for arthmetic, it
>shouldn't be numeric.
>
>A straight character compare operation should be the most efficient.
>
>Regards,
>Michael
>
>
>
> "Steven Cary "
> <db2udbdba-ezmlms
> hield-x72700732.x To
> [Email Address Removed] "LazyDBA Discussion"
> A.com> <[Email address protected]
> cc
> 05/22/2007 01:58
> PM Fax to
>
> Subject
> Query-efficiency of DB2 Boolean
> Options
>
>
>
>
>
>
>
>
>
>
>I understand that boolean values can be represented in db2 using either a
>SMALLINT or CHAR(1) data type.
>-- Is one option better from a query-efficiency/computational-efficiency
>perspective?
>-- If so, how much better (in percentage or just general order of
>magnitude terms)?
>What situations are there, if any, in which the answers to these two
>questions differ?
>
>Best regards,
>Steve Cary
>
>
>
>---------------------------------------------------------------------
>TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
>To post a dba job: http://jobs.lazydba.com
>To Subscribe : http://www.LazyDBA.com
>To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
>
>
>------------------------------------------------------------------------------
>This email is confidential.
>If you are not the intended recipient, please notify
>the sender by return email and delete this message
>from your mail box without reading or copying it or
>any attachments. While Lombard Canada Ltd. runs
>anti-virus software on all servers and all PCs, it
>cannot be held responsible for any infected files that
>you may receive. Lombard Canada Ltd. advises all
>recipients to virus scan any file attachments.
>==============================================================================
>
>
>
>---------------------------------------------------------------------
>TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
>To post a dba job: http://jobs.lazydba.com
>To Subscribe : http://www.LazyDBA.com
>To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
DB2 & UDB email list listserv db2-l LazyDBA home page