Re: Decimal vs. Bigint memory usage

From: planas <jslozier(at)gmail(dot)com>
To: Gregor Vollmer <vollmer(at)ekp(dot)uni-karlsruhe(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Decimal vs. Bigint memory usage
Date: 2011-09-29 15:05:58
Message-ID: 1317308758.8331.4.camel@planas-pingy-1104
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gregor

On Thu, 2011-09-29 at 14:15 +0200, Gregor Vollmer wrote:

> Dear List,
>
> we are currently updating our application to use multiple database
> backends, the main backend on our site will be Postgres, though.
>
> Some of our columns exceed the limit of the 'integer' type, now we are
> discussing the alternatives. Personally, I would use bigint since it
> should suffice in most cases, but using decimal is under discussion,
> too, because our modules would be able to precisely specify their
> required column sizes.
>
> We do not do any arithmetic on the columns, only saving and retrieval,
> is decimal as fast as bigint in that case?
>
> How does decimal store the number internally, is it a fixed size
> through-out all rows and how does it compare to bigint?
>
> Thanks in advance,
> Gregor
>

My preference is to use bigint since you are already using integer. It
depends on what the values mean and how you use them whether decimal
could be used. Are these values used at all in any queries?

--
Jay Lozier
jslozier(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marti Raudsepp 2011-09-29 15:27:25 Re: bytea columns and large values
Previous Message Merlin Moncure 2011-09-29 13:55:11 Re: bytea columns and large values