Re: [PERFORM] Column order performance

2004-08-10 Thread Bill Montgomery
Josh Berkus wrote:
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.
 

Is this true even after a table is altered to append say, an integer 
column, after there are already variable-length columns in the table?

-Bill
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PERFORM] Column order performance

2004-08-10 Thread Josh Berkus
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

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings