Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTYqY-0007Vn-Er for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Jul 2016 18:18:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bTYqX-0004pY-TX for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Jul 2016 18:18:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bTYok-0002hc-KJ for pgsql-hackers@postgresql.org; Sat, 30 Jul 2016 18:16:59 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bTYoa-0007By-IC for pgsql-hackers@postgresql.org; Sat, 30 Jul 2016 18:16:57 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1bTYoV-0001UX-IV; Sat, 30 Jul 2016 14:16:43 -0400 Date: Sat, 30 Jul 2016 14:16:43 -0400 From: Bruce Momjian To: Tom Lane Cc: Greg Stark , "David G. Johnston" , thomas.berger@1und1.de, PostgreSQL-development Subject: Re: [BUGS] BUG #14244: wrong suffix for pg_size_pretty() Message-ID: <20160730181643.GD22405@momjian.us> References: <20160712133638.1409.99068@wrigleys.postgresql.org> <20160730001838.GA22405@momjian.us> <794.1469889358@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <794.1469889358@sss.pgh.pa.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jul 30, 2016 at 10:35:58AM -0400, Tom Lane wrote: > Greg Stark writes: > > I think Bruce's summary is a bit revisionist. > > I would say it's a tempest in a teapot. > > What I think we should do is accept "kb" and the rest case-insensitively, > print them all in all-upper-case always, and tell standards pedants > to get lost. The idea of introducing either a GUC or new function names > is just silly; it will cause far more confusion and user code breakage > than will result from just leaving well enough alone. I agree that a GUC and new functions are overkill --- we should just decide on the format we want to output and what to support for input. As logical as the IEC format appears, I just don't think the Ki/Mi/Gi prefixes are used widely enough for us to use it --- I think it will cause too many problem reports: https://en.wikipedia.org/wiki/Binary_prefix I have developed two possible patches for PG 10 --- the first one merely allows "KB" to be used in addition to the existing "kB", and documents this as an option. The second patch does what Tom suggests above by outputting only "KB", and it supports "kB" for backward compatibility. What it doesn't do is to allow arbitrary case, which I think would be a step backward. The second patch actually does match the JEDEC standard, except for allowing "kB". I also just applied a doc patch that increases case and spacing consistency in the use of kB/MB/GB/TB. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + --J2SCkAp4GZ/dPZZf Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="kilo.diff" diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c new file mode 100644 index 6ac5184..40038ac *** a/src/backend/utils/misc/guc.c --- b/src/backend/utils/misc/guc.c *************** typedef struct *** 694,700 **** #error XLOG_SEG_SIZE must be between 1MB and 1GB #endif ! static const char *memory_units_hint = gettext_noop("Valid units for this parameter are \"kB\", \"MB\", \"GB\", and \"TB\"."); static const unit_conversion memory_unit_conversion_table[] = { --- 694,700 ---- #error XLOG_SEG_SIZE must be between 1MB and 1GB #endif ! static const char *memory_units_hint = gettext_noop("Valid units for this parameter are \"kB\"/\"KB\", \"MB\", \"GB\", and \"TB\"."); static const unit_conversion memory_unit_conversion_table[] = { *************** convert_to_base_unit(int64 value, const *** 5322,5328 **** for (i = 0; *table[i].unit; i++) { if (base_unit == table[i].base_unit && ! strcmp(unit, table[i].unit) == 0) { if (table[i].multiplier < 0) *base_value = value / (-table[i].multiplier); --- 5322,5331 ---- for (i = 0; *table[i].unit; i++) { if (base_unit == table[i].base_unit && ! (strcmp(unit, table[i].unit) == 0 || ! /* support the JEDEC standard which uses "KB" for 1024 */ ! (strcmp(unit, "KB") == 0 && ! strcmp(table[i].unit, "kB") == 0))) { if (table[i].multiplier < 0) *base_value = value / (-table[i].multiplier); --J2SCkAp4GZ/dPZZf Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="kilo2.diff" diff --git a/configure b/configure new file mode 100755 index b49cc11..8466e5a *** a/configure --- b/configure *************** Optional Packages: *** 1502,1511 **** --with-libs=DIRS alternative spelling of --with-libraries --with-pgport=PORTNUM set default port number [5432] --with-blocksize=BLOCKSIZE ! set table block size in kB [8] --with-segsize=SEGSIZE set table segment size in GB [1] --with-wal-blocksize=BLOCKSIZE ! set WAL block size in kB [8] --with-wal-segsize=SEGSIZE set WAL segment size in MB [16] --with-CC=CMD set compiler (deprecated) --- 1502,1511 ---- --with-libs=DIRS alternative spelling of --with-libraries --with-pgport=PORTNUM set default port number [5432] --with-blocksize=BLOCKSIZE ! set table block size in KB [8] --with-segsize=SEGSIZE set table segment size in GB [1] --with-wal-blocksize=BLOCKSIZE ! set WAL block size in KB [8] --with-wal-segsize=SEGSIZE set WAL segment size in MB [16] --with-CC=CMD set compiler (deprecated) *************** case ${blocksize} in *** 3550,3557 **** 32) BLCKSZ=32768;; *) as_fn_error $? "Invalid block size. Allowed values are 1,2,4,8,16,32." "$LINENO" 5 esac ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${blocksize}kB" >&5 ! $as_echo "${blocksize}kB" >&6; } cat >>confdefs.h <<_ACEOF --- 3550,3557 ---- 32) BLCKSZ=32768;; *) as_fn_error $? "Invalid block size. Allowed values are 1,2,4,8,16,32." "$LINENO" 5 esac ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${blocksize}KB" >&5 ! $as_echo "${blocksize}KB" >&6; } cat >>confdefs.h <<_ACEOF *************** case ${wal_blocksize} in *** 3638,3645 **** 64) XLOG_BLCKSZ=65536;; *) as_fn_error $? "Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5 esac ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_blocksize}kB" >&5 ! $as_echo "${wal_blocksize}kB" >&6; } cat >>confdefs.h <<_ACEOF --- 3638,3645 ---- 64) XLOG_BLCKSZ=65536;; *) as_fn_error $? "Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5 esac ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_blocksize}KB" >&5 ! $as_echo "${wal_blocksize}KB" >&6; } cat >>confdefs.h <<_ACEOF diff --git a/configure.in b/configure.in new file mode 100644 index 5da4f74..2ed6298 *** a/configure.in --- b/configure.in *************** AC_SUBST(enable_tap_tests) *** 250,256 **** # Block size # AC_MSG_CHECKING([for block size]) ! PGAC_ARG_REQ(with, blocksize, [BLOCKSIZE], [set table block size in kB [8]], [blocksize=$withval], [blocksize=8]) case ${blocksize} in --- 250,256 ---- # Block size # AC_MSG_CHECKING([for block size]) ! PGAC_ARG_REQ(with, blocksize, [BLOCKSIZE], [set table block size in KB [8]], [blocksize=$withval], [blocksize=8]) case ${blocksize} in *************** case ${blocksize} in *** 262,268 **** 32) BLCKSZ=32768;; *) AC_MSG_ERROR([Invalid block size. Allowed values are 1,2,4,8,16,32.]) esac ! AC_MSG_RESULT([${blocksize}kB]) AC_DEFINE_UNQUOTED([BLCKSZ], ${BLCKSZ}, [ Size of a disk block --- this also limits the size of a tuple. You --- 262,268 ---- 32) BLCKSZ=32768;; *) AC_MSG_ERROR([Invalid block size. Allowed values are 1,2,4,8,16,32.]) esac ! AC_MSG_RESULT([${blocksize}KB]) AC_DEFINE_UNQUOTED([BLCKSZ], ${BLCKSZ}, [ Size of a disk block --- this also limits the size of a tuple. You *************** AC_DEFINE_UNQUOTED([RELSEG_SIZE], ${RELS *** 314,320 **** # WAL block size # AC_MSG_CHECKING([for WAL block size]) ! PGAC_ARG_REQ(with, wal-blocksize, [BLOCKSIZE], [set WAL block size in kB [8]], [wal_blocksize=$withval], [wal_blocksize=8]) case ${wal_blocksize} in --- 314,320 ---- # WAL block size # AC_MSG_CHECKING([for WAL block size]) ! PGAC_ARG_REQ(with, wal-blocksize, [BLOCKSIZE], [set WAL block size in KB [8]], [wal_blocksize=$withval], [wal_blocksize=8]) case ${wal_blocksize} in *************** case ${wal_blocksize} in *** 327,333 **** 64) XLOG_BLCKSZ=65536;; *) AC_MSG_ERROR([Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64.]) esac ! AC_MSG_RESULT([${wal_blocksize}kB]) AC_DEFINE_UNQUOTED([XLOG_BLCKSZ], ${XLOG_BLCKSZ}, [ Size of a WAL file block. This need have no particular relation to BLCKSZ. --- 327,333 ---- 64) XLOG_BLCKSZ=65536;; *) AC_MSG_ERROR([Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64.]) esac ! AC_MSG_RESULT([${wal_blocksize}KB]) AC_DEFINE_UNQUOTED([XLOG_BLCKSZ], ${XLOG_BLCKSZ}, [ Size of a WAL file block. This need have no particular relation to BLCKSZ. diff --git a/doc/src/sgml/auto-explain.sgml b/doc/src/sgml/auto-explain.sgml new file mode 100644 index 38e6f50..34d87b3 *** a/doc/src/sgml/auto-explain.sgml --- b/doc/src/sgml/auto-explain.sgml *************** LOG: duration: 3.651 ms plan: *** 263,269 **** Hash Cond: (pg_class.oid = pg_index.indrelid) -> Seq Scan on pg_class (cost=0.00..9.55 rows=255 width=4) (actual time=0.016..0.140 rows=255 loops=1) -> Hash (cost=3.02..3.02 rows=92 width=4) (actual time=3.238..3.238 rows=92 loops=1) ! Buckets: 1024 Batches: 1 Memory Usage: 4kB -> Seq Scan on pg_index (cost=0.00..3.02 rows=92 width=4) (actual time=0.008..3.187 rows=92 loops=1) Filter: indisunique ]]> --- 263,269 ---- Hash Cond: (pg_class.oid = pg_index.indrelid) -> Seq Scan on pg_class (cost=0.00..9.55 rows=255 width=4) (actual time=0.016..0.140 rows=255 loops=1) -> Hash (cost=3.02..3.02 rows=92 width=4) (actual time=3.238..3.238 rows=92 loops=1) ! Buckets: 1024 Batches: 1 Memory Usage: 4KB -> Seq Scan on pg_index (cost=0.00..3.02 rows=92 width=4) (actual time=0.008..3.187 rows=92 loops=1) Filter: indisunique ]]> diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml new file mode 100644 index cbb333f..a0678b2 *** a/doc/src/sgml/catalogs.sgml --- b/doc/src/sgml/catalogs.sgml *************** *** 4021,4027 **** segments or pages small enough to be conveniently stored as rows in pg_largeobject. The amount of data per page is defined to be LOBLKSIZE (which is currently ! BLCKSZ/4, or typically 2kB). --- 4021,4027 ---- segments or pages small enough to be conveniently stored as rows in pg_largeobject. The amount of data per page is defined to be LOBLKSIZE (which is currently ! BLCKSZ/4, or typically 2KB). diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml new file mode 100644 index b9581d9..23d666a *** a/doc/src/sgml/config.sgml --- b/doc/src/sgml/config.sgml *************** *** 81,87 **** ! Valid memory units are kB (kilobytes), MB (megabytes), GB (gigabytes), and TB (terabytes). The multiplier for memory units is 1024, not 1000. --- 81,87 ---- ! Valid memory units are KB (kilobytes), MB (megabytes), GB (gigabytes), and TB (terabytes). The multiplier for memory units is 1024, not 1000. *************** include_dir 'conf.d' *** 1903,1909 **** cache, where performance might degrade. This setting may have no effect on some platforms. The valid range is between 0, which disables controlled writeback, and ! 2MB. The default is 512kB on Linux, 0 elsewhere. (Non-default values of BLCKSZ change the default and maximum.) This parameter can only be set in the postgresql.conf --- 1903,1909 ---- cache, where performance might degrade. This setting may have no effect on some platforms. The valid range is between 0, which disables controlled writeback, and ! 2MB. The default is 512KB on Linux, 0 elsewhere. (Non-default values of BLCKSZ change the default and maximum.) This parameter can only be set in the postgresql.conf *************** include_dir 'conf.d' *** 2481,2491 **** The amount of shared memory used for WAL data that has not yet been written to disk. The default setting of -1 selects a size equal to 1/32nd (about 3%) of , but not less ! than 64kB nor more than the size of one WAL segment, typically 16MB. This value can be set manually if the automatic choice is too large or too small, ! but any positive value less than 32kB will be ! treated as 32kB. This parameter can only be set at server start. --- 2481,2491 ---- The amount of shared memory used for WAL data that has not yet been written to disk. The default setting of -1 selects a size equal to 1/32nd (about 3%) of , but not less ! than 64KB nor more than the size of one WAL segment, typically 16MB. This value can be set manually if the automatic choice is too large or too small, ! but any positive value less than 32KB will be ! treated as 32KB. This parameter can only be set at server start. *************** include_dir 'conf.d' *** 2660,2666 **** than the OS's page cache, where performance might degrade. This setting may have no effect on some platforms. The valid range is between 0, which disables controlled writeback, ! and 2MB. The default is 256kB on Linux, 0 elsewhere. (Non-default values of BLCKSZ change the default and maximum.) This parameter can only be set in the postgresql.conf --- 2660,2666 ---- than the OS's page cache, where performance might degrade. This setting may have no effect on some platforms. The valid range is between 0, which disables controlled writeback, ! and 2MB. The default is 256KB on Linux, 0 elsewhere. (Non-default values of BLCKSZ change the default and maximum.) This parameter can only be set in the postgresql.conf diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml new file mode 100644 index a30e25c..b917bdd *** a/doc/src/sgml/ecpg.sgml --- b/doc/src/sgml/ecpg.sgml *************** if (*(int2 *)sqldata->sqlvar[i].sqlind ! *** 8165,8171 **** sqlilongdata ! It equals to sqldata if sqllen is larger than 32kB. --- 8165,8171 ---- sqlilongdata ! It equals to sqldata if sqllen is larger than 32KB. diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml new file mode 100644 index 971e642..64f347e *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *************** postgres=# SELECT * FROM pg_xlogfile_nam *** 18788,18809 **** pg_size_pretty can be used to format the result of one of ! the other functions in a human-readable way, using bytes, kB, MB, GB or TB as appropriate. pg_size_bytes can be used to get the size in bytes from a ! string in human-readable format. The input may have units of bytes, kB, MB, GB or TB, and is parsed case-insensitively. If no units are specified, bytes are assumed. ! The units kB, MB, GB and TB used by the functions pg_size_pretty and pg_size_bytes are defined ! using powers of 2 rather than powers of 10, so 1kB is 1024 bytes, 1MB is 10242 = 1048576 bytes, and so on. --- 18788,18809 ---- pg_size_pretty can be used to format the result of one of ! the other functions in a human-readable way, using bytes, KB, MB, GB or TB as appropriate. pg_size_bytes can be used to get the size in bytes from a ! string in human-readable format. The input may have units of bytes, KB, MB, GB or TB, and is parsed case-insensitively. If no units are specified, bytes are assumed. ! The units KB, MB, GB and TB used by the functions pg_size_pretty and pg_size_bytes are defined ! using powers of 2 rather than powers of 10, so 1KB is 1024 bytes, 1MB is 10242 = 1048576 bytes, and so on. diff --git a/doc/src/sgml/ltree.sgml b/doc/src/sgml/ltree.sgml new file mode 100644 index fccfd32..29be58b *** a/doc/src/sgml/ltree.sgml --- b/doc/src/sgml/ltree.sgml *************** *** 31,37 **** A label path is a sequence of zero or more labels separated by dots, for example L1.L2.L3, representing a path from the root of a hierarchical tree to a particular node. The ! length of a label path must be less than 65kB, but keeping it under 2kB is preferable. In practice this is not a major limitation; for example, the longest label path in the DMOZ catalog () is about 240 bytes. --- 31,37 ---- A label path is a sequence of zero or more labels separated by dots, for example L1.L2.L3, representing a path from the root of a hierarchical tree to a particular node. The ! length of a label path must be less than 65KB, but keeping it under 2KB is preferable. In practice this is not a major limitation; for example, the longest label path in the DMOZ catalog () is about 240 bytes. diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml new file mode 100644 index 7bcbfa7..a30b276 *** a/doc/src/sgml/perform.sgml --- b/doc/src/sgml/perform.sgml *************** WHERE t1.unique1 < 100 AND t1.unique2 *** 603,614 **** -------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=717.34..717.59 rows=101 width=488) (actual time=7.761..7.774 rows=100 loops=1) Sort Key: t1.fivethous ! Sort Method: quicksort Memory: 77kB -> Hash Join (cost=230.47..713.98 rows=101 width=488) (actual time=0.711..7.427 rows=100 loops=1) Hash Cond: (t2.unique2 = t1.unique2) -> Seq Scan on tenk2 t2 (cost=0.00..445.00 rows=10000 width=244) (actual time=0.007..2.583 rows=10000 loops=1) -> Hash (cost=229.20..229.20 rows=101 width=244) (actual time=0.659..0.659 rows=100 loops=1) ! Buckets: 1024 Batches: 1 Memory Usage: 28kB -> Bitmap Heap Scan on tenk1 t1 (cost=5.07..229.20 rows=101 width=244) (actual time=0.080..0.526 rows=100 loops=1) Recheck Cond: (unique1 < 100) -> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=101 width=0) (actual time=0.049..0.049 rows=100 loops=1) --- 603,614 ---- -------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=717.34..717.59 rows=101 width=488) (actual time=7.761..7.774 rows=100 loops=1) Sort Key: t1.fivethous ! Sort Method: quicksort Memory: 77KB -> Hash Join (cost=230.47..713.98 rows=101 width=488) (actual time=0.711..7.427 rows=100 loops=1) Hash Cond: (t2.unique2 = t1.unique2) -> Seq Scan on tenk2 t2 (cost=0.00..445.00 rows=10000 width=244) (actual time=0.007..2.583 rows=10000 loops=1) -> Hash (cost=229.20..229.20 rows=101 width=244) (actual time=0.659..0.659 rows=100 loops=1) ! Buckets: 1024 Batches: 1 Memory Usage: 28KB -> Bitmap Heap Scan on tenk1 t1 (cost=5.07..229.20 rows=101 width=244) (actual time=0.080..0.526 rows=100 loops=1) Recheck Cond: (unique1 < 100) -> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=101 width=0) (actual time=0.049..0.049 rows=100 loops=1) diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml new file mode 100644 index 8e701aa..3bab944 *** a/doc/src/sgml/protocol.sgml --- b/doc/src/sgml/protocol.sgml *************** The commands accepted in walsender mode *** 1973,1979 **** Limit (throttle) the maximum amount of data transferred from server to client per unit of time. The expected unit is kilobytes per second. If this option is specified, the value must either be equal to zero ! or it must fall within the range from 32kB through 1GB (inclusive). If zero is passed or the option is not specified, no restriction is imposed on the transfer. --- 1973,1979 ---- Limit (throttle) the maximum amount of data transferred from server to client per unit of time. The expected unit is kilobytes per second. If this option is specified, the value must either be equal to zero ! or it must fall within the range from 32KB through 1GB (inclusive). If zero is passed or the option is not specified, no restriction is imposed on the transfer. diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml new file mode 100644 index ca1b767..e7c5c6e *** a/doc/src/sgml/rules.sgml --- b/doc/src/sgml/rules.sgml *************** SELECT word FROM words ORDER BY word <-> *** 1079,1085 **** Limit (cost=11583.61..11583.64 rows=10 width=32) (actual time=1431.591..1431.594 rows=10 loops=1) -> Sort (cost=11583.61..11804.76 rows=88459 width=32) (actual time=1431.589..1431.591 rows=10 loops=1) Sort Key: ((word <-> 'caterpiler'::text)) ! Sort Method: top-N heapsort Memory: 25kB -> Foreign Scan on words (cost=0.00..9672.05 rows=88459 width=32) (actual time=0.057..1286.455 rows=479829 loops=1) Foreign File: /usr/share/dict/words Foreign File Size: 4953699 --- 1079,1085 ---- Limit (cost=11583.61..11583.64 rows=10 width=32) (actual time=1431.591..1431.594 rows=10 loops=1) -> Sort (cost=11583.61..11804.76 rows=88459 width=32) (actual time=1431.589..1431.591 rows=10 loops=1) Sort Key: ((word <-> 'caterpiler'::text)) ! Sort Method: top-N heapsort Memory: 25KB -> Foreign Scan on words (cost=0.00..9672.05 rows=88459 width=32) (actual time=0.057..1286.455 rows=479829 loops=1) Foreign File: /usr/share/dict/words Foreign File Size: 4953699 diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml new file mode 100644 index 4c5d748..02644ce *** a/doc/src/sgml/runtime.sgml --- b/doc/src/sgml/runtime.sgml *************** psql: could not connect to server: No su *** 659,665 **** SHMMAX Maximum size of shared memory segment (bytes) ! at least 1kB (more if running many copies of the server) --- 659,665 ---- SHMMAX Maximum size of shared memory segment (bytes) ! at least 1KB (more if running many copies of the server) *************** kern.sysv.shmall=1024 *** 1032,1038 **** ! SHMALL is measured in 4kB pages on this platform. --- 1032,1038 ---- ! SHMALL is measured in 4KB pages on this platform. *************** sysctl -w kern.sysv.shmall *** 1075,1081 **** ! In the default configuration, only 512kB of shared memory per segment is allowed. To increase the setting, first change to the directory /etc/conf/cf.d. To display the current value of SHMMAX, run: --- 1075,1081 ---- ! In the default configuration, only 512KB of shared memory per segment is allowed. To increase the setting, first change to the directory /etc/conf/cf.d. To display the current value of SHMMAX, run: *************** project.max-msg-ids=(priv,4096,deny) *** 1180,1186 **** On UnixWare 7, the maximum size for shared ! memory segments is 512kB in the default configuration. To display the current value of SHMMAX, run: /etc/conf/bin/idtune -g SHMMAX --- 1180,1186 ---- On UnixWare 7, the maximum size for shared ! memory segments is 512KB in the default configuration. To display the current value of SHMMAX, run: /etc/conf/bin/idtune -g SHMMAX diff --git a/doc/src/sgml/spgist.sgml b/doc/src/sgml/spgist.sgml new file mode 100644 index f40c790..6a22054 *** a/doc/src/sgml/spgist.sgml --- b/doc/src/sgml/spgist.sgml *************** typedef struct spgLeafConsistentOut *** 755,761 **** Individual leaf tuples and inner tuples must fit on a single index page ! (8kB by default). Therefore, when indexing values of variable-length data types, long values can only be supported by methods such as radix trees, in which each level of the tree includes a prefix that is short enough to fit on a page, and the final leaf level includes a suffix also --- 755,761 ---- Individual leaf tuples and inner tuples must fit on a single index page ! (8KB by default). Therefore, when indexing values of variable-length data types, long values can only be supported by methods such as radix trees, in which each level of the tree includes a prefix that is short enough to fit on a page, and the final leaf level includes a suffix also diff --git a/doc/src/sgml/storage.sgml b/doc/src/sgml/storage.sgml new file mode 100644 index 2d82953..aff3dd8 *** a/doc/src/sgml/storage.sgml --- b/doc/src/sgml/storage.sgml *************** Oversized-Attribute Storage Technique). *** 303,309 **** PostgreSQL uses a fixed page size (commonly ! 8kB), and does not allow tuples to span multiple pages. Therefore, it is not possible to store very large field values directly. To overcome this limitation, large field values are compressed and/or broken up into multiple physical rows. This happens transparently to the user, with only --- 303,309 ---- PostgreSQL uses a fixed page size (commonly ! 8KB), and does not allow tuples to span multiple pages. Therefore, it is not possible to store very large field values directly. To overcome this limitation, large field values are compressed and/or broken up into multiple physical rows. This happens transparently to the user, with only *************** bytes regardless of the actual size of t *** 420,429 **** The TOAST management code is triggered only when a row value to be stored in a table is wider than ! TOAST_TUPLE_THRESHOLD bytes (normally 2kB). The TOAST code will compress and/or move field values out-of-line until the row value is shorter than ! TOAST_TUPLE_TARGET bytes (also normally 2kB) or no more gains can be had. During an UPDATE operation, values of unchanged fields are normally preserved as-is; so an UPDATE of a row with out-of-line values incurs no TOAST costs if --- 420,429 ---- The TOAST management code is triggered only when a row value to be stored in a table is wider than ! TOAST_TUPLE_THRESHOLD bytes (normally 2KB). The TOAST code will compress and/or move field values out-of-line until the row value is shorter than ! TOAST_TUPLE_TARGET bytes (also normally 2KB) or no more gains can be had. During an UPDATE operation, values of unchanged fields are normally preserved as-is; so an UPDATE of a row with out-of-line values incurs no TOAST costs if *************** containing typical HTML pages and their *** 491,497 **** raw data size including the TOAST table, and that the main table contained only about 10% of the entire data (the URLs and some small HTML pages). There was no run time difference compared to an un-TOASTed ! comparison table, in which all the HTML pages were cut down to 7kB to fit. --- 491,497 ---- raw data size including the TOAST table, and that the main table contained only about 10% of the entire data (the URLs and some small HTML pages). There was no run time difference compared to an un-TOASTed ! comparison table, in which all the HTML pages were cut down to 7KB to fit. *************** an item is a row; in an index, an item i *** 703,709 **** Every table and index is stored as an array of pages of a ! fixed size (usually 8kB, although a different page size can be selected when compiling the server). In a table, all the pages are logically equivalent, so a particular item (row) can be stored in any page. In indexes, the first page is generally reserved as a metapage --- 703,709 ---- Every table and index is stored as an array of pages of a ! fixed size (usually 8KB, although a different page size can be selected when compiling the server). In a table, all the pages are logically equivalent, so a particular item (row) can be stored in any page. In indexes, the first page is generally reserved as a metapage diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml new file mode 100644 index 2089040..1c2764b *** a/doc/src/sgml/wal.sgml --- b/doc/src/sgml/wal.sgml *************** *** 176,182 **** this page imaging by turning off the parameter. Battery-Backed Unit (BBU) disk controllers do not prevent partial page writes unless ! they guarantee that data is written to the BBU as full (8kB) pages. PostgreSQL also protects against some kinds of data corruption --- 176,182 ---- this page imaging by turning off the parameter. Battery-Backed Unit (BBU) disk controllers do not prevent partial page writes unless ! they guarantee that data is written to the BBU as full (8KB) pages. PostgreSQL also protects against some kinds of data corruption *************** *** 664,670 **** linkend="pgtestfsync"> program can be used to measure the average time in microseconds that a single WAL flush operation takes. A value of half of the average time the program reports it takes to flush after a ! single 8kB write operation is often the most effective setting for commit_delay, so this value is recommended as the starting point to use when optimizing for a particular workload. While tuning commit_delay is particularly useful when the --- 664,670 ---- linkend="pgtestfsync"> program can be used to measure the average time in microseconds that a single WAL flush operation takes. A value of half of the average time the program reports it takes to flush after a ! single 8KB write operation is often the most effective setting for commit_delay, so this value is recommended as the starting point to use when optimizing for a particular workload. While tuning commit_delay is particularly useful when the *************** *** 738,744 **** segment files, normally each 16MB in size (but the size can be changed by altering the