Re: Optimizer not using index on 120M row table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jim(at)nasby(dot)net
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Optimizer not using index on 120M row table
Date: 2003-04-08 04:02:55
Message-ID: 24271.1049774575@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Jim C. Nasby" <jim(at)nasby(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2003-04-08 04:18:59 Re: Optimizer not using index on 120M row table
Previous Message Jonathan Bartlett 2003-04-08 03:55:36 Re: Why no performance boost although I added an index?