Go to file
Nathan Bossart dc3f9bc549 Micro-optimize JSONTYPE_NUMERIC code path in json.c.
This commit does the following:

* In datum_to_json_internal(), the call to IsValidJsonNumber() is
  replaced with simplified validation code.  This avoids an extra
  call to strlen() in this path, and it avoids validating the
  entire string (which is okay since we know we're dealing with a
  numeric data type's output).

* In datum_to_json_internal(), the call to escape_json() in the
  JSONTYPE_NUMERIC path is replaced with code that just surrounds
  the string with quotes.  In passing, some other nearby calls to
  appendStringInfo() have been replaced with similar code to avoid
  unnecessary calls to vsnprintf().

* In composite_to_json(), the length of the separator is now
  determined at compile time to avoid unnecessary calls to
  strlen().

On my machine, this speeds up a benchmark for the proposed COPY TO
(FORMAT json) command with many integers by upwards of 20%.  There
are likely other code paths that could be given a similar
treatment, but that is left as a future exercise.

Reviewed-by: Jeff Davis, Tom Lane, David Rowley, John Naylor
Discussion: https://postgr.es/m/20231207231251.GB3359478%40nathanxps13
2023-12-08 13:39:08 -06:00
config Remove distprep 2023-11-06 15:18:04 +01:00
contrib Optimize nbtree backward scan boundary cases. 2023-12-08 11:05:17 -08:00
doc Allow parallel CREATE INDEX for BRIN indexes 2023-12-08 18:15:26 +01:00
src Micro-optimize JSONTYPE_NUMERIC code path in json.c. 2023-12-08 13:39:08 -06:00
.cirrus.star Remove duplicate words in docs and code comments. 2023-10-09 09:18:47 +05:30
.cirrus.tasks.yml Use "template" data directory in tests 2023-08-24 14:38:02 -07:00
.cirrus.yml ci: Make compute resources for CI configurable 2023-08-23 15:15:28 -07:00
.dir-locals.el Make Emacs perl-mode indent more like perltidy. 2019-01-13 11:32:31 -08:00
.editorconfig Add .editorconfig 2019-12-18 09:13:13 +01:00
.git-blame-ignore-revs Add "Add trailing commas to enum definitions" to .git-blame-ignore-revs 2023-10-26 13:03:43 +02:00
.gitattributes Replace Gen_dummy_probes.sed with Gen_dummy_probes.pl 2023-11-14 10:27:10 +01:00
.gitignore Update top-level .gitignore. 2022-12-04 15:23:00 -05:00
COPYRIGHT Update copyright for 2023 2023-01-02 15:00:37 -05:00
GNUmakefile.in Remove distprep 2023-11-06 15:18:04 +01:00
HISTORY Canonicalize some URLs 2020-02-10 20:47:50 +01:00
Makefile Dynamically find correct installation docs in Makefile. 2022-01-19 14:48:25 +01:00
README README: remove duplicate download link & mention related softw. 2023-11-08 16:36:18 -05:00
README.git Canonicalize some URLs 2020-02-10 20:47:50 +01:00
aclocal.m4 autoconf: Move export_dynamic determination to configure 2022-12-06 18:55:28 -08:00
configure Optimize pg_readv/pg_pwritev single vector case. 2023-11-29 17:19:25 +13:00
configure.ac Optimize pg_readv/pg_pwritev single vector case. 2023-11-29 17:19:25 +13:00
meson.build Don't clean initdb files on template creation failure 2023-12-08 13:42:54 +01:00
meson_options.txt meson: Change default of 'selinux' feature option to auto 2023-11-17 10:23:02 -08:00

README

PostgreSQL Database Management System
=====================================

This directory contains the source code distribution of the PostgreSQL
database management system.

PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, user-defined types
and functions.  This distribution also contains C language bindings.

See the file INSTALL for instructions on how to build and install
PostgreSQL.  That file also lists supported operating systems and
hardware platforms and contains information regarding any other
software packages that are required to build or run the PostgreSQL
system.  Copyright and license information can be found in the
file COPYRIGHT.  A comprehensive documentation set is included in this
distribution; it can be read as described in the installation
instructions.

The latest version of this software, and related software, may be
obtained at https://www.postgresql.org/download/.  For more information
look at our web site located at https://www.postgresql.org/.