pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Bill Montgomery <billm@lulu.com>
To: pgsql-performance@postgresql.org
Subject: Re: Column order performance
Date: Tue, 10 Aug 2004 10:23:28 -0700
Message-ID: <200408101023.28084.josh@agliodbs.com> (raw)
In-Reply-To: <4118D008.1070606@lulu.com>
References: <4118D008.1070606@lulu.com>

Bill,

> Does the order of columns of varying size have any effect on
> SELECT/INSERT/UPDATE/and/or/DELETE performance? Take the example where
> an integer primary key is listed first in the table and alternatively
> listed after some large varchar or text columns?

No, the "order" of the columns in the table makes no difference.  They are not 
physically stored in the metadata order, anyway; on the data pages, 
fixed-length fields (e.g. INT, BOOLEAN, etc.) are stored first and 
variable-length fields (CHAR, TEXT, NUMERIC) after them, AFAIK.

The only thing I have seen elusive reports of is that *display* speed can be 
afffected by column order (e.g. when you call the query to the command line 
with many rows) but I've not seen this proven in a test case.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



view thread (3+ messages)  latest in thread

Message-ID: <200408101023.28084.josh@agliodbs.com>
Permalink:  ../200408101023.28084.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200408101023.28084.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: josh@agliodbs.com, billm@lulu.com
  Subject: Re: Column order performance
  In-Reply-To: <200408101023.28084.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox