Re: Pls Hlp: SQL Problem - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: Pls Hlp: SQL Problem
Date
Msg-id dcc563d10809121650m5da73695n247a04ef51e68d16@mail.gmail.com
Whole thread Raw
In response to Re: Pls Hlp: SQL Problem  ("Fernando Hevia" <fhevia@ip-tel.com.ar>)
Responses Re: Pls Hlp: SQL Problem  ("Fernando Hevia" <fhevia@ip-tel.com.ar>)
List pgsql-sql
On Fri, Sep 12, 2008 at 4:01 PM, Fernando Hevia <fhevia@ip-tel.com.ar> wrote:
>
>
>> -----Mensaje original-----
>> De: pgsql-sql-owner@postgresql.org
>> [mailto:pgsql-sql-owner@postgresql.org] En nombre de Scott Marlowe
>>
>> On Fri, Sep 12, 2008 at 12:50 PM, Hengky Lie
>> <hengkyliwandouw@gmail.com> wrote:
>> > Dear Richard,
>> >
>>
>> Put parens around the whole thing, like:
>>
>> (tbltransaksi.hargapokok * tbltransaksi.keluar)::numeric(2,0) AS modal
>>
>
> 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.


pgsql-sql by date:

Previous
From: "Fernando Hevia"
Date:
Subject: Re: Pls Hlp: SQL Problem
Next
From:
Date:
Subject: selecting current UTC time