Re: Optimizer not using index on 120M row table - Mailing list pgsql-general

From Tom Lane
Subject Re: Optimizer not using index on 120M row table
Date
Msg-id 24271.1049774575@sss.pgh.pa.us
Whole thread Raw
In response to Re: Optimizer not using index on 120M row table  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: Optimizer not using index on 120M row table  ("Jim C. Nasby" <jim@nasby.net>)
List pgsql-general
"Jim C. Nasby" <jim@nasby.net> writes:
> On Mon, Apr 07, 2003 at 11:51:17PM -0400, Tom Lane wrote:
>> or just declare project_id to be integer (hint: the space savings are
>> completely illusory in this example, anyway, because of alignment
>> requirements).

> Hrm... where can I find more info about that?

The authoritative reference is pg_type.typalign ... see
http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/catalog-pg-type.html
In this example, your next field requires integer alignment, so the
two bytes "saved" by using smallint disappear into the padding.

            regards, tom lane


pgsql-general by date:

Previous
From: Jonathan Bartlett
Date:
Subject: Re: Why no performance boost although I added an index?
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Optimizer not using index on 120M row table