Skip to content

perf: store small decimal values as int #768

Description

@wangrunji0408

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions