Several issues...
* Space -- Double is 8 bytes, the numerics are (I think) 10 and 5
bytes.
* Faster -- probably not much difference because of other overhead.
* Easier for you -- Are you ready to handle $123.4499999 ? The numerics
will keep amounts to the penny, double can drift into slight errors.
* Overflow -- a sum can overflow the numerics (if you are into gross
national products); double won't, but will start losing cents after a
few trillion dollors -- OK, so that's not a problem.
* Division, multiplication -- If you are calculating interest payments,
sales tax, etc. both schemes need help in rounding to the penny.
* Space and speed -- by the time you get this answer, disks and cpus
will be cheap enough to do it either way.
> Hi all,
> Do you know which data type is better to use to store currency values in
> SQL Anywhere? The MONEY and SMALLMONEY types are actually stored as
> NUMERIC(20,4) and NUMERIC(10,4). If I use DOUBLE, can I expect a
> improvement on large tables sum's and group by for a query?
> The SQLA server will work on Intel machines and I expect that the DOUBLE
> calculations will be much faster.
> Maybe a hint about the actual storage of double and numeric in database
> will help me to decide.
> Best regards,
> Remus