gp toolkit schema
Greenplum Database provides an administrative schema called gp_toolkit that you can use to query the system catalogs, log files, and operating environment for system status information. The gp_toolkit schema contains a number of views that you can access using SQL commands. The gp_toolkit schema is accessible to all database users, although some objects may require superuser permissions. For convenience, you may want to add the gp_toolkit schema to your schema search path.
For example:
=> ALTER ROLE myrole SET search_path TO myschema,gp_toolkit;
This documentation describes the most useful views in gp_toolkit. You may notice other objects (views, functions, and external tables) within the gp_toolkit schema that are not described in this documentation (these are supporting objects to the views described in this section).
gp_toolkit schema contains some important views that can be queried by DBA's to get important statistical information. We will discuss some of the frequently uses views in
gpadmin=# \dv gp_toolkit.*
List of relations
Schema | Name | Type | Owner | Storage
------------+----------------------------------------+------+---------+---------
gp_toolkit | __gp_fullname | view | gpadmin | none
gp_toolkit | __gp_is_append_only | view | gpadmin | none
gp_toolkit | __gp_number_of_segments | view | gpadmin | none
gp_toolkit | __gp_user_data_tables | view | gpadmin | none
gp_toolkit | __gp_user_data_tables_readable | view | gpadmin | none
gp_toolkit | __gp_user_namespaces | view | gpadmin | none
gp_toolkit | __gp_user_tables | view | gpadmin | none
gp_toolkit | gp_bloat_diag | view | gpadmin | none
gp_toolkit | gp_bloat_expected_pages | view | gpadmin | none
gp_toolkit | gp_locks_on_relation | view | gpadmin | none
gp_toolkit | gp_locks_on_resqueue | view | gpadmin | none
gp_toolkit | gp_log_command_timings | view | gpadmin | none
gp_toolkit | gp_log_database | view | gpadmin | none
gp_toolkit | gp_log_master_concise | view | gpadmin | none
gp_toolkit | gp_log_system | view | gpadmin | none
gp_toolkit | gp_param_settings_seg_value_diffs | view | gpadmin | none
gp_toolkit | gp_pgdatabase_invalid | view | gpadmin | none
gp_toolkit | gp_resq_activity | view | gpadmin | none
gp_toolkit | gp_resq_activity_by_queue | view | gpadmin | none
gp_toolkit | gp_resq_priority_backend | view | gpadmin | none
gp_toolkit | gp_resq_priority_statement | view | gpadmin | none
gp_toolkit | gp_resq_role | view | gpadmin | none
gp_toolkit | gp_resqueue_status | view | gpadmin | none
gp_toolkit | gp_roles_assigned | view | gpadmin | none
gp_toolkit | gp_size_of_all_table_indexes | view | gpadmin | none
gp_toolkit | gp_size_of_database | view | gpadmin | none
gp_toolkit | gp_size_of_index | view | gpadmin | none
gp_toolkit | gp_size_of_partition_and_indexes_disk | view | gpadmin | none
gp_toolkit | gp_size_of_schema_disk | view | gpadmin | none
gp_toolkit | gp_size_of_table_and_indexes_disk | view | gpadmin | none
gp_toolkit | gp_size_of_table_and_indexes_licensing | view | gpadmin | none
gp_toolkit | gp_size_of_table_disk | view | gpadmin | none
gp_toolkit | gp_size_of_table_uncompressed | view | gpadmin | none
gp_toolkit | gp_skew_coefficients | view | gpadmin | none
gp_toolkit | gp_skew_idle_fractions | view | gpadmin | none
gp_toolkit | gp_stats_missing | view | gpadmin | none
gp_toolkit | gp_table_indexes | view | gpadmin | none
gp_toolkit | gp_workfile_entries | view | gpadmin | none
gp_toolkit | gp_workfile_usage_per_query | view | gpadmin | none
gp_toolkit | gp_workfile_usage_per_segment | view | gpadmin | none
(40 rows)
gpadmin=#
gpadmin=# \df gp_toolkit.*
List of functions
Schema | Name | Result data type | Argument data types
| Type
------------+--------------------------+-------------------------------------+-------------------------------------------------------------------------------
------------------+--------
gp_toolkit | __gp_param_local_setting | SETOF gp_toolkit.gp_param_setting_t | character varying
| normal
gp_toolkit | __gp_skew_coefficients | SETOF gp_toolkit.gp_skew_analysis_t |
| normal
gp_toolkit | __gp_skew_idle_fractions | SETOF gp_toolkit.gp_skew_analysis_t |
| normal
gp_toolkit | gp_bloat_diag | record | btdrelpages integer, btdexppages integer, aotable boolean, OUT bltidx integer,
OUT bltdiag text | normal
gp_toolkit | gp_param_setting | SETOF gp_toolkit.gp_param_setting_t | character varying
| normal
gp_toolkit | gp_param_settings | SETOF gp_toolkit.gp_param_setting_t |
| normal
gp_toolkit | gp_skew_coefficient | record | targetoid oid, OUT skcoid oid, OUT skccoeff numeric
| normal
gp_toolkit | gp_skew_details | SETOF gp_toolkit.gp_skew_details_t | oid
| normal
gp_toolkit | gp_skew_idle_fraction | record | targetoid oid, OUT sifoid oid, OUT siffraction numeric
| normal
(9 rows)
sachi=#
External table "gp_toolkit.__gp_log_master_ext"
Column | Type | Modifiers
----------------+--------------------------+-----------
logtime | timestamp with time zone |
loguser | text |
logdatabase | text |
logpid | text |
logthread | text |
loghost | text |
logport | text |
logsessiontime | timestamp with time zone |
logtransaction | integer |
logsession | text |
logcmdcount | text |
logsegment | text |
logslice | text |
logdistxact | text |
loglocalxact | text |
logsubxact | text |
logseverity | text |
logstate | text |
logmessage | text |
logdetail | text |
loghint | text |
logquery | text |
logquerypos | integer |
logcontext | text |
logdebug | text |
logcursorpos | integer |
logfunction | text |
logfile | text |
logline | integer |
logstack | text |
Type: readable
Encoding: UTF8
Format type: csv
Format options: delimiter ',' null '' escape '"' quote '"'
Command: cat $GP_SEG_DATADIR/pg_log/*.csv
Execute on: master segment
External table "gp_toolkit.__gp_log_segment_ext"
Column | Type | Modifiers
----------------+--------------------------+-----------
logtime | timestamp with time zone |
loguser | text |
logdatabase | text |
logpid | text |
logthread | text |
loghost | text |
logport | text |
logsessiontime | timestamp with time zone |
logtransaction | integer |
logsession | text |
logcmdcount | text |
logsegment | text |
logslice | text |
logdistxact | text |
loglocalxact | text |
logsubxact | text |
logseverity | text |
logstate | text |
logmessage | text |
logdetail | text |
loghint | text |
logquery | text |
logquerypos | integer |
logcontext | text |
logdebug | text |
logcursorpos | integer |
logfunction | text |
logfile | text |
logline | integer |
logstack | text |
Type: readable
Encoding: UTF8
Format type: csv
Format options: delimiter ',' null '' escape '"' quote '"'
Command: cat $GP_SEG_DATADIR/pg_log/*.csv
Execute on: all segments
gpadmin=# \df gp_toolkit.*
List of functions
Schema | Name | Result data type | Argument dat
a types | Type
------------+---------------------------------+------------------------------------------+----------------------------------------------------------------------------------------
gp_toolkit | gp_param_setting | SETOF gp_toolkit.gp_param_setting_t | character varying | normal
gp_toolkit | gp_param_settings | SETOF gp_toolkit.gp_param_setting_t | | normal
gp_toolkit | gp_skew_coefficient | record | targetoid oid, OUT skcoid oid, OUT skccoeff numeric | normal
gp_toolkit | gp_skew_details | SETOF gp_toolkit.gp_skew_details_t | oid | normal
gp_toolkit | gp_skew_idle_fraction | record | targetoid oid, OUT sifoid oid, OUT siffraction numeric | normal
gp_toolkit | gp_workfile_cache_clear | SETOF integer | | normal
gp_toolkit | gp_workfile_cache_clear_segment | SETOF integer | content integer | normal
gp_toolkit | __gp_aocsseg | SETOF record | oid | normal
gp_toolkit | __gp_aocsseg_history | SETOF record | oid | normal
gp_toolkit | __gp_aocsseg_name | SETOF record | text | normal
gp_toolkit | __gp_aoseg_history | SETOF record | oid | normal
gp_toolkit | __gp_aoseg_name | SETOF record | text | normal
gp_toolkit | __gp_aovisimap | SETOF record | oid | normal
gp_toolkit | __gp_aovisimap_entry | SETOF record | oid | normal
gp_toolkit | __gp_aovisimap_entry_name | SETOF record | text | normal
gp_toolkit | __gp_aovisimap_hidden_info | SETOF record | oid | normal
gp_toolkit | __gp_aovisimap_hidden_info_name | SETOF record | text | normal
gp_toolkit | __gp_aovisimap_hidden_typed | SETOF gp_toolkit.__gp_aovisimap_hidden_t | oid | normal
gp_toolkit | __gp_aovisimap_name | SETOF record | text | normal
gp_toolkit | __gp_param_local_setting | SETOF gp_toolkit.gp_param_setting_t | character varying | normal
gp_toolkit | __gp_skew_coefficients | SETOF gp_toolkit.gp_skew_analysis_t | | normal
gp_toolkit | __gp_skew_idle_fractions | SETOF gp_toolkit.gp_skew_analysis_t | | normal
gp_toolkit | __gp_workfile_cache_clear_f | SETOF integer | content integer | normal
gp_toolkit | __gp_workfile_entries_f | SETOF record | | normal
gp_toolkit | gp_bloat_diag | record | btdrelpages integer, btdexppages integer, aotable boolean, OUT bltidx integer, OUT bltd iag text | normal
gp_toolkit | __gp_aovisimap_compaction_info | SETOF record | ao_oid oid, OUT content integer, OUT datafile integer, OUT compaction_possible boolean, OUT hidden_tupcount bigint, OUT total_tupcount bigint, OUT percent_hidden numeric | normal
(26 rows)
gpadmin=#
gp_toolkit.gp_param_settings_seg_value_diffs - Jan 20, 2014 10:13:54 PM
gp_toolkit.gp_log_system - Jan 20, 2014 9:55:36 PM
gp_toolkit.gp_log_master_concise - Jan 20, 2014 9:54:36 PM
gp_toolkit.gp_log_database - Jan 20, 2014 9:53:52 PM
gp_log_command_timings - Jan 20, 2014 9:52:45 PM
gp_toolkit.gp_locks_on_resqueue - Jan 20, 2014 8:54:25 PM
gp_toolkit.gp_locks_on_relation - Jan 20, 2014 8:47:44 PM
gp_toolkit.gp_stats_missing - Jan 20, 2014 8:9:4 PM
gp_toolkit.gp_bloat_diag - Jan 20, 2014 8:5:58 PM