Re: int2 vs int4 in Postgres - Mailing list pgsql-performance

From Neil Conway
Subject Re: int2 vs int4 in Postgres
Date
Msg-id 1127764110.27799.2.camel@localhost.localdomain
Whole thread Raw
In response to int2 vs int4 in Postgres  ("Announce" <truthhurts@insightbb.com>)
List 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



pgsql-performance by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: int2 vs int4 in Postgres
Next
From: Chris Browne
Date:
Subject: Re: int2 vs int4 in Postgres