Joined: 11 Jan 2006 Posts: 49 Location: Lower Saxony (DE)

Posted: Mon Jan 28, 2013 5:24 pm Post subject: generated Identity-PK: BIGINT or DECIMAL(18)

The tables for which I am responsible are defined with a generated identity-pk and most of them in Decimal(18) format.
What would you recommend, is better to use?
I suppose BigInt is similar to COBOL-Binary and Decimal is similar to COBOL-Display?
Than I guess BigInt requires much less storage space in table- and in indexspace as well.
Furthermore, I suspect that it's faster to compute new BigInt- than Decimal identities - similar to COBOL - because decimal values need to be converted in binary format.
Am I right? Do you agree with that?
Thanks a lot for your help

Posted: Mon Jan 28, 2013 5:35 pm Post subject: Reply to: generated Identity-PK: BIGINT or DECIMAL(18)

You need to know whether DECIMAL would be "internal" (packed) or "external" (zoned).

Why do you believe that Cobol would change decimals to binary to do arithmetic? There are specific decimal-arithmetic machine instructions.

An 18-digit binary is enormously far from "faster" compared to an 18-digit packed-decimal, which I'd avoid using anyway, if possible, as 17 digits are "faster".