Search code examples
performancet-sqlfloating-pointdecimalreal-datatype

TSQL: Which real number type results in faster comparisons


Among TSQL types (MSSQL): real, float and decimal; which type would result in faster comparisons?

Would decimal use hardaware FPU computation or is it purely in software?


Solution

  • Decimals cannot use the FPU. You get best performance with float or real which map to a standard IEEE floating point number which is supported by the FPU.

    float = double real = single

    Of course, single is faster.