Re: unsigned types

From: Neil Conway <neilc(at)samurai(dot)com>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Jeff Davis <jdavis-pgsql(at)empires(dot)org>, jeff sacksteder <jsacksteder(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: unsigned types
Date: 2005-10-18 18:00:57
Message-ID: 1129658457.8219.59.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2005-17-10 at 12:25 -0500, Jim C. Nasby wrote:
> So, if you have a bunch of int2's all next to each other in a table,
> they will happily just consume 2 bytes. The issue comes when you try
> and mix them with other fields randomly, since many other fields
> require int alignment.

We could improve on this by reordering fields on-disk to reduce
alignment/padding requirements, during CREATE TABLE. We'd need to be
sure to present the same column order back to the client application, of
course, but that should be possible. The notion of a "physical column
number" (on-disk position of the column) as well as a "logical column
numer" (position of the column in the table -- e.g. in SELECT *
expansion) would also make it easy to implement column reordering in
ALTER TABLE, which has been requested a few times.

-Neil

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-10-18 18:25:48 Re: unsigned types
Previous Message vittorio 2005-10-18 17:29:29 Number of rows of a table