Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Global Temporary Table Functions

Updated on 2024-06-03 GMT+08:00
  • pg_get_gtt_relstats(relOid)

    Description: Displays basic information about a global temporary table specified by the current session.

    Parameter: OID of the global temporary table

    Return type: record

    Example:

    gaussdb=# SELECT * FROM pg_get_gtt_relstats(74069);
     relfilenode | relpages | reltuples | relallvisible | relfrozenxid | relminmxid 
    -------------+----------+-----------+---------------+--------------+------------
           74069 |       58 |     13000 |             0 |        11151 |          0
    (1 row)
  • pg_get_gtt_statistics(relOid, attnum, ''::text)

    Description: Displays statistics about a single column in a global temporary table specified by the current session.

    Parameter: OID and the attnum attribute of the global temporary table

    Return type: record

    Example:

    gaussdb=# SELECT * FROM  pg_get_gtt_statistics(74069,1,''::text);
     starelid | starelkind | staattnum | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanu
    mbers4 | stanumbers5 |                                                                                                                                                                                                                      
                                              stavalues1                                                                                                                                                                                        
                                                                            | stavalues2 | stavalues3 | stavalues4 | stavalues5 | stadndistinct | staextinfo 
    ----------+------------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+------
    -------+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    ------------------------------------------------------------------------+------------+------------+------------+------------+---------------+------------
        74069 | c          |         1 | f          |           0 |        4 |          -1 |        2 |        3 |        0 |        0 |        0 |     97 |     97 |      0 |      0 |      0 |             | {1}         |             |      
           |             | {1,130,260,390,520,650,780,910,1040,1170,1300,1430,1560,1690,1820,1950,2080,2210,2340,2470,2600,2730,2860,2990,3120,3250,3380,3510,3640,3770,3900,4030,4160,4290,4420,4550,4680,4810,4940,5070,5200,5330,5460,5590,57
    20,5850,5980,6110,6240,6370,6500,6630,6760,6890,7020,7150,7280,7410,7540,7670,7800,7930,8060,8190,8320,8450,8580,8710,8840,8970,9100,9230,9360,9490,9620,9750,9880,10010,10140,10270,10400,10530,10660,10790,10920,11050,11180,11310,11440,1
    1570,11700,11830,11960,12090,12220,12350,12480,12610,12740,12870,13000} |            |            |            |            |             0 | 
    (1 row)
  • pg_gtt_attached_pid(relOid)

    Description: Displays PIDs and session IDs of all threads that are using the specified global temporary table. If the thread pool is enabled and the session that is using the global temporary table is in the detach state, the PID is 0 and sessionid indicates the session ID.

    Parameter: OID of the global temporary table

    Return type: record

    Example:

    gaussdb=# SELECT * FROM  pg_gtt_attached_pid(74069);
     relid |       pid       |   sessionid     
    -------+-----------------+-----------------
     74069 | 139648170456832 | 139648170456832
     74069 | 139648123270912 | 139648123270912
    (2 rows)
  • dbe_perf.get_global_full_sql_by_timestamp(start_timestamp timestamp, end_timestamp timestamp)

    Description: Obtains full SQL information at the instance level.

    Return type: record

    Table 1 dbe_perf.get_global_full_sql_by_timestamp parameter description

    Parameter

    Type

    Description

    start_timestamp

    timestamp

    Start point of the SQL start time range.

    end_timestamp

    timestamp

    End point of the SQL start time range.

  • dbe_perf.get_global_slow_sql_by_timestamp(start_timestamp timestamp, end_timestamp timestamp)

    Description: Obtains slow SQL information at the instance level.

    Return type: record

    Table 2 dbe_perf.get_global_slow_sql_by_timestamp parameter description

    Parameter

    Type

    Description

    start_timestamp

    timestamp

    Start point of the SQL start time range.

    end_timestamp

    timestamp

    End point of the SQL start time range.

  • statement_detail_decode(detail text, format text, pretty bool)

    Parses the details column in a full or slow SQL statement.

    Table 3 statement_detail_decode parameter description

    Parameter

    Type

    Description

    detail

    text

    Set of events generated by the SQL statement (unreadable).

    format

    text

    Parsing output format. The value is plaintext or json.

    pretty

    bool

    Specifies whether to display the text in pretty format when format is set to plaintext. The options are as follows:
    • The value true indicates that events are separated by \n.
    • The value false indicates that events are separated by commas (,).
  • pg_list_gtt_relfrozenxids()

    Description: Displays the frozen XID of each session.

    If the value of pid is 0, the earliest frozen XID of all sessions is displayed.

    Parameter: none

    Return type: record

    Example:

    gaussdb=# SELECT * FROM pg_list_gtt_relfrozenxids();
           pid       | relfrozenxid 
    -----------------+--------------
     139648123270912 |        11151
     139648170456832 |        11155
                   0 |        11151
    (3 rows)

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback