Re: Fixed width rows faster?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Bill Moran <wmoran(at)potentialtech(dot)com>, Jeff <threshar(at)torgo(dot)978(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Fixed width rows faster?
Date: 2004-03-05 23:28:55
Message-ID: 200403051528.55578.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2004-03-05 23:37:02 Re: Fixed width rows faster?
Previous Message Dennis Bjorklund 2004-03-05 14:31:44 Re: Fixed width rows faster?