Re: int2 vs int4 in Postgres

From: Neil Conway <neilc(at)samurai(dot)com>
To: Announce <truthhurts(at)insightbb(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: int2 vs int4 in Postgres
Date: 2005-09-26 19:48:30
Message-ID: 1127764110.27799.2.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Chris Browne 2005-09-26 21:45:56 Re: int2 vs int4 in Postgres
Previous Message Don Isgitt 2005-09-26 19:44:42 Re: Index use in BETWEEN statement...