From: Josh Berkus <josh@agliodbs.com>
To: Bill Moran <wmoran@potentialtech.com>
To: Jeff <threshar@torgo.978.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Fixed width rows faster?
Date: Fri, 5 Mar 2004 15:28:55 -0800
Message-ID: <200403051528.55578.josh@agliodbs.com> (raw)
In-Reply-To: <404889A6.7@potentialtech.com>
References: <E9C9F3C2-6EA9-11D8-A89E-000D9366F0C4@torgo.978.org>
<404889A6.7@potentialtech.com>
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
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, wmoran@potentialtech.com, threshar@torgo.978.org
Subject: Re: Fixed width rows faster?
In-Reply-To: <200403051528.55578.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