|
Facebook Joinc ±×·ì
Joinc QA »çÀÌÆ®
joinc´Â Firefox¿Í chrome¿¡¼ Å×½ºÆ® Çß½À´Ï´Ù. IE¿¡¼´Â Å×À̺íÀÌ ±úÁö°Å³ª À̹ÌÁö°¡ º¸ÀÌÁö ¾ÊÀ» ¼ö ÀÖ½À´Ï´Ù. ƯÈ÷ ±¸±Û DocsÀ̹ÌÁöÀÇ °æ¿ì ¿¢¹Úó¸®µÉ ¼ö ÀÖ½À´Ï´Ù.
¹è¿Ä÷³À» ÀÌ¿ëÇÑ ÀϹÝÀûÀÎ Å×ÀÌºí ¼³°è
ÀÛ¼ºÀÚ: ½Å±â¹è(¼ÒŸ) nonun@nate.com
1 ½Ã½ºÅÛ Ä«Å»·Î±× Å×À̺íµé
nonun=# \dS
List of relations
Schema | Name | Type | Owner
------------+--------------------------+---------+----------
pg_catalog | pg_aggregate | table | postgres
pg_catalog | pg_am | table | postgres
pg_catalog | pg_amop | table | postgres
pg_catalog | pg_amproc | table | postgres
pg_catalog | pg_attrdef | table | postgres
pg_catalog | pg_attribute | table | postgres
pg_catalog | pg_cast | table | postgres
pg_catalog | pg_class | table | postgres
pg_catalog | pg_constraint | table | postgres
pg_catalog | pg_conversion | table | postgres
pg_catalog | pg_database | table | postgres
pg_catalog | pg_depend | table | postgres
pg_catalog | pg_description | table | postgres
pg_catalog | pg_group | table | postgres
pg_catalog | pg_index | table | postgres
pg_catalog | pg_indexes | view | postgres
pg_catalog | pg_inherits | table | postgres
pg_catalog | pg_language | table | postgres
pg_catalog | pg_largeobject | table | postgres
pg_catalog | pg_listener | table | postgres
pg_catalog | pg_locks | view | postgres
pg_catalog | pg_namespace | table | postgres
pg_catalog | pg_opclass | table | postgres
pg_catalog | pg_operator | table | postgres
pg_catalog | pg_proc | table | postgres
pg_catalog | pg_rewrite | table | postgres
pg_catalog | pg_rules | view | postgres
pg_catalog | pg_settings | view | postgres
pg_catalog | pg_shadow | table | postgres
pg_catalog | pg_stat_activity | view | postgres
pg_catalog | pg_stat_all_indexes | view | postgres
pg_catalog | pg_stat_all_tables | view | postgres
pg_catalog | pg_stat_database | view | postgres
pg_catalog | pg_stat_sys_indexes | view | postgres
pg_catalog | pg_stat_sys_tables | view | postgres
pg_catalog | pg_stat_user_indexes | view | postgres
pg_catalog | pg_stat_user_tables | view | postgres
pg_catalog | pg_statio_all_indexes | view | postgres
pg_catalog | pg_statio_all_sequences | view | postgres
pg_catalog | pg_statio_all_tables | view | postgres
pg_catalog | pg_statio_sys_indexes | view | postgres
pg_catalog | pg_statio_sys_sequences | view | postgres
pg_catalog | pg_statio_sys_tables | view | postgres
pg_catalog | pg_statio_user_indexes | view | postgres
pg_catalog | pg_statio_user_sequences | view | postgres
pg_catalog | pg_statio_user_tables | view | postgres
pg_catalog | pg_statistic | table | postgres
pg_catalog | pg_stats | view | postgres
pg_catalog | pg_tables | view | postgres
pg_catalog | pg_trigger | table | postgres
pg_catalog | pg_type | table | postgres
pg_catalog | pg_user | view | postgres
pg_catalog | pg_views | view | postgres
pg_catalog | pg_xactlock | special | postgres
À̰͵éÀÌ ¸ðµÎ ºä´Â ¾Æ´Ï´Ù. \dS(½Ã½ºÅÛÅ×À̺íµé º¸´Â ¸í·É¾î) ÇØº¸¸é 3°¡Áö Á¾·ùÀÇ ¸ñ·ÏÀÌ ³ª¿Â´Ù. table, view, special ÀÌ´Ù.
»ç½Ç º»ÀÎÀÌ À̰͵éÀ» ¸ðµÎ ÆÄ¾ÇÇϰí ÀÖ´Â°Ô ¾Æ´Ï±â ¶§¹®¿¡ ÀÌÁß¿¡ ÇØ¼® °¡´ÉÇÑ ¸î°¡Áö view¸¦ Áß½ÉÀ¸·Î ¼³¸íÇϰڴÙ.
½Ã½ºÅÛ Ä«Å»·Î±× ºä¸¸ º¸´Â ¹æ¹ýÀº \dSv À̰í Å×ÀÌºí¸¸ º¸´Â ¹ýÀº \dSt ÀÌ´Ù. Âü°íÇϽöó.
2 ½Ã½ºÅÛ Ä«Å»·Î±× ºä
2.1 pg_indexes
ÀÌ ºä´Â ÇöÀç DBÀÇ ¸ðµç ½ºÅ°¸¶ÀÇ À妽ºÀÇ Á¤º¸¸¦ °¡Áö°í ÀÖ´Ù.
| schemaname | ½ºÅ°¸¶ |
| tablename | À妽º¿Í ÀÇÁ¸ °ü°è¿¡ ÀÖ´Â Å×À̺í |
| indexname | À妽ºÀÇ À̸§ |
| indexdef | À妽ºÀÇ DDL |
netitup=# \d+ pg_indexes
View "pg_catalog.pg_indexes"
Column | Type | Modifiers | Description
------------+------+-----------+-------------
schemaname | name | |
tablename | name | |
indexname | name | |
indexdef | text | |
View definition:
SELECT n.nspname AS schemaname, c.relname AS tablename, i.relname AS indexname, pg_get_indexdef(i.oid) AS indexdef
FROM pg_index x
JOIN pg_class c ON c.oid = x.indrelid
JOIN pg_class i ON i.oid = x.indexrelid
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'r'::"char" AND i.relkind = 'i'::"char";
2.2 pg_locks
netitup=# \d+ pg_locks
View "pg_catalog.pg_locks"
Column | Type | Modifiers | Description
-------------+---------+-----------+-------------
relation | oid | |
database | oid | |
transaction | xid | |
pid | integer | |
mode | text | |
granted | boolean | |
View definition:
SELECT l.relation, l."database", l."transaction", l.pid, l."mode", l.granted
FROM pg_lock_status() l(relation oid, "database" oid, "transaction" xid, pid integer, "mode" text, granted boolean);
2.3 pg_rules
ÀÌ ºä´Â ÇöÀç DBÀÇ ¸ðµç ½ºÅ°¸¶ÀÇ ·êÀÇ Á¤º¸¸¦ °¡Áö°í ÀÖ´Ù.
| schemaname | ½ºÅ°¸¶ |
| tablename | À妽º¿Í ÀÇÁ¸ °ü°è¿¡ ÀÖ´Â Å×À̺í |
| rulename | ·êÀÇ À̸§ |
| definition | ·êÀÇ DDL |
netitup=# \d+ pg_rules
View "pg_catalog.pg_rules"
Column | Type | Modifiers | Description
------------+------+-----------+-------------
schemaname | name | |
tablename | name | |
rulename | name | |
definition | text | |
View definition:
SELECT n.nspname AS schemaname, c.relname AS tablename, r.rulename, pg_get_ruledef(r.oid) AS definition
FROM pg_rewrite r
JOIN pg_class c ON c.oid = r.ev_class
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE r.rulename <> '_RETURN'::name;
2.4 pg_settings
ÀÌ ºä´Â ¼³Á¤¿¡ ´ëÇÑ Á¤º¸¸¦ °¡Áö°í ÀÖ´Ù.
| name | ¼³Á¤Ç׸ñ |
| setting | ÇöÀç ¼³Á¤ |
| context | ¼³Á¤À» º¯°æÇÒ ¼ö ÀÖ´Â ±ÇÇÑ, ÇÁ·Î¼¼½º¿¡ ´ëÇÑ Á¤º¸ (¿¹: user, postmaster, sighup µî) |
| vartype | ¼³Á¤ÀÇ µ¥ÀÌÅÍ Å¸ÀÔ |
| source | ÇöÀçÀÇ ¼³Á¤ÀÌ ¼¼ÆÃµÈ °æ·Î (¿¹: default, configuration file µî) |
| min_val | °ªÀÇ ÃÖ¼Ò ¹üÀ§ |
| max_val | °ªÀÇ ÃÖ´ë ¹üÀ§ |
netitup=# \d+ pg_settings
View "pg_catalog.pg_settings"
Column | Type | Modifiers | Description
---------+------+-----------+-------------
name | text | |
setting | text | |
context | text | |
vartype | text | |
source | text | |
min_val | text | |
max_val | text | |
View definition:
SELECT a.name, a.setting, a.context, a.vartype, a.source, a.min_val, a.max_val
FROM pg_show_all_settings() a(name text, setting text, context text, vartype text, source text, min_val text, max_val text);
Rules: pg_settings_u,
pg_settings_n
2.5 pg_stat_activity
- ÀÌ ºä´Â ÇöÀç »óÅ¿¡ ´ëÇÑ Á¤º¸¸¦ °¡Áö°í ÀÖ´Ù.
| datid | oid |
| datname | DBÀ̸§ |
| procpid | ÇÁ·Î¼¼½º PID |
| usesysid | »ç¿ëÀÚÀÇ UID (pg_shadow¿¡ ¸í½Ã) |
| usename | »ç¿ëÀÚ À̸§ |
| current_query | ÇöÀç ó¸®ÁßÀÎ Äõ¸® |
| query_start | Äõ¸®°¡ ½ÃÀÛµÈ ½Ã°£ (ÀϰÍÀ¸·Î »ý°¢µÈ´Ù.) |
netitup=# \d+ pg_stat_activity
View "pg_catalog.pg_stat_activity"
Column | Type | Modifiers | Description
---------------+--------------------------+-----------+-------------
datid | oid | |
datname | name | |
procpid | integer | |
usesysid | integer | |
usename | name | |
current_query | text | |
query_start | timestamp with time zone | |
View definition:
SELECT d.oid AS datid, d.datname, pg_stat_get_backend_pid(s.backendid) AS procpid, pg_stat_get_backend_userid(s.backendid) AS usesysid,
u.usename, pg_stat_get_backend_activity(s.backendid) AS current_query, pg_stat_get_backend_activity_start(s.backendid) AS query_start
FROM pg_database d, ( SELECT pg_stat_get_backend_idset() AS backendid) s, pg_shadow u
WHERE pg_stat_get_backend_dbid(s.backendid) = d.oid AND pg_stat_get_backend_userid(s.backendid) = u.usesysid;
2.6 pg_stat_all_indexes
- ÀÌ ºä´Â ÇöÀç DBÀÇ ¸ðµç À妽º¿¡ ´ëÇÑ »óÅ Á¤º¸¸¦ °¡Áö°í ÀÖ´Ù.
| relid | oid |
| indexrelid | oid |
| schemaname | ½ºÅ°¸¶ À̸§ |
| relname | Å×À̺í À̸§ |
| indexrelname | À妽º À̸§ |
| idx_scan | ? bigint |
| idx_tup_read | ? bigint |
| idx_tup_fetch | ? bigint |
netitup=# \d+ pg_stat_all_indexes
View "pg_catalog.pg_stat_all_indexes"
Column | Type | Modifiers | Description
---------------+--------+-----------+-------------
relid | oid | |
indexrelid | oid | |
schemaname | name | |
relname | name | |
indexrelname | name | |
idx_scan | bigint | |
idx_tup_read | bigint | |
idx_tup_fetch | bigint | |
View definition:
SELECT c.oid AS relid, i.oid AS indexrelid, n.nspname AS schemaname, c.relname, i.relname AS indexrelname, pg_stat_get_numscans(i.oid) AS idx_scan,
pg_stat_get_tuples_returned(i.oid) AS idx_tup_read, pg_stat_get_tuples_fetched(i.oid) AS idx_tup_fetch
FROM pg_class c
JOIN pg_index x ON c.oid = x.indrelid
JOIN pg_class i ON i.oid = x.indexrelid
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'r'::"char";
2.7 pg_stat_all_tables
- ÀÌ ºä´Â ÇöÀç DBÀÇ ¸ðµç Å×ÀÌºí¿¡ ´ëÇÑ »óÅ Á¤º¸¸¦ °¡Áö°í ÀÖ´Ù.
| relid | oid |
| schemaname | ½ºÅ°¸¶ À̸§ |
| relname | Å×À̺í À̸§ |
| seq_scan | ? bigint |
| seq_tup_read | ? bigint |
| idx_scan | ? bigint |
| idx_tup_fetch | ? bigint |
| n_tup_ins | ? bigint |
| n_tup_upd | ? bigint |
| n_tup_del | ? bigint |
netitup=# \d+ pg_stat_all_tables
View "pg_catalog.pg_stat_all_tables"
Column | Type | Modifiers | Description
---------------+---------+-----------+-------------
relid | oid | |
schemaname | name | |
relname | name | |
seq_scan | bigint | |
seq_tup_read | bigint | |
idx_scan | numeric | |
idx_tup_fetch | numeric | |
n_tup_ins | bigint | |
n_tup_upd | bigint | |
n_tup_del | bigint | |
View definition:
SELECT c.oid AS relid, n.nspname AS schemaname, c.relname, pg_stat_get_numscans(c.oid) AS seq_scan,
pg_stat_get_tuples_returned(c.oid) AS seq_tup_read, sum(pg_stat_get_numscans(i.indexrelid)) AS idx_scan,
sum(pg_stat_get_tuples_fetched(i.indexrelid)) AS idx_tup_fetch, pg_stat_get_tuples_inserted(c.oid) AS n_tup_ins,
pg_stat_get_tuples_updated(c.oid) AS n_tup_upd, pg_stat_get_tuples_deleted(c.oid) AS n_tup_del
FROM pg_class c
LEFT JOIN pg_index i ON c.oid = i.indrelid
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'r'::"char"
GROUP BY c.oid, n.nspname, c.relname;
2.8 pg_stat_database
- ÀÌ ºä´Â ¸ðµç DB¿¡ ´ëÇÑ »óÅ Á¤º¸¸¦ °¡Áö°í ÀÖ´Ù.
| datid | oid |
| datname | DB À̸§ |
| numbackends | ÇöÀç ¿¸° ¼¼¼Ç ¼ö |
| xact_commit | ? bigint |
| xact_rollback | ? bigint |
| blks_read | ? bigint |
| blks_hit | ? bigint |
2.9 pg_stat_sys_indexes
netitup=# \d+ pg_stat_sys_indexes
View "pg_catalog.pg_stat_sys_indexes"
Column | Type | Modifiers | Description
---------------+--------+-----------+-------------
relid | oid | |
indexrelid | oid | |
schemaname | name | |
relname | name | |
indexrelname | name | |
idx_scan | bigint | |
idx_tup_read | bigint | |
idx_tup_fetch | bigint | |
View definition:
SELECT pg_stat_all_indexes.relid, pg_stat_all_indexes.indexrelid, pg_stat_all_indexes.schemaname, pg_stat_all_indexes.relname,
pg_stat_all_indexes.indexrelname, pg_stat_all_indexes.idx_scan, pg_stat_all_indexes.idx_tup_read, pg_stat_all_indexes.idx_tup_fetch
FROM pg_stat_all_indexes
WHERE pg_stat_all_indexes.schemaname = 'pg_catalog'::name OR pg_stat_all_indexes.schemaname = 'pg_toast'::name;
2.10 pg_stat_sys_tables
netitup=# \d+ pg_stat_sys_tables
View "pg_catalog.pg_stat_sys_tables"
Column | Type | Modifiers | Description
---------------+---------+-----------+-------------
relid | oid | |
schemaname | name | |
relname | name | |
seq_scan | bigint | |
seq_tup_read | bigint | |
idx_scan | numeric | |
idx_tup_fetch | numeric | |
n_tup_ins | bigint | |
n_tup_upd | bigint | |
n_tup_del | bigint | |
View definition:
SELECT pg_stat_all_tables.relid, pg_stat_all_tables.schemaname, pg_stat_all_tables.relname, pg_stat_all_tables.seq_scan,
pg_stat_all_tables.seq_tup_read, pg_stat_all_tables.idx_scan, pg_stat_all_tables.idx_tup_fetch, pg_stat_all_tables.n_tup_ins,
pg_stat_all_tables.n_tup_upd, pg_stat_all_tables.n_tup_del
FROM pg_stat_all_tables
WHERE pg_stat_all_tables.schemaname = 'pg_catalog'::name OR pg_stat_all_tables.schemaname = 'pg_toast'::name;
2.11 pg_stat_user_indexes
netitup=# \d+ pg_stat_user_indexes
View "pg_catalog.pg_stat_user_indexes"
Column | Type | Modifiers | Description
---------------+--------+-----------+-------------
relid | oid | |
indexrelid | oid | |
schemaname | name | |
relname | name | |
indexrelname | name | |
idx_scan | bigint | |
idx_tup_read | bigint | |
idx_tup_fetch | bigint | |
View definition:
SELECT pg_stat_all_indexes.relid, pg_stat_all_indexes.indexrelid, pg_stat_all_indexes.schemaname, pg_stat_all_indexes.relname,
pg_stat_all_indexes.indexrelname, pg_stat_all_indexes.idx_scan, pg_stat_all_indexes.idx_tup_read, pg_stat_all_indexes.idx_tup_fetch
FROM pg_stat_all_indexes
WHERE pg_stat_all_indexes.schemaname <> 'pg_catalog'::name AND pg_stat_all_indexes.schemaname <> 'pg_toast'::name;
2.12 pg_stat_user_tables
netitup=# \d+ pg_stat_user_tables
View "pg_catalog.pg_stat_user_tables"
Column | Type | Modifiers | Description
---------------+---------+-----------+-------------
relid | oid | |
schemaname | name | |
relname | name | |
seq_scan | bigint | |
seq_tup_read | bigint | |
idx_scan | numeric | |
idx_tup_fetch | numeric | |
n_tup_ins | bigint | |
n_tup_upd | bigint | |
n_tup_del | bigint | |
View definition:
SELECT pg_stat_all_tables.relid, pg_stat_all_tables.schemaname, pg_stat_all_tables.relname, pg_stat_all_tables.seq_scan,
pg_stat_all_tables.seq_tup_read, pg_stat_all_tables.idx_scan, pg_stat_all_tables.idx_tup_fetch, pg_stat_all_tables.n_tup_ins,
pg_stat_all_tables.n_tup_upd, pg_stat_all_tables.n_tup_del
FROM pg_stat_all_tables
WHERE pg_stat_all_tables.schemaname <> 'pg_catalog'::name AND pg_stat_all_tables.schemaname <> 'pg_toast'::name;
2.13 pg_statio_all_indexes
netitup=# \d+ pg_statio_all_indexes
View "pg_catalog.pg_statio_all_indexes"
Column | Type | Modifiers | Description
---------------+--------+-----------+-------------
relid | oid | |
indexrelid | oid | |
schemaname | name | |
relname | name | |
indexrelname | name | |
idx_blks_read | bigint | |
idx_blks_hit | bigint | |
View definition:
SELECT c.oid AS relid, i.oid AS indexrelid, n.nspname AS schemaname, c.relname, i.relname AS indexrelname,
pg_stat_get_blocks_fetched(i.oid) - pg_stat_get_blocks_hit(i.oid) AS idx_blks_read, pg_stat_get_blocks_hit(i.oid) AS idx_blks_hit
FROM pg_class c
JOIN pg_index x ON c.oid = x.indrelid
JOIN pg_class i ON i.oid = x.indexrelid
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'r'::"char";
2.14 pg_statio_all_sequences
netitup=# \d+ pg_statio_all_sequences
View "pg_catalog.pg_statio_all_sequences"
Column | Type | Modifiers | Description
------------+--------+-----------+-------------
relid | oid | |
schemaname | name | |
relname | name | |
blks_read | bigint | |
blks_hit | bigint | |
View definition:
SELECT c.oid AS relid, n.nspname AS schemaname, c.relname, pg_stat_get_blocks_fetched(c.oid) - pg_stat_get_blocks_hit(c.oid) AS blks_read,
pg_stat_get_blocks_hit(c.oid) AS blks_hit
FROM pg_class c
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'S'::"char";
2.15 pg_statio_all_tables
netitup=# \d+ pg_statio_all_tables
View "pg_catalog.pg_statio_all_tables"
Column | Type | Modifiers | Description
-----------------+---------+-----------+-------------
relid | oid | |
schemaname | name | |
relname | name | |
heap_blks_read | bigint | |
heap_blks_hit | bigint | |
idx_blks_read | numeric | |
idx_blks_hit | numeric | |
toast_blks_read | bigint | |
toast_blks_hit | bigint | |
tidx_blks_read | bigint | |
tidx_blks_hit | bigint | |
View definition:
SELECT c.oid AS relid, n.nspname AS schemaname, c.relname, pg_stat_get_blocks_fetched(c.oid) - pg_stat_get_blocks_hit(c.oid) AS heap_blks_read,
pg_stat_get_blocks_hit(c.oid) AS heap_blks_hit, sum(pg_stat_get_blocks_fetched(i.indexrelid) - pg_stat_get_blocks_hit(i.indexrelid)) AS idx_blks_read,
sum(pg_stat_get_blocks_hit(i.indexrelid)) AS idx_blks_hit, pg_stat_get_blocks_fetched(t.oid) - pg_stat_get_blocks_hit(t.oid) AS toast_blks_read,
pg_stat_get_blocks_hit(t.oid) AS toast_blks_hit, pg_stat_get_blocks_fetched(x.oid) - pg_stat_get_blocks_hit(x.oid) AS tidx_blks_read,
pg_stat_get_blocks_hit(x.oid) AS tidx_blks_hit
FROM pg_class c
LEFT JOIN pg_index i ON c.oid = i.indrelid
LEFT JOIN pg_class t ON c.reltoastrelid = t.oid
LEFT JOIN pg_class x ON t.reltoastidxid = x.oid
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'r'::"char"
GROUP BY c.oid, n.nspname, c.relname, t.oid, x.oid;
2.16 pg_statio_sys_indexes
netitup=# \d+ pg_statio_sys_indexes
View "pg_catalog.pg_statio_sys_indexes"
Column | Type | Modifiers | Description
---------------+--------+-----------+-------------
relid | oid | |
indexrelid | oid | |
schemaname | name | |
relname | name | |
indexrelname | name | |
idx_blks_read | bigint | |
idx_blks_hit | bigint | |
View definition:
SELECT pg_statio_all_indexes.relid, pg_statio_all_indexes.indexrelid, pg_statio_all_indexes.schemaname, pg_statio_all_indexes.relname,
pg_statio_all_indexes.indexrelname, pg_statio_all_indexes.idx_blks_read, pg_statio_all_indexes.idx_blks_hit
FROM pg_statio_all_indexes
WHERE pg_statio_all_indexes.schemaname = 'pg_catalog'::name OR pg_statio_all_indexes.schemaname = 'pg_toast'::name;
2.17 pg_statio_sys_sequences
netitup=# \d+ pg_statio_sys_sequences
View "pg_catalog.pg_statio_sys_sequences"
Column | Type | Modifiers | Description
------------+--------+-----------+-------------
relid | oid | |
schemaname | name | |
relname | name | |
blks_read | bigint | |
blks_hit | bigint | |
View definition:
SELECT pg_statio_all_sequences.relid, pg_statio_all_sequences.schemaname, pg_statio_all_sequences.relname,
pg_statio_all_sequences.blks_read, pg_statio_all_sequences.blks_hit
FROM pg_statio_all_sequences
WHERE pg_statio_all_sequences.schemaname = 'pg_catalog'::name OR pg_statio_all_sequences.schemaname = 'pg_toast'::name;
2.18 pg_statio_sys_tables
netitup=# \d+ pg_statio_sys_tables
View "pg_catalog.pg_statio_sys_tables"
Column | Type | Modifiers | Description
-----------------+---------+-----------+-------------
relid | oid | |
schemaname | name | |
relname | name | |
heap_blks_read | bigint | |
heap_blks_hit | bigint | |
idx_blks_read | numeric | |
idx_blks_hit | numeric | |
toast_blks_read | bigint | |
toast_blks_hit | bigint | |
tidx_blks_read | bigint | |
tidx_blks_hit | bigint | |
View definition:
SELECT pg_statio_all_tables.relid, pg_statio_all_tables.schemaname, pg_statio_all_tables.relname, pg_statio_all_tables.heap_blks_read,
pg_statio_all_tables.heap_blks_hit, pg_statio_all_tables.idx_blks_read, pg_statio_all_tables.idx_blks_hit, pg_statio_all_tables.toast_blks_read,
pg_statio_all_tables.toast_blks_hit, pg_statio_all_tables.tidx_blks_read, pg_statio_all_tables.tidx_blks_hit
FROM pg_statio_all_tables
WHERE pg_statio_all_tables.schemaname = 'pg_catalog'::name OR pg_statio_all_tables.schemaname = 'pg_toast'::name;
2.19 pg_statio_user_indexes
netitup=# \d+ pg_statio_user_indexes
View "pg_catalog.pg_statio_user_indexes"
Column | Type | Modifiers | Description
---------------+--------+-----------+-------------
relid | oid | |
indexrelid | oid | |
schemaname | name | |
relname | name | |
indexrelname | name | |
idx_blks_read | bigint | |
idx_blks_hit | bigint | |
View definition:
SELECT pg_statio_all_indexes.relid, pg_statio_all_indexes.indexrelid, pg_statio_all_indexes.schemaname, pg_statio_all_indexes.relname,
pg_statio_all_indexes.indexrelname, pg_statio_all_indexes.idx_blks_read, pg_statio_all_indexes.idx_blks_hit
FROM pg_statio_all_indexes
WHERE pg_statio_all_indexes.schemaname <> 'pg_catalog'::name AND pg_statio_all_indexes.schemaname <> 'pg_toast'::name;
2.20 pg_statio_user_sequences
netitup=# \d+ pg_statio_user_sequences
View "pg_catalog.pg_statio_user_sequences"
Column | Type | Modifiers | Description
------------+--------+-----------+-------------
relid | oid | |
schemaname | name | |
relname | name | |
blks_read | bigint | |
blks_hit | bigint | |
View definition:
SELECT pg_statio_all_sequences.relid, pg_statio_all_sequences.schemaname, pg_statio_all_sequences.relname, pg_statio_all_sequences.blks_read,
pg_statio_all_sequences.blks_hit
FROM pg_statio_all_sequences
WHERE pg_statio_all_sequences.schemaname <> 'pg_catalog'::name AND pg_statio_all_sequences.schemaname <> 'pg_toast'::name;
2.21 pg_statio_user_tables
netitup=# \d+ pg_statio_user_tables
View "pg_catalog.pg_statio_user_tables"
Column | Type | Modifiers | Description
-----------------+---------+-----------+-------------
relid | oid | |
schemaname | name | |
relname | name | |
heap_blks_read | bigint | |
heap_blks_hit | bigint | |
idx_blks_read | numeric | |
idx_blks_hit | numeric | |
toast_blks_read | bigint | |
toast_blks_hit | bigint | |
tidx_blks_read | bigint | |
tidx_blks_hit | bigint | |
View definition:
SELECT pg_statio_all_tables.relid, pg_statio_all_tables.schemaname, pg_statio_all_tables.relname, pg_statio_all_tables.heap_blks_read,
pg_statio_all_tables.heap_blks_hit, pg_statio_all_tables.idx_blks_read, pg_statio_all_tables.idx_blks_hit, pg_statio_all_tables.toast_blks_read,
pg_statio_all_tables.toast_blks_hit, pg_statio_all_tables.tidx_blks_read, pg_statio_all_tables.tidx_blks_hit
FROM pg_statio_all_tables
WHERE pg_statio_all_tables.schemaname <> 'pg_catalog'::name AND pg_statio_all_tables.schemaname <> 'pg_toast'::name;
2.22 pg_stats
netitup=# \d+ pg_stats
View "pg_catalog.pg_stats"
Column | Type | Modifiers | Description
-------------------+----------+-----------+-------------
schemaname | name | |
tablename | name | |
attname | name | |
null_frac | real | |
avg_width | integer | |
n_distinct | real | |
most_common_vals | anyarray | |
most_common_freqs | real[] | |
histogram_bounds | anyarray | |
correlation | real | |
View definition:
SELECT nspname AS schemaname, relname AS tablename, attname, stanullfrac AS null_frac, stawidth AS avg_width, stadistinct AS n_distinct,
CASE
WHEN 1 = stakind1 THEN stavalues1
WHEN 1 = stakind2 THEN stavalues2
WHEN 1 = stakind3 THEN stavalues3
WHEN 1 = stakind4 THEN stavalues4
ELSE NULL::"unknown"
END AS most_common_vals,
CASE
WHEN 1 = stakind1 THEN stanumbers1
WHEN 1 = stakind2 THEN stanumbers2
WHEN 1 = stakind3 THEN stanumbers3
WHEN 1 = stakind4 THEN stanumbers4
ELSE NULL::real[]
END AS most_common_freqs,
CASE
WHEN 2 = stakind1 THEN stavalues1
WHEN 2 = stakind2 THEN stavalues2
WHEN 2 = stakind3 THEN stavalues3
WHEN 2 = stakind4 THEN stavalues4
ELSE NULL::"unknown"
END AS histogram_bounds,
CASE
WHEN 3 = stakind1 THEN stanumbers1[1]
WHEN 3 = stakind2 THEN stanumbers2[1]
WHEN 3 = stakind3 THEN stanumbers3[1]
WHEN 3 = stakind4 THEN stanumbers4[1]
ELSE NULL::real
END AS correlation
FROM pg_statistic s
JOIN pg_class c ON c.oid = s.starelid
JOIN pg_attribute a ON c.oid = a.attrelid AND a.attnum = s.staattnum
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE has_table_privilege(c.oid, 'select'::text);
2.23 pg_tables
netitup=# \d+ pg_tables
View "pg_catalog.pg_tables"
Column | Type | Modifiers | Description
-------------+---------+-----------+-------------
schemaname | name | |
tablename | name | |
tableowner | name | |
hasindexes | boolean | |
hasrules | boolean | |
hastriggers | boolean | |
View definition:
SELECT n.nspname AS schemaname, c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, c.relhasindex AS hasindexes,
c.relhasrules AS hasrules, c.reltriggers > 0 AS hastriggers
FROM pg_class c
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'r'::"char";
netitup=# \d+ pg_user
View "pg_catalog.pg_user"
Column | Type | Modifiers | Description
-------------+---------+-----------+-------------
usename | name | |
usesysid | integer | |
usecreatedb | boolean | |
usesuper | boolean | |
usecatupd | boolean | |
passwd | text | |
valuntil | abstime | |
useconfig | text[] | |
View definition:
SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usesuper,
pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil, pg_shadow.useconfig
FROM pg_shadow;
2.25 pg_views
netitup=# \d+ pg_views
View "pg_catalog.pg_views"
Column | Type | Modifiers | Description
------------+------+-----------+-------------
schemaname | name | |
viewname | name | |
viewowner | name | |
definition | text | |
View definition:
SELECT n.nspname AS schemaname, c.relname AS viewname, pg_get_userbyid(c.relowner) AS viewowner, pg_get_viewdef(c.oid) AS definition
FROM pg_class c
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'v'::"char";
|
|