On Sat, Jul 5, 2008 at 4:07 AM, [email protected]
[email protected] wrote:
I ve got a table with 6 attributes which all have a two digit
Now, I am wondering if it would be better to define them as decimals
or as integers (dividing them by 100 in my app)…
If it is money, do the 100 divided by thing and store them as
integers. Floating point numbers are always approximates and never an
Are there significant performance advantages for integers…?
Not really, but most databases handle integers faster than any other
numeric type. Won’t be noticable unless you are doing thousands of
There will be lots of records in that table and I will use these
attributes for statistics.
In that case, you might need to store them as fractions, your call.
Rails, RSpec and Life blog…