At 15:24 -0700 4/29/05, Hassan Schroeder wrote:
Harald Fuchs wrote:

I can't imagine any reason to use a type other than DECIMAL for a
currency value.

A reason could be performance. Storing cent values in an INT field is more efficient.

Are you saying that storing and/or retrieving a DECIMAL value takes appreciably more time than an INTEGER?

Before MySQL 5, DECIMAL values are stored as strings, so operations are less efficient than for integers.

In MySQL 5, the representation of DECIMAL has changed to binary format,
so it's more efficient than before.  It's probably safe to say that
integer is still a bit more efficient, but the difference between integer
and DECIMAL will be less than before.

Details:

http://dev.mysql.com/doc/mysql/en/precision-math-decimal-changes.html

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to