On Thu, Aug 20, 2015 at 04:07:36PM -0700, Peter Geoghegan wrote: > On Sat, Jun 13, 2015 at 3:53 PM, Peter Geoghegan <p...@heroku.com> wrote: > > I think we should really address this. Attached patch adds a new > > release note item for it. It also adds to the documentation that > > explains why users should prefer varchar(n)/text to character(n); the > > lack of abbreviated key support now becomes a huge disadvantage for > > character(n), whereas in previous versions the disadvantages were > > fairly minor. > > > > In passing, I updated the existing sort item to reflect that only > > varchar(n), text, and numeric benefit from the abbreviation > > optimization (not character types more generally + numeric), and added > > a note on the effectiveness of the abbreviation optimization alone. > > A recent e-mail from Kaigai-san [1] reminded me of this item. I really > think this limitation of char(n) needs to be documented along the > lines I proposed here back in June. Benchmarks like TPC-H use char(n) > extensively, since it's faster in other systems. However, PostgreSQL > now has hugely inferior sort performance for that type as compared to > text/varchar(n). This needs to be highlighted. > > [1] > http://www.postgresql.org/message-id/flat/CAM3SWZRRCs6KAyN-bDsh0_pG=8xm3fvcf1x9dlsvd3wvbt1...@mail.gmail.com#CAM3SWZRRCs6KAyN-bDsh0_pG=8xm3fvcf1x9dlsvd3wvbt1...@mail.gmail.com
I have applied the attached patch to document this in the data type docs. -- Bruce Momjian <br...@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml new file mode 100644 index 8113ddf..4d883ec *** a/doc/src/sgml/datatype.sgml --- b/doc/src/sgml/datatype.sgml *************** SELECT '52093.89'::money::numeric::float *** 1139,1145 **** advantages in some other database systems, there is no such advantage in <productname>PostgreSQL</productname>; in fact <type>character(<replaceable>n</>)</type> is usually the slowest of ! the three because of its additional storage costs. In most situations <type>text</type> or <type>character varying</type> should be used instead. </para> --- 1139,1146 ---- advantages in some other database systems, there is no such advantage in <productname>PostgreSQL</productname>; in fact <type>character(<replaceable>n</>)</type> is usually the slowest of ! the three because of its additional storage costs and slower ! sorting. In most situations <type>text</type> or <type>character varying</type> should be used instead. </para>
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers