Re: The speed problem of Varchar vs. Char

From: "Martin Gainty" <mgainty(at)hotmail(dot)com>
To: "Crystal" <support(at)conceptpatterns(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: The speed problem of Varchar vs. Char
Date: 2007-07-08 23:52:33
Message-ID: BAY108-DAV103F5CD9796B7BDBE6C393AE070@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Since VARCHAR length is run length encoded
and CHAR is fixed length
If your string will always be about the same size set as CHAR(MaximumLength)
otherwise use VARCHAR

M
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.

----- Original Message -----
From: "Crystal" <support(at)conceptpatterns(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Sunday, July 08, 2007 7:15 PM
Subject: [GENERAL] The speed problem of Varchar vs. Char

> Hi All,
>
> Our company need to save contact details into the PostgreSQL database. I
> just begin to learn it, so I got many questions. I am not sure which data
> type I should choose for website address, varchar or char. The website
> address may be very long, and we also don't want to lose the speed. Thus,
> the question is: if we have a large contact database, how much slowdown or
> speed up will be expected if we choose variable length rather than fixed
> length? Thanks forward.
>
> Best Wishes,
> Crystal
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-07-08 23:53:52 Re: [GENERAL] Unable to get postgres running after long time no vacuum
Previous Message Crystal 2007-07-08 23:15:04 The speed problem of Varchar vs. Char