pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
numeric data types
3+ messages / 3 participants
[nested] [flat]

* numeric data types
@ 2004-05-14 21:08 Jaime Casanova <el_vigia_ec@hotmail.com>
  2004-05-15 04:03 ` Re: numeric data types Tom Lane <tgl@sss.pgh.pa.us>
  2004-05-16 02:27 ` Re: numeric data types Neil Conway <neilc@samurai.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Jaime Casanova @ 2004-05-14 21:08 UTC (permalink / raw)
  To: pgsql-performance

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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: numeric data types
  2004-05-14 21:08 numeric data types Jaime Casanova <el_vigia_ec@hotmail.com>
@ 2004-05-15 04:03 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2004-05-15 04:03 UTC (permalink / raw)
  To: Jaime Casanova <el_vigia_ec@hotmail.com>; +Cc: pgsql-performance

"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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: numeric data types
  2004-05-14 21:08 numeric data types Jaime Casanova <el_vigia_ec@hotmail.com>
@ 2004-05-16 02:27 ` Neil Conway <neilc@samurai.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Neil Conway @ 2004-05-16 02:27 UTC (permalink / raw)
  To: Jaime Casanova <el_vigia_ec@hotmail.com>; +Cc: pgsql-performance

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-05-16 02:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-05-14 21:08 numeric data types Jaime Casanova <el_vigia_ec@hotmail.com>
2004-05-15 04:03 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-05-16 02:27 ` Neil Conway <neilc@samurai.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox