postgresql/src/backend
Peter Eisentraut 4f622503d6 Make attstattarget nullable
This changes the pg_attribute field attstattarget into a nullable
field in the variable-length part of the row.  If no value is set by
the user for attstattarget, it is now null instead of previously -1.
This saves space in pg_attribute and tuple descriptors for most
practical scenarios.  (ATTRIBUTE_FIXED_PART_SIZE is reduced from 108
to 104.)  Also, null is the semantically more correct value.

The ANALYZE code internally continues to represent the default
statistics target by -1, so that that code can avoid having to deal
with null values.  But that is now contained to the ANALYZE code.
Only the DDL code deals with attstattarget possibly null.

For system columns, the field is now always null.  The ANALYZE code
skips system columns anyway.

To set a column's statistics target to the default value, the new
command form ALTER TABLE ... SET STATISTICS DEFAULT can be used.  (SET
STATISTICS -1 still works.)

Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://www.postgresql.org/message-id/flat/4da8d211-d54d-44b9-9847-f2a9f1184c76@eisentraut.org
2024-01-13 18:14:53 +01:00
..
access Make attstattarget nullable 2024-01-13 18:14:53 +01:00
archive Update copyright for 2024 2024-01-03 20:49:05 -05:00
backup Add new function pg_get_wal_summarizer_state(). 2024-01-11 12:41:18 -05:00
bootstrap Make attstattarget nullable 2024-01-13 18:14:53 +01:00
catalog Make attstattarget nullable 2024-01-13 18:14:53 +01:00
commands Make attstattarget nullable 2024-01-13 18:14:53 +01:00
executor Fix indentation in ExecParallelHashIncreaseNumBatches() 2024-01-08 20:00:20 +02:00
foreign Update copyright for 2024 2024-01-03 20:49:05 -05:00
jit Refactor code checking for file existence 2024-01-12 12:04:51 +09:00
lib Update copyright for 2024 2024-01-03 20:49:05 -05:00
libpq Update copyright for 2024 2024-01-03 20:49:05 -05:00
main Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodes Handle WindowClause.runCondition in tree walker/mutator functions. 2024-01-10 13:36:33 -05:00
optimizer Allow subquery pullup to wrap a PlaceHolderVar in another one. 2024-01-11 15:28:22 -05:00
parser Make attstattarget nullable 2024-01-13 18:14:53 +01:00
partitioning Update copyright for 2024 2024-01-03 20:49:05 -05:00
po Update copyright for 2024 2024-01-03 20:49:05 -05:00
port Update copyright for 2024 2024-01-03 20:49:05 -05:00
postmaster Reindent after commit d9ef650fca. 2024-01-11 13:24:35 -05:00
regex Update copyright for 2024 2024-01-03 20:49:05 -05:00
replication Fix memory leak in connection string validation. 2024-01-12 21:40:23 -08:00
rewrite Update copyright for 2024 2024-01-03 20:49:05 -05:00
snowball Add copyright notices to a few perl scripts that don't have them 2024-01-05 13:15:50 +00:00
statistics Update copyright for 2024 2024-01-03 20:49:05 -05:00
storage Refactor code checking for file existence 2024-01-12 12:04:51 +09:00
tcop Update copyright for 2024 2024-01-03 20:49:05 -05:00
tsearch Update copyright for 2024 2024-01-03 20:49:05 -05:00
utils Make attstattarget nullable 2024-01-13 18:14:53 +01:00
.gitignore
common.mk
Makefile Cross-check lists of predefined LWLocks. 2024-01-09 11:05:19 -06:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls.mk Remove distprep 2023-11-06 15:18:04 +01:00