web-dev-qa-db-ja.com

pgAdminはリモート操作で非常に遅い

私の開発サーバーにリモートで接続しているローカルのpgAdminからこのクエリを実行します。

select * from users order by random() limit 1;

17秒の間ハングし、表示されます

Total query runtime: 148 ms. 
1 row retrieved.

また、テーブルを右クリックしても、すべての操作でハングします。

その後、RDP経由で接続し、同じpgAdminバージョンで同じクエリを実行すると、query time: 32 ms

次に、ローカルのpgAdminからクエリを再度実行します。

Total query runtime: 337 ms.
1 row retrieved.

サーバーに対して130ミリ秒のpingを実行しています。 FTP経由でファイルをかなり高速にアップロードできるので、接続速度は十分以上です。

ローカルのpsqlで実行した場合の同じクエリは、接続時間を含めて数秒で終了します。

ローカルのpgAdminで同じクエリをローカルのdbコピーで実行すると、すぐに終了します。

pgAdminのバージョンは1.20.0です。最新の1.22でも確認しました-まだ同じです。

PgAdminを高速化するにはどうすればよいですか?

Psqlは正常に動作することに注意してください。そこには同じ待ち時間がありません。

17秒間のクエリ実行のpgAdminログ:

2016-02-06 16:18:03 INFO   : queueing : select * from users order by random() limit 1;
2016-02-06 16:18:03 QUERY  : Thread executing query (1:server): select * from users order by random() limit 1;
2016-02-06 16:18:03 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:03 QUERY  : Query result: integer
2016-02-06 16:18:03 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:03 QUERY  : Query result: 23
2016-02-06 16:18:03 QUERY  : Scalar query (server): SELECT format_type(oid,259) as typname FROM pg_type WHERE oid = 1043
2016-02-06 16:18:03 QUERY  : Query result: character varying(255)
2016-02-06 16:18:03 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1043
2016-02-06 16:18:03 QUERY  : Query result: 1043
2016-02-06 16:18:03 QUERY  : Scalar query (server): SELECT format_type(oid,259) as typname FROM pg_type WHERE oid = 1043
2016-02-06 16:18:03 QUERY  : Query result: character varying(255)
2016-02-06 16:18:03 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1043
2016-02-06 16:18:03 QUERY  : Query result: 1043
2016-02-06 16:18:03 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:04 QUERY  : Query result: integer
2016-02-06 16:18:04 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:04 QUERY  : Query result: 23
2016-02-06 16:18:04 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:04 QUERY  : Query result: integer
2016-02-06 16:18:04 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:04 QUERY  : Query result: 23
2016-02-06 16:18:04 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:04 QUERY  : Query result: timestamp without time zone
2016-02-06 16:18:04 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:04 QUERY  : Query result: 1114
2016-02-06 16:18:04 QUERY  : Scalar query (server): SELECT format_type(oid,0) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:04 QUERY  : Query result: timestamp(0) without time zone
2016-02-06 16:18:04 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:04 QUERY  : Query result: 1114
2016-02-06 16:18:04 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:05 QUERY  : Query result: integer
2016-02-06 16:18:05 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:06 QUERY  : Query result: 23
2016-02-06 16:18:06 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:06 QUERY  : Query result: integer
2016-02-06 16:18:06 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:06 QUERY  : Query result: 23
2016-02-06 16:18:06 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:07 QUERY  : Query result: integer
2016-02-06 16:18:07 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:07 QUERY  : Query result: 23
2016-02-06 16:18:07 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:07 QUERY  : Query result: boolean
2016-02-06 16:18:07 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:07 QUERY  : Query result: 16
2016-02-06 16:18:07 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 20
2016-02-06 16:18:07 QUERY  : Query result: bigint
2016-02-06 16:18:07 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=20
2016-02-06 16:18:07 QUERY  : Query result: 20
2016-02-06 16:18:07 QUERY  : Scalar query (server): SELECT format_type(oid,259) as typname FROM pg_type WHERE oid = 1043
2016-02-06 16:18:07 QUERY  : Query result: character varying(255)
2016-02-06 16:18:07 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1043
2016-02-06 16:18:08 QUERY  : Query result: 1043
2016-02-06 16:18:08 QUERY  : Scalar query (server): SELECT format_type(oid,259) as typname FROM pg_type WHERE oid = 1043
2016-02-06 16:18:08 QUERY  : Query result: character varying(255)
2016-02-06 16:18:08 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1043
2016-02-06 16:18:08 QUERY  : Query result: 1043
2016-02-06 16:18:08 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:08 QUERY  : Query result: timestamp without time zone
2016-02-06 16:18:08 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:08 QUERY  : Query result: 1114
2016-02-06 16:18:08 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:08 QUERY  : Query result: integer
2016-02-06 16:18:08 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:08 QUERY  : Query result: 23
2016-02-06 16:18:08 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:09 QUERY  : Query result: integer
2016-02-06 16:18:09 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:09 QUERY  : Query result: 23
2016-02-06 16:18:09 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:09 QUERY  : Query result: boolean
2016-02-06 16:18:09 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:09 QUERY  : Query result: 16
2016-02-06 16:18:09 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:09 QUERY  : Query result: integer
2016-02-06 16:18:09 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:09 QUERY  : Query result: 23
2016-02-06 16:18:09 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:09 QUERY  : Query result: integer
2016-02-06 16:18:09 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:09 QUERY  : Query result: 23
2016-02-06 16:18:09 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:10 QUERY  : Query result: boolean
2016-02-06 16:18:10 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:10 QUERY  : Query result: 16
2016-02-06 16:18:10 QUERY  : Scalar query (server): SELECT format_type(oid,259) as typname FROM pg_type WHERE oid = 1043
2016-02-06 16:18:10 QUERY  : Query result: character varying(255)
2016-02-06 16:18:10 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1043
2016-02-06 16:18:10 QUERY  : Query result: 1043
2016-02-06 16:18:11 QUERY  : Scalar query (server): SELECT format_type(oid,259) as typname FROM pg_type WHERE oid = 1043
2016-02-06 16:18:11 QUERY  : Query result: character varying(255)
2016-02-06 16:18:11 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1043
2016-02-06 16:18:11 QUERY  : Query result: 1043
2016-02-06 16:18:11 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:11 QUERY  : Query result: timestamp without time zone
2016-02-06 16:18:11 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:12 QUERY  : Query result: 1114
2016-02-06 16:18:12 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:12 QUERY  : Query result: timestamp without time zone
2016-02-06 16:18:12 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:12 QUERY  : Query result: 1114
2016-02-06 16:18:12 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:12 QUERY  : Query result: timestamp without time zone
2016-02-06 16:18:12 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:12 QUERY  : Query result: 1114
2016-02-06 16:18:12 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:12 QUERY  : Query result: boolean
2016-02-06 16:18:12 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:12 QUERY  : Query result: 16
2016-02-06 16:18:12 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:12 QUERY  : Query result: integer
2016-02-06 16:18:12 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:13 QUERY  : Query result: 23
2016-02-06 16:18:13 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:13 QUERY  : Query result: integer
2016-02-06 16:18:13 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:13 QUERY  : Query result: 23
2016-02-06 16:18:13 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:13 QUERY  : Query result: boolean
2016-02-06 16:18:13 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:13 QUERY  : Query result: 16
2016-02-06 16:18:13 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:13 QUERY  : Query result: integer
2016-02-06 16:18:13 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:13 QUERY  : Query result: 23
2016-02-06 16:18:13 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:13 QUERY  : Query result: integer
2016-02-06 16:18:13 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:14 QUERY  : Query result: 23
2016-02-06 16:18:14 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:14 QUERY  : Query result: boolean
2016-02-06 16:18:14 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:14 QUERY  : Query result: 16
2016-02-06 16:18:14 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:14 QUERY  : Query result: integer
2016-02-06 16:18:14 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:14 QUERY  : Query result: 23
2016-02-06 16:18:14 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:15 QUERY  : Query result: timestamp without time zone
2016-02-06 16:18:15 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:15 QUERY  : Query result: 1114
2016-02-06 16:18:15 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:15 QUERY  : Query result: integer
2016-02-06 16:18:15 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:16 QUERY  : Query result: 23
2016-02-06 16:18:16 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:16 QUERY  : Query result: integer
2016-02-06 16:18:16 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:16 QUERY  : Query result: 23
2016-02-06 16:18:16 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:16 QUERY  : Query result: integer
2016-02-06 16:18:16 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:16 QUERY  : Query result: 23
2016-02-06 16:18:16 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:16 QUERY  : Query result: integer
2016-02-06 16:18:16 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:16 QUERY  : Query result: 23
2016-02-06 16:18:16 QUERY  : Scalar query (server): SELECT format_type(oid,259) as typname FROM pg_type WHERE oid = 1043
2016-02-06 16:18:17 QUERY  : Query result: character varying(255)
2016-02-06 16:18:17 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1043
2016-02-06 16:18:17 QUERY  : Query result: 1043
2016-02-06 16:18:17 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:17 QUERY  : Query result: integer
2016-02-06 16:18:17 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:17 QUERY  : Query result: 23
2016-02-06 16:18:17 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:17 QUERY  : Query result: boolean
2016-02-06 16:18:17 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:17 QUERY  : Query result: 16
2016-02-06 16:18:17 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:17 QUERY  : Query result: integer
2016-02-06 16:18:17 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:18 QUERY  : Query result: 23
2016-02-06 16:18:18 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:18 QUERY  : Query result: integer
2016-02-06 16:18:18 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:18 QUERY  : Query result: 23
2016-02-06 16:18:18 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:18 QUERY  : Query result: integer
2016-02-06 16:18:18 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:18 QUERY  : Query result: 23
2016-02-06 16:18:18 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:18 QUERY  : Query result: timestamp without time zone
2016-02-06 16:18:18 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:18 QUERY  : Query result: 1114
2016-02-06 16:18:18 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 23
2016-02-06 16:18:18 QUERY  : Query result: integer
2016-02-06 16:18:18 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=23
2016-02-06 16:18:19 QUERY  : Query result: 23
2016-02-06 16:18:19 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:19 QUERY  : Query result: boolean
2016-02-06 16:18:19 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:19 QUERY  : Query result: 16
2016-02-06 16:18:19 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:19 QUERY  : Query result: boolean
2016-02-06 16:18:19 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:19 QUERY  : Query result: 16
2016-02-06 16:18:19 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:19 QUERY  : Query result: timestamp without time zone
2016-02-06 16:18:19 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:19 QUERY  : Query result: 1114
2016-02-06 16:18:19 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 20
2016-02-06 16:18:19 QUERY  : Query result: bigint
2016-02-06 16:18:19 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=20
2016-02-06 16:18:20 QUERY  : Query result: 20
2016-02-06 16:18:20 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 16
2016-02-06 16:18:20 QUERY  : Query result: boolean
2016-02-06 16:18:20 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=16
2016-02-06 16:18:20 QUERY  : Query result: 16
2016-02-06 16:18:20 QUERY  : Scalar query (server): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1114
2016-02-06 16:18:20 QUERY  : Query result: timestamp without time zone
2016-02-06 16:18:20 QUERY  : Scalar query (server): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1114
2016-02-06 16:18:20 QUERY  : Query result: 1114
10
Vlad

_pgadmin.log_からの抽出は、結果の各出力列について、pgadminがカタログに対して2つのクエリを実行することを示しています。1つはoidから型のフォーマットされた名前を取得し、潜在的な基本型を取得する。

あなたの抽出では、私が正しく数えている場合、そのようなクエリの総数は_106_のようです。

_148 ms_のping時間から、サーバーへの往復の最小時間は_148 ms_であると仮定します。したがって、この一連のクエリにかかる最小時間は_148 x 106 = 15688 ms_、または_15.6 s_になります。

一方、コマンドラインpsqlクライアントはこれらのクエリを実行しないため、pgadminの少なくとも_15.6_秒前に終了することが期待できます。

私はpgadminでそれを無効にするオプションを知りません。開発者に尋ねるか、最新バージョンがあるかどうかを確認することをお勧めしますが、昨年と同様の質問がメーリングリストで行われ、どうやら応答:

長いクエリ結果のレンダリング (pgadmin-supportアーカイブ内)。

これは、pgAdminの残念な実装の詳細です。 IN(...)構文または配列で渡されるタイプOIDのリストを使用して、単一のクエリですべての結果を取得できます。また、これらの結果をキャッシュし、すでに確認したOIDでクエリを繰り返すこともできません。

6
Daniel Vérité