Re: CHAR vs NVARCHAR vs TEXT performance

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Rob <postgresql(at)mintsoft(dot)net>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: CHAR vs NVARCHAR vs TEXT performance
Date: 2019-04-30 17:59:26
Message-ID: CAEfWYyymHG+if1CjK6FRvv7putXbXNUn6pVPp+VZfbzGdzyVng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
> > On Tue, Apr 30, 2019 at 5:44 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> FWIW, my recommendation for this sort of thing is almost always
> >> to not use CHAR(n). The use-case for that datatype pretty much
> >> disappeared with the last IBM Model 029 card punch.
> ...
>
>
>
Perhaps the "tip" on the character datatype page (
https://www.postgresql.org/docs/11/datatype-character.html) should be
updated as the statement "There is no performance difference among these
three types..." could easily lead a reader down the wrong path. The
statement may be true if one assumes the planner is able to make an optimal
choice but clearly there are cases that prevent that. If the situation is
better explained elsewhere in the documentation then just a link to that
explanation may be all that is needed.

Cheers,
Steve

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-30 18:05:50 Re: REINDEX INDEX results in a crash for an index of pg_class since 9.6
Previous Message Peter Geoghegan 2019-04-30 17:58:31 Re: ERROR: failed to add item to the index page