Re: CHAR vs NVARCHAR vs TEXT performance - Mailing list pgsql-hackers

From Steve Crawford
Subject Re: CHAR vs NVARCHAR vs TEXT performance
Date
Msg-id CAEfWYyymHG+if1CjK6FRvv7putXbXNUn6pVPp+VZfbzGdzyVng@mail.gmail.com
Whole thread Raw
In response to Re: CHAR vs NVARCHAR vs TEXT performance  (Rob <postgresql@mintsoft.net>)
List pgsql-hackers

> On Tue, Apr 30, 2019 at 5:44 AM Tom Lane <tgl@sss.pgh.pa.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 

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: ERROR: failed to add item to the index page
Next
From: Tom Lane
Date:
Subject: Re: REINDEX INDEX results in a crash for an index of pg_class since 9.6