pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Announce <truthhurts@insightbb.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: int2 vs int4 in Postgres
Date: Mon, 26 Sep 2005 15:48:30 -0400
Message-ID: <1127764110.27799.2.camel@localhost.localdomain> (raw)
In-Reply-To: <KBEKKNMFLELKGIADDEPEGEOKCAAA.truthhurts@insightbb.com>
References: <KBEKKNMFLELKGIADDEPEGEOKCAAA.truthhurts@insightbb.com>

On Mon, 2005-26-09 at 12:54 -0500, Announce wrote:
> Is there an performance benefit to using int2 (instead of int4) in cases
> where i know i will be well within its numeric range?

int2 uses slightly less storage space (2 bytes rather than 4). Depending
on alignment and padding requirements, as well as the other columns in
the table, that may translate into requiring fewer disk pages and
therefore slightly better performance and lower storage requirements.

-Neil





view thread (6+ messages)  latest in thread

Message-ID: <1127764110.27799.2.camel@localhost.localdomain>
Permalink:  ../1127764110.27799.2.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1127764110.27799.2.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: neilc@samurai.com, truthhurts@insightbb.com
  Subject: Re: int2 vs int4 in Postgres
  In-Reply-To: <1127764110.27799.2.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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