## Re: Pls Hlp: SQL Problem

From: "Fernando Hevia" "'Scott Marlowe'" "'Hengky Lie'" ,"'pgsql-sql'" Re: Pls Hlp: SQL Problem 2008-09-15 20:14:25 019001c9176f\$a5ff7200\$8f01010a@iptel.com.ar (view raw or whole thread) 2008-09-11 17:33:13 from "Ruben Gouveia"  2008-09-12 07:10:08 from "Bart Degryse"   2008-09-12 16:47:39 from "Ruben Gouveia"  2008-09-12 07:24:51 from Peter Eisentraut  2008-09-12 09:22:51 from Hengky Lie   2008-09-12 10:23:38 from Richard Huxton    2008-09-12 18:50:46 from Hengky Lie     2008-09-12 20:04:58 from "Scott Marlowe"      2008-09-12 22:01:56 from "Fernando Hevia"       2008-09-12 23:50:19 from "Scott Marlowe"        2008-09-15 20:14:25 from "Fernando Hevia"         2008-09-15 20:18:31 from "Scott Marlowe" pgsql-sql
```

> -----Mensaje original-----
> De: Scott Marlowe [mailto:scott(dot)marlowe(at)gmail(dot)com]

> >
> > Consider that if you are NOT going to use the decimals you should
> > really use integer or bigint datatypes. The numeric type
> compute much
> > slower than integer datatypes.
>
> Note that if you're just converting the output the cost is
> minimal compared to if you're doing all your math in numeric.
>  It's when you force math to happen that numeric is slower,
> but numeric's gotten a lot of tuning in the last few years
> and it's withing a few percentage
> of integer for most measurements.   Definitely not twice as slow or
> anything like they once were.
>

Well, in that case the manual should be revised.

8.1.2. Arbitrary Precision Numbers

The type numeric can store numbers with up to 1000 digits of precision and
perform calculations exactly. It is especially recommended for storing
monetary amounts and other quantities where exactness is required. However,
arithmetic on numeric values is __very slow__ compared to the integer types,
or to the floating-point types described in the next section.

Ref: http://www.postgresql.org/docs/current/static/datatype-numeric.html

The explicit "very slow" assertion scared me quite enough so to avoid
numeric types where possible.

Regards,
Fernando.

```

### pgsql-sql by date

 Next: From: Scott Marlowe Date: 2008-09-15 20:18:31 Subject: Re: Pls Hlp: SQL Problem Previous: From: Andreas Kretschmer Date: 2008-09-15 12:01:26 Subject: Re: select from two tables