Re: smallserial / serial2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mike Pultz" <mike(at)mikepultz(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: smallserial / serial2
Date: 2011-04-21 14:26:16
Message-ID: 9405.1303395976@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Mike Pultz" <mike(at)mikepultz(dot)com> writes:
> I use tables all the time that have sequences on smallint's;
> I'd like to simplify my create files by not having to create the sequence
> first, but I also don't want to give up those 2 bytes per column!

A sequence that can only go to 32K doesn't seem all that generally
useful ...

Are you certain that you're really saving anything? More likely than
not, the "saved" 2 bytes are going to disappear into alignment padding
of a later column or of the whole tuple. Even if it really does help
for your case, that's another reason to doubt that it's generally
useful.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2011-04-21 14:31:15 Re: hot backups: am I doing it wrong, or do we have a problem with pg_clog?
Previous Message Merlin Moncure 2011-04-21 14:05:43 Re: hot backups: am I doing it wrong, or do we have a problem with pg_clog?