In PostgresQL, there are 2 kinds of decimal (or numeric) types:
NUMERIC(precision, scale) means all data in such columns are of specified precision & scale. In this case we can only store a 'flatten' integer in array or storage because the position of dot is fixed.
NUMERIC means data in such columns are with variable precision & scale. In such case, precision & scale must be kept along with the 'flatten' integer.
Currently, we only support fixed-point decimals, but considering that we are going to support schemaless in the future, it's better to support dynamic-precision decimals.
Order-preserved encoding of dynamic-precision decimals is difficult. I would recommend to investigate on cockroachdb first before implementation.
In PostgresQL, there are 2 kinds of decimal (or numeric) types:
NUMERIC(precision, scale)
means all data in such columns are of specified precision & scale. In this case we can only store a 'flatten' integer in array or storage because the position of dot is fixed.NUMERIC
means data in such columns are with variable precision & scale. In such case, precision & scale must be kept along with the 'flatten' integer.Currently, we only support fixed-point decimals, but considering that we are going to support schemaless in the future, it's better to support dynamic-precision decimals.
Order-preserved encoding of dynamic-precision decimals is difficult. I would recommend to investigate on cockroachdb first before implementation.
References: