postgresql/doc/src/sgml/ref
Tomas Vondra d06215d03b Allow setting statistics target for extended statistics
When building statistics, we need to decide how many rows to sample and
how accurate the resulting statistics should be. Until now, it was not
possible to explicitly define statistics target for extended statistics
objects, the value was always computed from the per-attribute targets
with a fallback to the system-wide default statistics target.

That's a bit inconvenient, as it ties together the statistics target set
for per-column and extended statistics. In some cases it may be useful
to require larger sample / higher accuracy for extended statics (or the
other way around), but with this approach that's not possible.

So this commit introduces a new command, allowing to specify statistics
target for individual extended statistics objects, overriding the value
derived from per-attribute targets (and the system default).

  ALTER STATISTICS stat_name SET STATISTICS target_value;

When determining statistics target for an extended statistics object we
first look at this explicitly set value. When this value is -1, we fall
back to the old formula, looking at the per-attribute targets first and
then the system default. This means the behavior is backwards compatible
with older PostgreSQL releases.

Author: Tomas Vondra
Discussion: https://postgr.es/m/20190618213357.vli3i23vpkset2xd@development
Reviewed-by: Kirk Jamison, Dean Rasheed
2019-09-11 00:25:51 +02:00
..
abort.sgml Transaction chaining 2019-03-24 11:33:02 +01:00
allfiles.sgml Rename pg_verify_checksums to pg_checksums 2019-03-13 10:43:20 +09:00
alter_aggregate.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_collation.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_conversion.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_database.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_default_privileges.sgml Refactor documentation about privileges to centralize the info. 2018-12-03 11:40:49 -05:00
alter_domain.sgml Doc: document that we expect CHECK constraint conditions to be immutable. 2018-12-07 16:40:58 -05:00
alter_event_trigger.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_extension.sgml SQL procedures 2017-11-30 11:03:20 -05:00
alter_foreign_data_wrapper.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_foreign_table.sgml Fix and improve several places in the docs 2019-07-13 14:43:29 +09:00
alter_function.sgml Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
alter_group.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_index.sgml Lower lock level for renaming indexes 2018-11-14 17:09:54 +01:00
alter_language.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_large_object.sgml Doc: improve documentation about ALTER LARGE OBJECT requirements. 2018-12-11 11:21:36 -05:00
alter_materialized_view.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_opclass.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_operator.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_opfamily.sgml doc: Update uses of the word "procedure" 2018-08-22 14:44:49 +02:00
alter_policy.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_procedure.sgml SQL procedures 2017-11-30 11:03:20 -05:00
alter_publication.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_role.sgml Clarify documentation about PASSWORD in CREATE/ALTER ROLE 2018-11-23 09:10:24 +09:00
alter_routine.sgml SQL procedures 2017-11-30 11:03:20 -05:00
alter_rule.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_schema.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_sequence.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_server.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_statistics.sgml Allow setting statistics target for extended statistics 2019-09-11 00:25:51 +02:00
alter_subscription.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_system.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_table.sgml Fix partitioned index creation with foreign partitions 2019-06-26 18:38:51 -04:00
alter_tablespace.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_trigger.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_tsconfig.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_tsdictionary.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_tsparser.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_tstemplate.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_type.sgml Relax transactional restrictions on ALTER TYPE ... ADD VALUE (redux). 2018-10-09 12:51:01 +13:00
alter_user_mapping.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
alter_user.sgml Clarify documentation about PASSWORD in CREATE/ALTER ROLE 2018-11-23 09:10:24 +09:00
alter_view.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
analyze.sgml Doc: document permissions required for ANALYZE. 2019-08-07 18:09:28 -04:00
begin.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
call.sgml Fix bugs in plpgsql's handling of CALL argument lists. 2018-11-04 13:25:39 -05:00
checkpoint.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
close.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
cluster.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
clusterdb.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
comment.sgml SQL procedures 2017-11-30 11:03:20 -05:00
commit_prepared.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
commit.sgml Fix behavior of AND CHAIN outside of explicit transaction blocks 2019-09-08 16:23:03 +02:00
copy.sgml Generated columns 2019-03-30 08:15:57 +01:00
create_access_method.sgml tableam: basic documentation. 2019-04-03 17:40:29 -07:00
create_aggregate.sgml Fix inconsistencies and typos in the tree 2019-07-29 12:28:30 +09:00
create_cast.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_collation.sgml Collations with nondeterministic comparison 2019-03-22 12:12:43 +01:00
create_conversion.sgml Remove dead encoding-conversion functions. 2019-07-05 14:17:27 -04:00
create_database.sgml Add CREATE DATABASE LOCALE option 2019-07-23 14:47:24 +02:00
create_domain.sgml Doc: document that we expect CHECK constraint conditions to be immutable. 2018-12-07 16:40:58 -05:00
create_event_trigger.sgml Change PROCEDURE to FUNCTION in CREATE TRIGGER syntax 2018-08-22 14:44:49 +02:00
create_extension.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_foreign_data_wrapper.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_foreign_table.sgml Fix partitioned index creation with foreign partitions 2019-06-26 18:38:51 -04:00
create_function.sgml Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
create_group.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_index.sgml Docs: concurrent builds of partitioned indexes are not supported 2019-06-06 12:36:37 +12:00
create_language.sgml doc: Update uses of the word "procedure" 2018-08-22 14:44:49 +02:00
create_materialized_view.sgml tableam: basic documentation. 2019-04-03 17:40:29 -07:00
create_opclass.sgml doc: Update uses of the word "procedure" 2018-08-22 14:44:49 +02:00
create_operator.sgml Change PROCEDURE to FUNCTION in CREATE OPERATOR syntax 2018-08-22 14:44:49 +02:00
create_opfamily.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_policy.sgml doc: Whitespace fixes in man pages 2018-05-21 14:43:24 -04:00
create_procedure.sgml Prohibit transaction commands in security definer procedures 2018-07-13 10:41:32 +02:00
create_publication.sgml Logical replication support for TRUNCATE 2018-04-07 11:34:11 -04:00
create_role.sgml Clarify documentation about PASSWORD in CREATE/ALTER ROLE 2018-11-23 09:10:24 +09:00
create_rule.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_schema.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_sequence.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_server.sgml docs: fix spacing around "if not exists" brackets 2018-03-29 21:25:39 -04:00
create_statistics.sgml Fix incorrect CREATE STATISTICS example in docs 2019-06-16 01:20:42 +02:00
create_subscription.sgml Remove extra word from create sub docs 2018-11-03 12:21:54 -04:00
create_table_as.sgml Fix copy-and-paste mistakes in documentation. 2019-05-08 21:16:36 +12:00
create_table.sgml doc: Clean up title case use 2019-09-08 10:27:29 +02:00
create_tablespace.sgml doc: Clarify CREATE TABLESPACE documentation 2018-10-01 14:07:01 +02:00
create_transform.sgml Adjust hints and docs to suggest CREATE EXTENSION not CREATE LANGUAGE. 2018-04-27 13:42:03 -04:00
create_trigger.sgml docs: cleanup/remove/update references to OID column. 2019-04-17 17:22:56 -07:00
create_tsconfig.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_tsdictionary.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_tsparser.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_tstemplate.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
create_type.sgml doc: Clarify CREATE TYPE ENUM documentation 2018-11-20 09:37:02 +01:00
create_user_mapping.sgml docs: fix spacing around "if not exists" brackets 2018-03-29 21:25:39 -04:00
create_user.sgml Clarify documentation about PASSWORD in CREATE/ALTER ROLE 2018-11-23 09:10:24 +09:00
create_view.sgml Add RECURSIVE to documentation index 2018-08-09 16:19:32 -04:00
createdb.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
createuser.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
deallocate.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
declare.sgml doc: adjust DECLARE docs to mention FOR UPDATE behavior 2018-05-28 13:16:02 -04:00
delete.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
discard.sgml Fix order of steps in DISCARD ALL documentation 2019-06-11 12:22:11 -04:00
do.sgml Adjust hints and docs to suggest CREATE EXTENSION not CREATE LANGUAGE. 2018-04-27 13:42:03 -04:00
drop_access_method.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_aggregate.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_cast.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_collation.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_conversion.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_database.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_domain.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_event_trigger.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_extension.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_foreign_data_wrapper.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_foreign_table.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_function.sgml SQL procedures 2017-11-30 11:03:20 -05:00
drop_group.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_index.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_language.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_materialized_view.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_opclass.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_operator.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_opfamily.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_owned.sgml Doc: clarify that REASSIGN OWNED doesn't handle default privileges. 2019-03-25 17:18:05 -04:00
drop_policy.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_procedure.sgml SQL procedures 2017-11-30 11:03:20 -05:00
drop_publication.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_role.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_routine.sgml SQL procedures 2017-11-30 11:03:20 -05:00
drop_rule.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_schema.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_sequence.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_server.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_statistics.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_subscription.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_table.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_tablespace.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_transform.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_trigger.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_tsconfig.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_tsdictionary.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_tsparser.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_tstemplate.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_type.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_user_mapping.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_user.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
drop_view.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
dropdb.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
dropuser.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
ecpg-ref.sgml ecpg: Document new compatibility option 2018-06-07 23:33:24 -04:00
end.sgml Transaction chaining 2019-03-24 11:33:02 +01:00
execute.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
explain.sgml Add SETTINGS option to EXPLAIN, to print modified settings. 2019-04-04 00:04:31 +02:00
fetch.sgml Doc: minor improvement in pl/pgsql FETCH/MOVE documentation. 2018-07-12 12:29:03 -04:00
grant.sgml Refactor documentation about privileges to centralize the info. 2018-12-03 11:40:49 -05:00
import_foreign_schema.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
initdb.sgml Revert "initdb: Change authentication defaults" 2019-07-22 19:28:25 +02:00
insert.sgml docs: Fix small copy & paste mistake. 2019-04-30 16:20:07 -07:00
listen.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
load.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
lock.sgml Add more infinite recursion detection while locking a view. 2018-04-17 16:59:17 +09:00
move.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
notify.sgml Use a hash table to de-duplicate NOTIFY events faster. 2019-08-15 12:22:12 -04:00
pg_basebackup.sgml Show shared object statistics in pg_stat_database 2019-04-12 14:04:50 +02:00
pg_checksums.sgml Fix and improve several places in the docs 2019-07-13 14:43:29 +09:00
pg_config-ref.sgml Don't use SGML empty tags 2017-10-17 15:10:33 -04:00
pg_controldata.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
pg_ctl-ref.sgml Implement "pg_ctl logrotate" command 2018-09-01 19:46:49 +03:00
pg_dump.sgml Clarify pg_dump documentation 2019-09-03 14:25:26 +02:00
pg_dumpall.sgml doc: Fix awkward markup 2019-09-06 22:19:53 +02:00
pg_isready.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
pg_receivewal.sgml Doc: Clarify interactions of pg_receivewal with remote_apply 2019-07-24 11:25:43 +09:00
pg_recvlogical.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
pg_resetwal.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
pg_restore.sgml pg_restore: Require "-f -" to mean stdout 2019-04-04 16:54:15 -03:00
pg_rewind.sgml doc: Clean up title case use 2019-09-08 10:27:29 +02:00
pg_waldump.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
pgarchivecleanup.sgml Integrate recovery.conf into postgresql.conf 2018-11-25 16:33:40 +01:00
pgbench.sgml doc: Clean up title case use 2019-09-08 10:27:29 +02:00
pgtestfsync.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
pgtesttiming.sgml doc: Clean up title case use 2019-09-08 10:27:29 +02:00
pgupgrade.sgml doc: Clean up title case use 2019-09-08 10:27:29 +02:00
postgres-ref.sgml doc: Clean up title case use 2019-09-08 10:27:29 +02:00
postmaster.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
prepare_transaction.sgml Restrict the use of temporary namespace in two-phase transactions 2019-01-18 09:21:44 +09:00
prepare.sgml docs: Only first instance of a PREPARE parameter sets data type 2018-08-09 10:13:15 -04:00
psql-ref.sgml Add \warn command to psql. 2019-07-05 12:32:36 -04:00
reassign_owned.sgml Doc: clarify that REASSIGN OWNED doesn't handle default privileges. 2019-03-25 17:18:05 -04:00
refresh_materialized_view.sgml Mention ownership requirements for REFRESH MATERIALIZED VIEW in docs 2018-08-17 11:29:15 +09:00
reindex.sgml Fix and improve several places in the docs 2019-07-13 14:43:29 +09:00
reindexdb.sgml Add support for --jobs in reindexdb 2019-07-27 22:21:18 +09:00
release_savepoint.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
reset.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
revoke.sgml Refactor documentation about privileges to centralize the info. 2018-12-03 11:40:49 -05:00
rollback_prepared.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
rollback_to.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
rollback.sgml Fix behavior of AND CHAIN outside of explicit transaction blocks 2019-09-08 16:23:03 +02:00
savepoint.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
security_label.sgml SQL procedures 2017-11-30 11:03:20 -05:00
select_into.sgml table: docs: fix typos and grammar. 2019-04-05 09:47:10 -07:00
select.sgml Allow user control of CTE materialization, and change the default behavior. 2019-02-16 16:11:12 -05:00
set_constraints.sgml Convert SGML IDs to lower case 2017-10-20 19:26:10 -04:00
set_role.sgml Fix inconsistencies and typos in the tree, take 9 2019-08-05 12:14:58 +09:00
set_session_auth.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
set_transaction.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
set.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
show.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
start_transaction.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
truncate.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
unlisten.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00
update.sgml Fix documentation on partitioning vs. foreign tables 2019-03-10 19:45:29 -03:00
vacuum.sgml Add TRUNCATE parameter to VACUUM. 2019-05-08 02:10:33 +09:00
vacuumdb.sgml Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
values.sgml Convert documentation to DocBook XML 2017-11-23 09:44:28 -05:00