0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pgstattupleやpgstatindexに条件句は使えない

Last updated at Posted at 2021-12-13

SELECT * FROM pgstatindex('schema.t_hoge_key')

【疑問】
上記のように「common.t_hoge_key」の情報を得る際、「schema.t_hoge_key」のみに限定せず、Where句などによって全件や、特定条件といった範囲データを抽出が可能かどうか。
【結論】
pgstatindex 関数など、pgstattuple モジュールから提供される関数には「対象とする
リレーションの名前(スキーマ修飾可)」もしくは「OID」を指定することがマニュアル
に明記あり。関数の結果内に、カラム名やインデックス名などの情報をもたないので、全件出力やWHERE句による条件指定などはできない。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?