Re: Optimizer not using index on 120M row table

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

On Tue, Apr 08, 2003 at 12:02:55AM -0400, Tom Lane wrote:
> 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.

Thanks, makes sense to me now. Next question... will pgsql intelligently
order things in an item record so that they're stored most efficiently?
ie: group all the byte-align stuff together, all the 2-byte aligned
stuff, etc.? Or will it just go off of the order defined in the create
table statement? If it's the later, is there any way to re-organize
things without rebuilding the table from scratch? What other things
should be considered for column ordering?

Thanks!
--
Jim C. Nasby (aka Decibel!) jim(at)nasby(dot)net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2003-04-08 04:35:09 Re: Optimizer not using index on 120M row table
Previous Message Neil Conway 2003-04-08 04:29:00 Re: Optimizer not using index on 120M row table