Re: [HACKERS] varchar() vs char16 performance

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] varchar() vs char16 performance
Date: 1998-03-11 15:26:15
Message-ID: 199803111526.KAA17516@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> I ran some timing tests to check the performance of varchar() vs char16.
> The results of the test indicate that there is no difference in
> performance (within the timing scatter of the tests):
>
> char16 vc(16)
> 0.99s 1.05s 1 row (this measures startup time, not types)
> 39.29s 39.28s ~65000 rows
>
> The char2,4,8,16 types seem to have no value-added over the
> better-supported char(), varchar(), text types; I am considering
> removing them from the backend, and instead have the parser
> transparently translate the types into varchar() (or char() - I'm not
> certain which is a better match for the types) for v6.4. Applications
> would not have to be changed.

Fine, remove them. You may want to keep 'char' because of the reduced
overhead compared to char(1), but the others certainly can be removed.
Seems like you have not mentioned char, so you may no intension of
removing it.

I would map to char(). They are fixed size, and the old types were
fixed size too. I know char16 may be better for varchar(), but that is
not as clean a translation from the old type.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas 1998-03-11 15:30:17 AW: [HACKERS] varchar() vs char16 performance
Previous Message Bruce Momjian 1998-03-11 15:20:35 Re: [HACKERS] attlen weirdness?