How many memory size takes numeric(3,0) ?

Started by Bruno BAGUETTEover 22 years ago3 messagesgeneral
Jump to latest
#1Bruno BAGUETTE
pgsql-ml@baguette.net

Hello,

How many memory does take numeric(3,0) ?

Is it smaller than INT2 that takes 2 octets ?

Thanks in advance :-)

---------------------------------------
Bruno BAGUETTE - pgsql-ml@baguette.net

#2Bruno Wolff III
bruno@wolff.to
In reply to: Bruno BAGUETTE (#1)
Re: How many memory size takes numeric(3,0) ?

On Wed, Sep 03, 2003 at 21:00:32 +0200,
Bruno BAGUETTE <pgsql-ml@baguette.net> wrote:

Hello,

How many memory does take numeric(3,0) ?

Is it smaller than INT2 that takes 2 octets ?

It won't be smaller than int2.

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Bruno BAGUETTE (#1)
Re: How many memory size takes numeric(3,0) ?

Bruno BAGUETTE writes:

How many memory does take numeric(3,0) ?
Is it smaller than INT2 that takes 2 octets ?

numeric(x) takes about 10 + x/2 bytes in 7.3. I'm too lazy to calculate
it exactly, but int2 surely beats numeric in storage size and it kills it
in performance. The documentation contains information about choosing the
most appropriate data type:

http://www.postgresql.org/docs/7.3/static/datatype.html#DATATYPE-NUMERIC

--
Peter Eisentraut peter_e@gmx.net