tag:blogger.com,1999:blog-2328222207349876984.post7518426018959315362..comments2024-03-02T15:36:45.785-08:00Comments on SQL Tact: Real heavyweights: Float vs Decimal, the Thrilla in PrecisionUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-2328222207349876984.post-62326209991318225842015-12-17T05:45:14.778-08:002015-12-17T05:45:14.778-08:00Great analysis! I didn't know decimal compress...Great analysis! I didn't know decimal compresses more than float, but I would suspect that it may depend on what specific numbers or distribution of numbers you are storing. I had to chuckle about your caveat about 'appropriately sized' and how we had to quickly throw out real for not storing large or high-precision data. I always thought the value of float was that you don't have to accurately predict what size data you will need to store. Sometime requirements change over time and if you incorrectly size a decimal it can also cause 'catastrophic' problems. Sometimes people use float, not because they are lazy, but because they are planning for the future growth. For any number you can store in decimal, there is a larger number you can store in a float.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2328222207349876984.post-72021830874993520892014-05-01T17:03:25.590-07:002014-05-01T17:03:25.590-07:00Has any testing been done to determine the relativ...Has any testing been done to determine the relative query performance of say SUM, AVG, STDEV etc for DECIMAL v FLOAT?<br />CPU’s have hardware support for operations on REAL/FLOAT types but DECIMAL would need at least some degree of software implementation (possibly slower).<br />More generally, this discussion can be simplified to a horses-for-courses argument. Each of these types have appropriate use cases.Anonymousnoreply@blogger.com