Patent ID: 7293032

Claim:
A method for compressing a decimal type field in a database including one or more tables, each of the one or more tables including a plurality of rows, each of the plurality of rows including an instance of the decimal type field, the method comprising for each of the plurality of rows: allocating space in one of P amounts to an instance of the decimal type field in a row, the amount being chosen based on a size of a value being stored in the instance of the decimal type field, where the amount of allocated space is different for one or more of the plurality of rows than it is for one or more others of the plurality of rows, and where P is a predetermined positive integer greater than 1 representing the number of allocated space amounts allowed to be allocated for each row; setting one or more presence bits in the row to identify the amount of space allocated; and storing the value in the space allocated for the instance of the decimal type field in the row.