RisingLight now uses rust_decimal to represent decimal values. However, computations on this type are relatively slow due to its large precision (96 bits) and variable scale. For small decimals, e.g. DECIMAL(15,2) in TPC-H tables, we could store and compute them as i64. This would bring a huge performance boost (considering SIMD). A potential challenge of this change is that we can no longer tell the exact value from array without its datatype. 🤔
Reference: https://duckdb.org/docs/sql/data_types/numeric#fixed-point-decimals
RisingLight now uses
rust_decimalto represent decimal values. However, computations on this type are relatively slow due to its large precision (96 bits) and variable scale. For small decimals, e.g.DECIMAL(15,2)in TPC-H tables, we could store and compute them asi64. This would bring a huge performance boost (considering SIMD). A potential challenge of this change is that we can no longer tell the exact value from array without its datatype. 🤔Reference: https://duckdb.org/docs/sql/data_types/numeric#fixed-point-decimals