Thread: numeric data types

numeric data types

From
"Jaime Casanova"
Date:
Hi all,

i have a question, is there any advantages in using numeric(1) or numeric(2)
in place of smallint?
is there any diff. in performance if i use smallint in place of integer?

Thanx in advance,
Jaime Casanova

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail


Re: numeric data types

From
Tom Lane
Date:
"Jaime Casanova" <el_vigia_ec@hotmail.com> writes:
> i have a question, is there any advantages in using numeric(1) or numeric(2)
> in place of smallint?

Performance-wise, smallint is an order of magnitude better.

            regards, tom lane

Re: numeric data types

From
Neil Conway
Date:
On Fri, 2004-05-14 at 17:08, Jaime Casanova wrote:
> is there any diff. in performance if i use smallint in place of integer?

Assuming you steer clear of planner deficiencies, smallint should be
slightly faster (since it consumes less disk space), but the performance
difference should be very small. Also, alignment/padding considerations
may mean that smallint doesn't actually save any space anyway.

-Neil