Re: The speed problem of Varchar vs. Char

From: Crystal <support(at)conceptpatterns(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: The speed problem of Varchar vs. Char
Date: 2007-07-09 00:00:11
Message-ID: f6rtq4$1da7$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Josh Tolley wrote:
> On 7/8/07, Crystal <support(at)conceptpatterns(dot)com> wrote:
>
>> 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/
>>
>
> See http://www.postgresql.org/docs/8.2/interactive/datatype-character.html
> (or whatever the corresponding page is for the version you're using).
> Specifically, the following:
>
> Tip: There are no performance differences between these three types,
> apart from the increased storage size when using the blank-padded
> type. While character(n) has performance advantages in some other
> database systems, it has no such advantages in PostgreSQL. In most
> situations text or character varying should be used instead.
>
> - Josh
-- Thanks a lot. Then we will use text to represent this.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2007-07-09 00:38:35 Re: [GENERAL] Unable to get postgres running after long time no vacuum
Previous Message Tom Lane 2007-07-08 23:59:02 Re: The speed problem of Varchar vs. Char