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

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruno BAGUETTE <pgsql-ml(at)baguette(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How many memory size takes numeric(3,0) ?
Date: 2003-09-03 20:13:33
Message-ID: Pine.LNX.4.44.0309032208550.1035-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)gmx(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Fromm 2003-09-03 20:37:27 Re: inserting via "on insert" rule
Previous Message Jonathan Bartlett 2003-09-03 20:12:47 Re: Using oids