バージョンごとのドキュメント一覧

ALTER STATISTICS

ALTER STATISTICS — change the definition of an extended statistics object 拡張統計オブジェクトの定義を変更する

概要

ALTER STATISTICS name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER STATISTICS name RENAME TO new_name
ALTER STATISTICS name SET SCHEMA new_schema
ALTER STATISTICS name SET STATISTICS new_target

説明

<title>Description</title>

<command>ALTER STATISTICS</command> changes the parameters of an existing extended statistics object. Any parameters not specifically set in the <command>ALTER STATISTICS</command> command retain their prior settings. ALTER STATISTICSは既存の拡張統計オブジェクトのパラメータを変更します。 ALTER STATISTICSコマンドで明示的に設定されないパラメータは、以前の設定を保持します。

You must own the statistics object to use <command>ALTER STATISTICS</command>. To change a statistics object's schema, you must also have <literal>CREATE</literal> privilege on the new schema. To alter the owner, you must be able to <literal>SET ROLE</literal> to the new owning role, and that role must have <literal>CREATE</literal> privilege on the statistics object's schema. (These restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the statistics object. However, a superuser can alter ownership of any statistics object anyway.) ALTER STATISTICSを使用するには、その統計オブジェクトを所有していなければなりません。 統計オブジェクトのスキーマを変更するには、新しいスキーマに対するCREATE権限も持っていなければなりません。 所有者を変更するには、新しい所有者ロールに対してSET ROLEができなければなりません。また、そのロールは統計オブジェクトのスキーマに対するCREATE権限を持っていなければなりません。 (これらの制限は、統計オブジェクトを削除し、そして再作成することによって実現できないことを、所有者を変更することで実現できることがないことを強制するものです。 しかし、スーパーユーザはどの統計オブジェクトの所有者も変更できます。)

パラメータ

<title>Parameters</title>

name

The name (optionally schema-qualified) of the statistics object to be altered. 変更の対象となる統計オブジェクトの名前(オプションでスキーマ修飾可)です。

new_owner

The user name of the new owner of the statistics object. 統計オブジェクトの新しい所有者のユーザ名です。

new_name

The new name for the statistics object. 統計オブジェクトの新しい名前です。

new_schema

The new schema for the statistics object. 統計オブジェクトの新しいスキーマです。

new_target

The statistic-gathering target for this statistics object for subsequent <link linkend="sql-analyze"><command>ANALYZE</command></link> operations. The target can be set in the range 0 to 10000; alternatively, set it to -1 to revert to using the maximum of the statistics target of the referenced columns, if set, or the system default statistics target (<xref linkend="guc-default-statistics-target"/>). For more information on the use of statistics by the <productname>PostgreSQL</productname> query planner, refer to <xref linkend="planner-stats"/>. 後続のANALYZE操作でこの統計オブジェクトについて統計情報を集める目標です。 目標は0から10000の範囲で設定できます。あるいは、設定されていれば、被参照列の統計目標の最大値を、もしくは、システムのデフォルトの統計目標(default_statistics_target)を使うように戻すために-1に設定します。 PostgreSQL問い合わせプランナによる統計情報の使用に関する詳細な情報は14.2を参照してください。

互換性

<title>Compatibility</title>

There is no <command>ALTER STATISTICS</command> command in the SQL standard. 標準SQLにはALTER STATISTICSコマンドはありません。

関連項目

<title>See Also</title> CREATE STATISTICS, DROP STATISTICS