Re: Fixed width rows faster? - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Fixed width rows faster?
Date
Msg-id 200403051528.55578.josh@agliodbs.com
Whole thread Raw
In response to Re: Fixed width rows faster?  (Bill Moran <wmoran@potentialtech.com>)
Responses Re: Fixed width rows faster?  (Mike Nolan <nolan@gw.tssi.com>)
List pgsql-performance
Jeff, Bill:

> No.  The user docs state that the performance is equal for char, varchar
> and text.

Actually, CHAR is slightly *slower* than VARCHAR or TEXT for SELECTs in many
applications.   This is becuase of the field padding, and the frequent
necessity of casting CHAR::TEXT and back.

For INSERT and UPDATE, TEXT is the fastest becuase it's not checking a length
constraint (takes time) or padding the field out to the required CHAR length
(even more time).

Frankly, the only reason to use anything other than TEXT is compatibility with
other databases and applications.


--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


pgsql-performance by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: Fixed width rows faster?
Next
From: Josh Berkus
Date:
Subject: Re: Fixed width rows faster?