What is the best/fastest db2 datatype to use as a boolean flag? I'm currently using 'smallint' which uses 16 bits. Would it be faster to use a char(1) which is only 8 bits? Also, is it true that text comparisons for ‘char’ are slower then binary comparisons for ‘smallint’? If so, would that make smallint faster? Thanks…
I was always told that on a hexadecimal byte machine like OS/390, the char comparison is faster. But on an octal word machine, the binary is faster.
I know that on OS/390, binary (smallint, int) should always be stored on a half word or word boundary if possible, and that for a comparison it will be moved to such a boundary if not already on that boundary. Not sure how DB2 handles that internally.
I am not sure how it works on Unix, Linux, or Windows OS’s.