diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 9d5ce95..bef9c6c 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1106,7 +1106,7 @@ SELECT '52093.89'::money::numeric::float8; - There is no performance difference among these three types, + There is generally no performance difference among these three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While @@ -1114,9 +1114,11 @@ SELECT '52093.89'::money::numeric::float8; advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of - the three because of its additional storage costs. In most situations - text or character varying should be used - instead. + the three because of its additional storage costs, and + particularly because presently it does not take advantage of an + important optimization used when sorting. In most situations + text or character varying should be + used instead. diff --git a/doc/src/sgml/release-9.5.sgml b/doc/src/sgml/release-9.5.sgml index 279fb11..9c97b9b 100644 --- a/doc/src/sgml/release-9.5.sgml +++ b/doc/src/sgml/release-9.5.sgml @@ -214,8 +214,32 @@ - Improve the speed of sorting character and numeric fields (Peter - Geoghegan, Andrew Gierth, Robert Haas) + Improve the speed of sorting + varchar(n), text, + and numeric fields (Peter Geoghegan, Andrew + Gierth, Robert Haas) + + + + When there are multiple fields, the optimization is most + effective when most comparisons are resolved by comparing only + the first field. + + + + + + Perform inexpensive binary equality pre-check for + varchar(n) and text + comparisons (Peter Geoghegan) + + + + This improves the speed of operations where many + comparisons can be resolved with the pre-check, which may + include sort operations, merge joins, and index scans. + Multi-field sort operations with leading fields that have + relatively few distinct values will particularly benefit.