Description: Checks whether the connection data buffered in the pool is consistent with pgxc_node.
Return type: boolean
Description: Updates the connection information buffered in the pool.
Return type: boolean
Description: Locks the cluster before backup. Backup is performed to restore data on new nodes.
Return type: boolean
pgxc_lock_for_backup locks a cluster before gs_dump or gs_dumpall is used to back up the cluster. After a cluster is locked, operations changing the system structure are not allowed. This function does not affect DML statements.
Description: Clears invalid backend threads on a CN. (These backend threads hold invalid pooler connections to standby DNs.)
Return type: record
Description: queries the memory usage of all nodes.
Return type: record
Description: queries the percentage of table data among all nodes.
Parameter: Indicates that the type of the name of the to-be-queried table is text.
Return type: record
Description: Queries the proportion of column data distributed on each node based on the hash distribution rule. The results are sorted based on the data volumes of the nodes.
Parameters: table_name indicates a table name, column_name indicates a column name, and row_num indicates that all data in the current column is returned. The default value is 0. A value other than 0 indicates the number of data records whose statistics are sampled. (Records are randomly sampled.)
Return type: record
Example:
Distribute data by hash based on the a column in the tx table. Seven records are distributed on DN 1, two records on DN 2, and one record on DN 0.
1 2 3 4 5 6 7 | SELECT * FROM table_skewness('tx','a'); seqnum | num | ratio --------+-----+---------- 1 | 7 | 70.000% 2 | 2 | 20.000% 0 | 1 | 10.000% (3 row) |
Description: Calculates the bucket distribution index for the records concatenated using the columns in a specified table.
Parameters: data_row indicates the record concatenated using columns in the specified table. locatorType indicates the distribution rule. You are advised to set locatorType to H, indicating hash distribution.
Return type: smallint
Example:
Calculates the bucket distribution index based on the hash distribution rule for the records combined concatenated using column a in the tx table.
1 2 3 4 5 6 7 8 9 | select a, table_data_skewness(row(a), 'H') from tx; a | table_data_skewness ---+--------------------- 3 | 0 6 | 2 7 | 2 4 | 1 5 | 1 (5 rows) |
Description: queries the storage space occupied by a specified table on each node.
Parameter: Indicates that the types of the schema name and table name for the table to be queried are both text.
Return type: record
Description: queries the storage space occupied by a specified table on each node.
Parameter: indicates the name or OID of the table to be queried. The table name can be defined by the schema name. Parameter type: regclass
Return type: record
Description: queries the storage distribution of all tables in the current database.
Return type: record
Description: queries the storage space occupied by a specified table on each node.
Return type: record
Name |
Type |
Description |
---|---|---|
schemaname |
name |
Schema name |
tablename |
name |
Table name |
relkind |
character |
Type.
|
nodename |
name |
Node name |
dnsize |
bigint |
Storage space of the table on the node, in bytes. |
Description: quickly queries the storage distribution of all tables in the current database.
Return type: record
Name |
Type |
Description |
---|---|---|
schemaname |
name |
Schema name |
tablename |
name |
Table name |
relkind |
character |
Type of the table. i: index; r: table. |
nodename |
name |
Node name |
dnsize |
bigint |
Storage space of the table on the node, in bytes. |
Description: Obtains the seed value of the previous query statement (internal use).
Return type: integer
Description: Obtains the environment variable information about the current node.
Return type: record
Description: Provides information about the status of all threads under the current node.
Return type: record
Description: Provides information about the status of threads under all normal nodes in a cluster.
Return type: record
Description: Provides statistics on the number of SELECT/UPDATE/INSERT/DELETE/MERGE INTO statements executed by all users on the current node, response time, and the number of DDL, DML, and DCL statements.
Return type: record
Description: Provides statistics on the number of SELECT/UPDATE/INSERT/DELETE/MERGE INTO statements executed by all users on all nodes of the current cluster, response time, and the number of DDL, DML, and DCL statements.
Return type: record
Description: Provides statistics on the number of SELECT/UPDATE/INSERT/DELETE statements executed in all workload Cgroup on all CNs of the current cluster and the number of DDL, DML, and DCL statements.
Return type: record
Description: Provides statistics on response time of SELECT/UPDATE/INSERT/DELETE statements executed in all workload Cgroup on all CNs of the current cluster.
Return type: record
Description: Provides information about Unique SQL statistics collected on the current node. If the node is a CN, the system returns the complete information about the Unique SQL statistics collected on the CN. That is, the system collects and summarizes the information about the Unique SQL statistics on other CNs and DNs. If the node is a DN, the Unique SQL statistics on the DN is returned. For details, see the GS_INSTR_UNIQUE_SQL view.
Return type: record
Description: Clears collected Unique SQL statistics. The input parameters are described as follows:
Return type: bool
Description: Provides complete information about Unique SQL statistics collected on all CNs in a cluster. This function can be executed only on CNs.
Return type: record
Description: Provides complete information about Unique SQL statements collected on all CNs in the cluster, except the CN on which the function is being executed. This function can be executed only on CNs.
Return type: record
Description: Provides the environment variable information about all nodes in a cluster.
Return type: record
Description: Exchanges meta information of two tables or partitions. (This is only used for the redistribution tool. An error message is displayed when the function is directly used by users).
Return type: integer
Description: Creates the error table (public.pgxc_copy_error_log) required for creating the COPY FROM error tolerance mechanism.
Return type: boolean
Column |
Type |
Description |
---|---|---|
relname |
varchar |
Table name in the form of Schema name.Table name |
begintime |
timestamp with time zone |
Time when a data format error was reported |
filename |
varchar |
Name of the source data file where a data format error occurs |
rownum |
bigint |
Number of the row where a data format error occurs in a source data file |
rawrecord |
text |
Raw record of a data format error in the source data file To prevent a field from being too long, the length of the field cannot exceed 1024 bytes. |
detail |
text |
Error details |
columnname |
varchar |
Name of the column whose data format is incorrect in the data source file. Only 8.2.1.100 and later versions support this function. |
errcode |
varchar |
Error code corresponding to the error information. The sqlstate error code is used. Only 8.2.1.100 and later versions support this function. |
queryid |
bigint |
ID of the SQL statement for executing the Copy statement. It uniquely identifies an SQL statement. Only 8.2.1.100 and later versions support this function. |
Description: Provides the current load information about computing Node Groups on cloud.
Return type: record
Description: Queries for the blocking and waiting status of the backend threads and auxiliary threads in the current instance. For details about the returned results, see the PG_THREAD_WAIT_STATUS view. The input parameters are described as follows:
Return type: record
Description: Queries for the call hierarchy between threads generated by all SQL statements on each node in a cluster, as well as the block waiting status of each thread. For details about the returned results, see the PGXC_THREAD_WAIT_STATUS view. The type and meaning of the input parameter num_node_display are the same as those of the pg_stat_get_status function.
Return type: record
Description: Obtains the running status of the operating system on each node in a cluster. For details about the returned results, see "System Catalogs > System Views >PV_OS_RUN_INFO" in the Developer Guide.
Return type: record
Description: obtains the waiting status and events of the current instance. For details about the returned results, see "System Catalogs > System Views > GS_WAIT_EVENTS" in the Developer Guide. If the GUC parameter enable_track_wait_event is off, this function returns 0.
Return type: record
Description: queries statistics about waiting status and events on each node in a cluster. For details about the returned results, see "System Catalogs > System Views > PGXC_WAIT_EVENTS" in the Developer Guide. If the GUC parameter enable_track_wait_event is off, this function returns 0.
Return type: record
Description: queries statistics about backend write processes on each node in a cluster. For details about the returned results, see "System Catalogs > System Views > PG_STAT_BGWRITER" in the Developer Guide.
Return type: record
Description: queries information about the log synchronization status on each node in a cluster, such as the location where the logs are sent and received. For details about the returned results, see "System Catalogs > System Views > PG_STAT_REPLICATION" in the Developer Guide.
Return type: record
Description: queries the replication status on each DN in a cluster. For details about the returned results, see "System Catalogs > System Views > PG_REPLICATION_SLOTS" in the Developer Guide.
Return type: record
Description: queries information about runtime parameters on each node in a cluster. For details about the returned results, see "System Catalogs > System Views > PG_SETTINGS" in the Developer Guide.
Return type: record
Description: queries the running time statistics of each node in a cluster and the time consumed in each execution phase. For details about the returned results, see "System Catalogs > System Views > PV_INSTANCE_TIME" in the Developer Guide.
Return type: record
Description: queries Xlog redo statistics on the current node. For details about the returned results, see "System Catalogs > System Views > PV_REDO_STAT" in the Developer Guide.
Return type: record
Description: queries the Xlog redo statistics of each node in a cluster. For details about the returned results, see "System Catalogs > System Views > PV_REDO_STAT" in the Developer Guide.
Return type: record
Description: Obtains the disk I/O statistics of the current instance. For details about the returned results, see "System Catalogs > System Views > GS_REL_IOSTAT" in the Developer Guide.
Return type: record
Description: queries the disk I/O statistics on each node in a cluster. For details about the returned result, see "System Catalogs > System Views > GS_REL_IOSTAT" in the Developer Guide.
Return type: record
Description: Obtains the time when statistics of the current instance were reset.
Return type: timestamptz
Description: queries the time when the statistics of each node in a cluster are reset. For details about the returned result, see "System Catalogs > System Views > GS_NODE_STAT_RESET_TIME" in the Developer Guide.
Return type: record
If any of the preceding events occurs, GaussDB(DWS) will record the time when the statistics are reset. You can query the time using the get_node_stat_reset_time function.
Description: Runs a specified SQL query statement on a data instance of a specified type and returns the query result to the current CN. This function is supported in 8.1.2 or later.
The function has two parameters:
The first parameter specifies the instances on which the SQL statement is executed. Currently, the valid input parameters are dn, datanode, cn, coordinator, and all. Other values will cause function execution errors. dn and datanode indicate that the statement is executed on all DNs. cn and coordinator indicate that the statement is executed on all CNs. all indicates that the statement is executed on all CNs and DNs.
The second parameter specifies the verification of the objects queried by the SQL statement that is to be sent to a remote node for execution. User tables, distributed tables, and user-defined functions with multiple result sets are not supported.
Return type: record
SELECT * FROM pgxc_parallel_query('all', 'select node_name, db_name, thread_name, query_id, tid, lwtid, ptid, tlevel, smpid, wait_status, wait_event from pg_thread_wait_status') AS (node_name text, db_name text, thread_name text, query_id bigint, tid bigint, lwtid integer , ptid integer, tlevel integer , smpid integer, wait_status text, wait_event text);
SELECT * FROM pgxc_parallel_query('cn', 'UPDATE pg_partition SET relpages = 0') AS (updated bigint);
Description: Creates a performance data snapshot.
Return type: text
Description: kills the background snapshot thread. This function sends a command to the background snapshot thread and waits for the thread to stop.
The input parameter scope indicates the operation scope. Its value can be local or global.
Return type: none
Description: Creates a load analysis report.
The input parameters are described as follows:
Description: Queries a specified view in a specified database. The query results of some views vary depending on databases. For example, the global_table_stat view is used to query the statistics of a table. The results of querying this view vary because tables in different databases are different. The wdr_xdb_query function can access the database specified by db_name in the current connection and query the view specified by view_name in the database. The input parameters are described as follows:
The return value type is record. The first column is snapshot_id bigint, and the second column is db_name text. The names, types, and sequences of other columns are the same as those of the views specified by view_name.
Example:
1 2 | select snapshot_id, db_name, schemaname, relname, distribute_mode, seq_scan ,seq_tuple_read ,index_scan ,index_tuple_read ,tuple_inserted ,tuple_updated ,tuple_deleted ,tuple_hot_updated ,live_tuples ,dead_tuples from wdr_xdb_query('postgres'::text, 1, 'global_table_stat'::text) as i(snapshot_id bigint, db_name text, schemaname name, relname name, distribute_mode char, seq_scan bigint, seq_tuple_read bigint, index_scan bigint, index_tuple_read bigint, tuple_inserted bigint, tuple_updated bigint, tuplee_deleted bigint, tuple_hot_updated bigint, live_tuples bigint, dead_tuples bigint); |
Description: Forcibly clears VACUUM rewritten files in a specified column-store table to reclaim space.
Parameter: OID of a column-store table.
Return type: integer
Description: Forcibly clears VACUUM rewritten files in all specified column-store tables to reclaim space.
Return type: record
Description: Queries the number of empty CU files and the total number of CU files in a specified column-store table. This function is supported only in cluster 8.2.0 and later versions.
Parameter: Name of a column-store table.
Return type: int
Fields in the returned value:
Example:
1 2 3 4 5 | call get_col_file_info('t4'); total_file_num | empty_file_num ----------------+---------------- 10 | 7 (1 row) |
Description: Queries the number of empty CU files and the total number of CU files in all column-store tables. This function is supported only in cluster 8.2.0 and later versions.
Return type: record
Fields in the returned value:
Example:
1 2 3 4 5 6 7 | call get_all_col_file_info(); space_name | table_name | total_file_num | empty_file_num ------------+------------+----------------+---------------- public | t4 | 10 | 7 public | t2 | 1 | 1 public | t1 | 3 | 0 (3 rows) |
Description: Obtains the pg_class metadata related to all volatile temporary tables in the current session. This parameter is supported by version 8.2.0 or later clusters.
Return type: record
Fields in the returned value:
Description: Obtains the pg_class metadata related to a specified volatile temporary table in the current session. This parameter is supported by version 8.2.0 or later clusters.
Parameter: name of the volatile temporary table in the current session.
Return type: record
Fields in the returned value:
Example:
1 2 3 4 5 6 7 8 9 10 11 | SELECT * FROM get_volatile_pg_class('tx1'); oid | relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | reltoastidxid | reldeltarelid | reldeltaidx | relcudescrelid | relcudescidx | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasoids | relhaspkey | relhasrules | relhastriggers | relhassub class | relcmprs | relhasclusterkey | relrowmovement | parttype | relfrozenxid | relacl | reloptions | relreplident | relfrozenxid64 -------+---------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+---------------+---------------+ -------------+----------------+--------------+-------------+-------------+----------------+---------+----------+-----------+------------+------------+-------------+----------------+---------- ------+----------+------------------+----------------+----------+--------------+--------+----------------------------------+--------------+---------------- 16772 | tx1 | 16770 | 16774 | 0 | 10 | 0 | 16772 | 1665 | 0 | 0 | 0 | 16775 | 0 | 0 | 0 | 0 | 0 | f | f | v | r | 2 | 0 | f | f | f | f | f | 1 | f | f | n | 11815 | | {orientation=row,compression=no} | d | 11815 (1 row) |
Description: Obtains the pg_attribute metadata related to all volatile temporary tables in the current session. This parameter is supported by version 8.2.0 or later clusters.
Return type: record
Description: Obtains the pg_attribute metadata related to a specified volatile temporary table in the current session. This parameter is supported by version 8.2.0 or later clusters.
Parameter:
Return type: record
Fields in the returned value:
Example:
1 2 3 4 5 6 7 8 | SELECT * FROM get_volatile_pg_attribute('tx1', 'b'); attrelid | attname | atttypid | attstattarget | attlen | attnum | attndims | attcacheoff | atttypmod | attbyval | attstorage | attalign | attnotnull | atthasdef | attisdropped | attislocal | attcmprmode | attinhcount | attcollation | attacl | attoptions | attfdwoptions | attinitdefval | attkvtype ----------+---------+----------+---------------+--------+--------+----------+-------------+-----------+----------+------------+----------+------------+-----------+--------------+------------+ -------------+-------------+--------------+--------+------------+---------------+---------------+----------- 16772 | b | 25 | -1 | -1 | 2 | 0 | -1 | -1 | f | x | i | f | f | f | t | 127 | 0 | 100 | | | | | 0 (1 row) |
Description: Returns the relid list of tables to be published based on the publication name. This function is supported by clusters of version 8.2.0.100 or later.
Parameter: pubname
Return type: set of OID
Example:
1 2 3 4 5 6 | SELECT * FROM pg_get_publication_tables('mypub'); relid ------- 16757 16776 (2 rows) |
Description: Checks whether a table can be published. This function is supported by clusters of version 8.2.0.100 or later.
Parameter: relname
Return type: Boolean
Example:
1 2 3 4 5 | SELECT * FROM pg_relation_is_publishable('t1'); pg_relation_is_publishable ---------------------------- t (1 row) |
Description: Queries the CU information of a column-store table. The CU information of each partition is collected separately. This function is supported by clusters of version 8.2.0.100 or later.
Parameters: schema name (mandatory), table name (mandatory), threshold for the number of rows in a small CU (optional, 200 by default, ranging from 1 to 60000, and percentage threshold for deleting dirty CUs (optional, 70 by default, ranging from 1 to 100)
Return type: record
Fields in the returned value:
node_name: DN name.
part_name: partition name. This column is empty for a common table.
zero_size_cu_count: number of CUs whose cuSize is 0 and number of rows is less than or equal to row_count.
small_cu_count: number of CUs whose cuSize is ALIGNOF_CUSIZE(8192) and number of rows is less than or equal to row_count.
dirty_cu_count: number of CUs whose deadtupe percentage exceeds dirty_percent due to deletion.
total_cu_count: total number of CUs.
small_cu_size: total size of 8 KB CUs.
total_cu_size: total CU size.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | SELECT * FROM get_col_cu_info('public','hs_part'); node_name | part_name | zero_size_cu_count | small_cu_count | dirty_cu_count | total_cu_count | small_cu_size | total_cu_size -----------+-----------+--------------------+----------------+----------------+----------------+---------------+--------------- dn_1 | p1 | 3 | 0 | 0 | 3 | 0 bytes | 0 bytes dn_1 | p2 | 3 | 0 | 0 | 3 | 0 bytes | 0 bytes dn_1 | p3 | 3 | 0 | 0 | 3 | 0 bytes | 0 bytes (3 rows) SELECT * FROM get_col_cu_info('public','hs_part', 200, 90); node_name | part_name | zero_size_cu_count | small_cu_count | dirty_cu_count | total_cu_count | small_cu_size | total_cu_size -----------+-----------+--------------------+----------------+----------------+----------------+---------------+--------------- dn_1 | p1 | 3 | 0 | 0 | 3 | 0 bytes | 0 bytes dn_1 | p2 | 3 | 0 | 0 | 3 | 0 bytes | 0 bytes dn_1 | p3 | 3 | 0 | 0 | 3 | 0 bytes | 0 bytes (3 rows) |
Description: Queries the vacuum information of a column-store table. The vacuum information of each partition is collected separately. This function is supported by clusters of version 8.2.0.100 or later.
Parameters: schema name (mandatory), table name (mandatory), and whether to forcibly obtain the precise number of files that can be cleared (mandatory, false by default)
Return type: record
Fields in the returned value:
node_name: DN name.
part_name: partition name. This column is empty for a common table.
total_file_num: total number of CU files.
rewritable_file_num: number of files that can be rewritten but have not been rewritten.
rewritten_file_num: number of files that have been rewritten but have not been cleared. The value is obtained from data in the memory. If the memory data is lost due to reasons such as restart, you can set force_get_rewritten_file_num=true to forcibly obtain the accurate number of files that can be cleared.
empty_file_num: number of cleared files.
Example:
1 2 3 4 5 6 7 8 9 10 | SELECT * FROM get_col_file_vacuum_info('public','pa',false); node_name | part_name | total_file_num | rewritable_file_num | rewritten_file_num | empty_file_num -----------+-----------+----------------+---------------------+--------------------+---------------- datanode1 | pa1 | 1 | 0 | 0 | 0 datanode1 | pa2 | 1 | 0 | 0 | 0 datanode2 | pa1 | 1 | 0 | 0 | 0 datanode2 | pa2 | 1 | 0 | 0 | 0 datanode3 | pa1 | 1 | 0 | 0 | 0 datanode3 | pa2 | 1 | 0 | 0 | 0 (6 rows) |
Description: Queries the vacuum information of a column-store table. The vacuum information of each partition is collected separately. This function is supported by clusters of version 8.2.0.100 or later.
Parameters: schema name (mandatory), table name (mandatory), and colvacuum_threshold_scale_factor (mandatory. The value range is 0 to 100, indicating the ratio of dead tuples.)
Return type: record
Return value:
node_name: DN name.
part_name: partition name. This column is empty for a common table.
total_file_num: total number of CU files.
rewritable_file_num: number of files that can be rewritten but have not been rewritten.
rewritten_file_num: number of files that have been rewritten but have not been cleared. The value is obtained from data in the memory. If the memory data is lost due to reasons such as restart, you can set force_get_rewritten_file_num=true to forcibly obtain the accurate number of files that can be cleared.
empty_file_num: number of cleared files.
Example:
1 2 3 4 5 6 7 8 9 10 | SELECT * FROM get_col_file_vacuum_info('public','pa',10); node_name | part_name | total_file_num | rewritable_file_num | rewritten_file_num | empty_file_num -----------+-----------+----------------+---------------------+--------------------+---------------- datanode1 | pa1 | 1 | 0 | 0 | 0 datanode1 | pa2 | 1 | 0 | 0 | 0 datanode2 | pa1 | 1 | 0 | 0 | 0 datanode2 | pa2 | 1 | 0 | 0 | 0 datanode3 | pa1 | 1 | 0 | 0 | 0 datanode3 | pa2 | 1 | 0 | 0 | 0 (6 rows) |
Description: Queries the CU information of all column-store tables in the database. This function is supported by clusters of version 8.2.0.100 or later.
Parameter: threshold for the number of rows in a small CU (optional, 200 by default, and ranging from 1 to 60000)
Return type: record
Fields in the returned value:
node_name: DN name.
schema_name: schema name.
table_name: table name.
zero_size_cu_count: number of CUs whose cuSize is 0 and number of rows is less than or equal to row_count.
small_cu_count: number of CUs whose cuSize is ALIGNOF_CUSIZE(8192) and number of rows is less than or equal to row_count.
total_cu_count: total number of CUs.
small_cu_size: total size of 8 KB CUs.
total_cu_size: total CU size.
Example:
1 2 3 4 5 6 7 8 9 10 | SELECT * FROM get_all_col_cu_info(200); node_name | schema_name | table_name | zero_size_cu_count | small_cu_count | total_cu_count | small_cu_size | total_cu_size -----------+-------------+----------------------+--------------------+----------------+----------------+---------------+--------------- datanode1 | public | udi_48076 | 5 | 1 | 6 | 8192 bytes | 8192 bytes datanode1 | public | udi_48077 | 5 | 1 | 6 | 8192 bytes | 8192 bytes datanode2 | public | udi_48076 | 5 | 1 | 6 | 8192 bytes | 8192 bytes datanode2 | public | udi_48077 | 5 | 1 | 6 | 8192 bytes | 8192 bytes datanode3 | public | udi_48076 | 5 | 1 | 6 | 8192 bytes | 8192 bytes datanode3 | public | udi_48077 | 5 | 1 | 6 | 8192 bytes | 8192 bytes (6 rows) |
Description: Queries the vacuum information of all column-store tables in the database. This function is supported by clusters of version 8.2.0.100 or later.
Parameter: whether to forcibly obtain the accurate number of files that can be cleared (mandatory. It can be true or false .)
Return type: record
Fields in the returned value:
node_name: DN name.
schema_name: schema name.
table_name: table name.
total_file_num: total number of CU files.
rewritable_file_num: number of files that can be rewritten but have not been rewritten.
rewritten_file_num: number of files that have been rewritten but have not been cleared. The value is obtained from data in the memory. If the memory data is lost due to reasons such as restart, you can set force_get_rewritten_file_num=true to forcibly obtain the accurate number of files that can be cleared.
empty_file_num: number of cleared files.
Example:
1 2 3 4 5 6 7 8 9 | SELECT * FROM get_all_col_file_vacuum_info(false); node_name | schema_name | table_name | total_file_num | rewritable_file_num | rewritten_file_num | empty_file_num -----------+-------------+----------------------+----------------+---------------------+--------------------+---------------- datanode1 | public | udi_57373 | 2 | 0 | 0 | 1 datanode1 | public | udi_57374 | 2 | 0 | 0 | 1 datanode2 | public | udi_57373 | 2 | 0 | 0 | 1 datanode2 | public | udi_57374 | 2 | 0 | 0 | 1 datanode3 | public | udi_57373 | 2 | 0 | 0 | 1 datanode3 | public | udi_57374 | 2 | 0 | 0 | 1 |
Description: Queries the TimeStamp-Counter (TSC) information obtained from the current database node. This function is supported by version 8.2.1 or later clusters.
Return type: record
Name |
Type |
Description |
---|---|---|
node_name |
text |
Node name |
tsc_mult |
bigint |
TSC conversion multiplier |
tsc_shift |
bigint |
TSC conversion shifts |
tsc_frequency |
float8 |
TSC frequency. |
tsc_use_freqency |
boolean |
Indicates whether to use the TSC frequency for time conversion. |
tsc_ready |
boolean |
Indicates whether the TSC frequency can be used for time conversion |
tsc_scalar_error_info |
text |
Error information about obtaining TSC conversion information |
tsc_freq_error_info |
text |
Error information about obtaining TSC frequency information |
Example:
1 2 3 4 | SELECT * FROM show_tsc_info(); node_name | tsc_mult | tsc_shift | tsc_frequency | tsc_use_frequency | tsc_ready | tsc_scalar_error_info | tsc_freq_error_info --------------+----------+-----------+---------------+-------------------+-----------+-------------------------------+--------------------- coordinator1 | | | 2400 | t | t | TSC scalar is not initialized | |
Description: Re-obtains the TimeStamp-Counter (TSC) information of the current database node. This function is supported by version 8.2.1 or later clusters.
Return type: record
Column |
Type |
Description |
---|---|---|
node_name |
text |
Node name |
tsc_mult |
bigint |
TSC conversion multiplier |
tsc_shift |
bigint |
TSC conversion shifts |
tsc_frequency |
float8 |
TSC frequency |
tsc_use_freqency |
boolean |
Indicates whether to use the TSC frequency for time conversion. |
tsc_ready |
boolean |
Indicates whether the TSC frequency can be used for time conversion |
tsc_scalar_error_info |
text |
Error information about obtaining TSC conversion information |
tsc_freq_error_info |
text |
Error information about obtaining TSC frequency information |
Example:
1 2 3 4 | SELECT * FROM get_tsc_info(); node_name | tsc_mult | tsc_shift | tsc_frequency | tsc_use_frequency | tsc_ready | tsc_scalar_error_info | tsc_freq_error_info --------------+----------+-----------+---------------+-------------------+-----------+-------------------------------+--------------------- coordinator1 | | | 2400 | t | t | TSC scalar is not initialized | |
Description: Tests the accuracy of the time converted using the TimeStamp-Counter (TSC) on the current node. This function is supported by version 8.2.1 or later clusters.
The input parameters are described as follows:
Return type: record
Fields in the returned value:
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | SELECT * FROM test_tsc_info(0.01,10); id | real_time_diff | est_time_scalar | est_time_frequency ----+----------------+-----------------+-------------------- 1 | 10057 | | 10056.9 2 | 10057 | | 10057.4816666667 3 | 10056 | | 10055.2841666667 4 | 10054 | | 10054.4908333333 5 | 10055 | | 10054.2875 6 | 10055 | | 10054.7483333333 7 | 10055 | | 10054.4725 8 | 10054 | | 10054.0766666667 9 | 10058 | | 10058.1016666667 10 | 10057 | | 10056.3733333333 (10 rows) |