You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by dj...@apache.org on 2025/05/23 04:04:05 UTC

(cloudberry-site) branch main updated: 2.0 docs: add resource group related docs and gp_toolkit (#270)

This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 741f07a00 2.0 docs: add resource group related docs and gp_toolkit (#270)
741f07a00 is described below

commit 741f07a002d597121d13ecae8fd10dbeec3b1001
Author: TomShawn <41...@users.noreply.github.com>
AuthorDate: Fri May 23 12:04:02 2025 +0800

    2.0 docs: add resource group related docs and gp_toolkit (#270)
---
 docs/performance/index.md                          |   32 +-
 .../manage-resources-using-resource-groups.md      |   37 +-
 docs/performance/update-stats-using-analyze.md     |    6 +
 docs/sys-catalogs/gp_toolkit.md                    | 1014 ++++++++++++++++++++
 .../current/performance/index.md                   |   37 +
 .../manage-resources-using-resource-groups.md      |   41 +-
 .../performance/update-stats-using-analyze.md      |    6 +
 .../current/query-performance-overview.md          |   19 -
 .../current/sys-catalogs/gp_toolkit.md             | 1007 +++++++++++++++++++
 .../version-2.x/performance/index.md               |   37 +
 .../manage-resources-using-resource-groups.md      |   41 +-
 .../performance/update-stats-using-analyze.md      |    6 +
 .../version-2.x/query-performance-overview.md      |   19 -
 .../version-2.x/sys-catalogs/gp_toolkit.md         | 1007 +++++++++++++++++++
 sidebars.ts                                        |    3 +-
 versioned_docs/version-2.x/performance/index.md    |   32 +-
 .../manage-resources-using-resource-groups.md      |   37 +-
 .../performance/update-stats-using-analyze.md      |    6 +
 .../version-2.x/sys-catalogs/gp_toolkit.md         | 1014 ++++++++++++++++++++
 versioned_sidebars/version-2.x-sidebars.json       |   21 +-
 20 files changed, 4290 insertions(+), 132 deletions(-)

diff --git a/docs/performance/index.md b/docs/performance/index.md
index eca146ad2..394abc861 100644
--- a/docs/performance/index.md
+++ b/docs/performance/index.md
@@ -4,15 +4,37 @@ title: Query Performance Overview
 
 # Query Performance in Apache Cloudberry
 
-Apache Cloudberry dynamically eliminates irrelevant partitions in a table and optimally allocates memory for different operators in a query.These enhancements scan less data for a query, accelerate query processing, and support more concurrency.
+Apache Cloudberry improves query performance through dynamic partition elimination and adaptive memory allocation. These mechanisms help reduce the amount of data scanned, speed up query execution, and enhance overall concurrency.
 
-- Dynamic partition elimination
+:::tip
+Apache Cloudberry uses the GPORCA optimizer by default, which extends the native Postgres planner with more advanced optimization capabilities.
+:::
+
+## Dynamic partition elimination
+
+Apache Cloudberry supports dynamic partition elimination (DPE), a feature that prunes partitions at query execution time based on runtime values. This reduces the data scanned and improves query efficiency.
+
+DPE is supported for the following join types:
+
+- `Hash Inner Join`
+- `Hash Left Join`
+- `Hash Right Join` (since v2.0.0)
+
+DPE is enabled when the following conditions are met:
+
+- The partitioned table is on the outer side of the join.
+- The join condition is an equality predicate on the partition key.
+- Statistics are collected on the partitioned tables. For example:
+
+    ```sql
+    ANALYZE <root partition>;
+    ```
 
-    In Apache Cloudberry, values available only when a query runs are used to dynamically prune partitions, which improves query processing speed. Enable or deactivate dynamic partition elimination by setting the server configuration parameter `gp_dynamic_partition_pruning` to `ON` or `OFF`; it is `ON` by default.
+The `gp_dynamic_partition_pruning` parameter controls whether DPE is enabled. It is ``ON`` by default but only applies to the Postgres optimizer. You can verify if DPE is in effect by checking the ``EXPLAIN`` plan for the presence of a `Partition Selector` node.
 
-- Memory optimizations
+## Memory optimizations
 
-    Apache Cloudberry allocates memory optimally for different operators in a query and frees and re-allocates memory during the stages of processing a query.
+Apache Cloudberry dynamically allocates memory based on the characteristics of query operators and proactively releases or reallocates memory during different query phases. This leads to more efficient memory usage and faster query execution.
 
 :::info
 Apache Cloudberry uses GPORCA by default. GPORCA extends the planning and optimization capabilities of the Postgres optimizer.
diff --git a/docs/performance/manage-resources-using-resource-groups.md b/docs/performance/manage-resources-using-resource-groups.md
index a76744bf1..77a584f68 100644
--- a/docs/performance/manage-resources-using-resource-groups.md
+++ b/docs/performance/manage-resources-using-resource-groups.md
@@ -26,14 +26,14 @@ You can also use resource groups to manage the CPU and memory resources of exter
 
 When you create a resource group, you provide a set of limits that determine the amount of CPU and memory resources available to the group. The following table lists the available limits for resource groups:
 
-| Limit Type        | Description                                                                                                                                          | Value Range                             | Default                                                                  |
+| Limit type        | Description                                                                                                                                          | Value range                             | Default                                                                  |
 |-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|--------------------------------------------------------------------------|
 | `CONCURRENCY`     | The maximum number of concurrent transactions, including active and idle transactions, that are permitted in the resource group.                     | [0, max_connections]               | 20                                                                       |
 | `CPU_MAX_PERCENT` | The maximum percentage of CPU resources the group can use.                                                                                           | [1, 100]                             | -1 (not set)                                                             |
 | `CPU_WEIGHT`      | The scheduling priority of the resource group.                                                                                                       | [1, 500]                             | 100                                                                      |
 | `CPUSET`          | The specific CPU logical core (or logical thread in hyperthreading) reserved for this resource group.                                                | It depends on system core configuration | -1                                                                       |
 | `IO_LIMIT`        | The limit for the maximum read/write disk I/O throughput, and maximum read/write I/O operations per second. Set the value on a per-tablespace basis. | [2, 4294967295 or max]             | -1                                                                       |
-| `MEMORY_LIMIT`    | The memory limit value specified for the resource group.                                                                                             | Integer (MB)                            | -1 (not set, use `statement_mem` as the memory limit for a single query) |
+| `MEMORY_QUOTA`    | The memory limit value specified for the resource group.                                                                                             | Integer (MB)                            | -1 (not set, use `statement_mem` as the memory limit for a single query) |
 | `MIN_COST`        | The minimum cost of a query plan to be included in the resource group.                                                                               | Integer                                 | 0                                                                        |
 
 :::note
@@ -134,15 +134,15 @@ When you enable resource groups, memory usage is managed at the Apache Cloudberr
 
 The amount of memory allocated to a query is determined by the following parameters:
 
-The parameter `MEMORY_LIMIT` of a resource group sets the maximum amount of memory reserved for this resource group on a segment. This determines the total amount of memory that all worker processes for a query can consume on the segment host during query execution. The amount of memory allotted to a query is the group memory limit divided by the group concurrency limit: `MEMORY_LIMIT` / `CONCURRENCY`.
+The parameter `MEMORY_QUOTA` of a resource group sets the maximum amount of memory reserved for this resource group on a segment. This determines the total amount of memory that all worker processes for a query can consume on the segment host during query execution. The amount of memory allotted to a query is the group memory limit divided by the group concurrency limit: `MEMORY_QUOTA` / `CONCURRENCY`.
 
 If a query requires a large amount of memory, you might use the server configuration parameter `gp_resgroup_memory_query_fixed_mem` to set a fixed memory amount for the query at the session level. This parameter overrides and can surpass the allocated memory of the resource group.
 
-Apache Cloudberry allocates memory for an incoming query using the `gp_resgroup_memory_query_fixed_mem` value, if set, to bypass the resource group settings. Otherwise, it uses `MEMORY_LIMIT` / `CONCURRENCY` as the memory allocated for the query. If `MEMORY_LIMIT` is not set, the value for the query memory allocation defaults to `statement_mem`.
+Apache Cloudberry allocates memory for an incoming query using the `gp_resgroup_memory_query_fixed_mem` value, if set, to bypass the resource group settings. Otherwise, it uses `MEMORY_QUOTA` / `CONCURRENCY` as the memory allocated for the query. If `MEMORY_QUOTA` is not set, the value for the query memory allocation defaults to `statement_mem`.
 
 For all queries, if there is not enough memory in the system, they spill to disk. When the limit `gp_workfile_limit_files_per_query` is reached, Apache Cloudberry generates an out of memory (OOM) error.
 
-For example, consider a resource group named `adhoc` with `MEMORY_LIMIT` set to 1.5 GB and `CONCURRENCY` set to `3`. By default, each statement submitted to the group is allocated 500 MB of memory. Now consider the following series of events:
+For example, consider a resource group named `adhoc` with `MEMORY_QUOTA` set to 1.5 GB and `CONCURRENCY` set to `3`. By default, each statement submitted to the group is allocated 500 MB of memory. Now consider the following series of events:
 
 1. User `ADHOC_1` submits query `Q1`, overriding `gp_resgroup_memory_query_fixed_mem` to 800MB. The `Q1` statement is admitted into the system.
 
@@ -158,10 +158,10 @@ For example, consider a resource group named `adhoc` with `MEMORY_LIMIT` set to
 
 There are some special usage considerations regarding memory limits:
 
-- If you set the configuration parameters `gp_resource_group_bypass` or `gp_resource_group_bypass_catalog_query` to bypass the resource group limits, the memory limit for the query takes the value of `statement_mem`.
-- When (`MEMORY_LIMIT` / `CONCURRENCY`) \< `statement_mem`, Apache Cloudberry uses `statement_mem` as the fixed amount of memory allocated by query.
-- The maximum value of `statement_mem` is capped at `max_statement_mem`.
-- Queries whose plan cost is less than the limit `MIN_COST` use a memory limit of `statement_mem`.
+- If the configuration parameters `gp_resource_group_bypass` or `gp_resource_group_bypass_catalog_query` are enabled to bypass resource group limits, the query's memory allocation will be determined by the value of `statement_mem`.
+- When (`MEMORY_QUOTA` / `CONCURRENCY`) is less than `statement_mem`, the system uses `statement_mem` as the fixed memory allocation for the query.
+- The maximum value of `statement_mem` is limited by `max_statement_mem`.
+- If a query's planned cost is lower than the configured `MIN_COST`, it will also be assigned memory based on `statement_mem`.
 
 ### Disk I/O limits
 
@@ -198,7 +198,8 @@ You do not need to change your version of cgroup, you can simply skip to `optimi
 However, if you prefer to switch from cgroup v1 to v2, run the following commands as root:
 
 :::note
-If you are using an older version of CentOS, such as Centos 7.x or earlier, you will only be able to use the default `cgroup v1` control groups; if you are using Centos 8.x, you can follow the steps below to switch the control group from v1 to v2.
+- If you are using an older version of CentOS, such as Centos 7.x or earlier, you will only be able to use the default `cgroup v1` control groups; if you are using Centos 8.x, you can follow the steps below to switch the control group from v1 to v2.
+- Starting from v2.0.0, for `cpu.pressure`, even when `gp_resource_manager` is set to `group-v2`, Apache Cloudberry no longer checks the permissions or existence of the `/proc/pressure/cpu` interface. Therefore, the `group-v2` mode can still function properly as long as the kernel version is compatible, even if PSI (Pressure Stall Information) is not enabled.
 :::
 
 - Red Hat 8/Rocky 8/Oracle 8 systems:
@@ -408,12 +409,12 @@ SELECT * FROM gp_toolkit.gp_resgroup_config;
 
 When you create a resource group for a role, you provide a name and a CPU resource allocation mode (core or percentage). You can optionally provide a concurrent transaction limit, a memory limit, a CPU soft priority, disk I/O limits, and a minimum cost. Use the `CREATE RESOURCE GROUP` command to create a new resource group.
 
-When you create a resource group for a role, you must provide a `CPU_MAX_PERCENT` or `CPUSET` limit value. These limits identify the percentage of Apache Cloudberry CPU resources to allocate to this resource group. You might specify a `MEMORY_LIMIT` to reserve a fixed amount of memory for the resource group.
+When you create a resource group for a role, you must provide a `CPU_MAX_PERCENT` or `CPUSET` limit value. These limits identify the percentage of Apache Cloudberry CPU resources to allocate to this resource group. You might specify a `MEMORY_QUOTA` to reserve a fixed amount of memory for the resource group.
 
 For example, to create a resource group named *rgroup1* with a CPU limit of 20, a memory limit of 25, a CPU soft priority of 500, a minimum cost of 50, and disk I/O limits for the `pg_default` tablespace:
 
 ```sql
-CREATE RESOURCE GROUP rgroup1 WITH (CONCURRENCY=20, CPU_MAX_PERCENT=20, MEMORY_LIMIT=250, CPU_WEIGHT=500, MIN_COST=50, 
+CREATE RESOURCE GROUP rgroup1 WITH (CONCURRENCY=20, CPU_MAX_PERCENT=20, MEMORY_QUOTA=250, CPU_WEIGHT=500, MIN_COST=50, 
 IO_LIMIT='pg_default: wbps=1000, rbps=1000, wiops=100, riops=100');
 ```
 
@@ -427,7 +428,7 @@ The `ALTER RESOURCE GROUP` command updates the limits of a resource group. To ch
 
 ```sql
 ALTER RESOURCE GROUP rg_role_light SET CONCURRENCY 7;
-ALTER RESOURCE GROUP exec SET MEMORY_LIMIT 30;
+ALTER RESOURCE GROUP exec SET MEMORY_QUOTA 30;
 ALTER RESOURCE GROUP rgroup1 SET CPUSET '1;2,4';
 ALTER RESOURCE GROUP sales SET IO_LIMIT 'tablespace1:wbps=2000,wiops=2000;tablespace2:rbps=2024,riops=2024'; 
 ```
@@ -476,7 +477,7 @@ Monitoring the status of your resource groups and queries might involve the foll
 
 ### View resource group limits
 
-The `gp_resgroup_config` `gp_toolkit` system view displays the current limits for a resource group. To view the limits of all resource groups:
+The `gp_toolkit.gp_resgroup_config` system view displays the current limits for a resource group. To view the limits of all resource groups:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_config;
@@ -484,7 +485,7 @@ SELECT * FROM gp_toolkit.gp_resgroup_config;
 
 ### View resource group query status
 
-The `gp_resgroup_status` `gp_toolkit` system view enables you to view the status and activity of a resource group. The view displays the number of running and queued transactions. To view this information:
+The `gp_toolkit.gp_resgroup_status` system view enables you to view the status and activity of a resource group. The view displays the number of running and queued transactions. To view this information:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_status;
@@ -492,7 +493,7 @@ SELECT * FROM gp_toolkit.gp_resgroup_status;
 
 ### View resource group memory usage per host
 
-The `gp_resgroup_status_per_host` `gp_toolkit` system view enables you to view the real-time memory usage of a resource group on a per-host basis. To view this information:
+The `gp_toolkit.gp_resgroup_status_per_host` system view enables you to view the real-time memory usage of a resource group on a per-host basis. To view this information:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_status_per_host;
@@ -509,7 +510,7 @@ WHERE pg_roles.rolresgroup=pg_resgroup.oid;
 
 ### View resource group disk I/O usage per host
 
-The `gp_resgroup_iostats_per_host` `gp_toolkit` system view enables you to view the real-time disk I/O usage of a resource group on a per-host basis. To view this information:
+The `gp_toolkit.gp_resgroup_iostats_per_host` system view enables you to view the real-time disk I/O usage of a resource group on a per-host basis. To view this information:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_iostats_per_host;
@@ -620,7 +621,7 @@ Apache Cloudberry automatically adjusts transaction and group memory to the new
 
 **My query cannot run due to insufficient memory, resulting in memory leak Out of Memory (OOM).**
 
-First, ensure that the resource group is allocating enough memory required by the query by tuning resource group parameters such as `CONCURRENCY` and `MEMORY_LIMIT`. Analyze the type of query, whether there will be a lot of intermediate results using memory. If it does exist, you can set a reasonable `gp_resgroup_memory_query_fixed_mem` to allocate more memory at the session level for this specific query.
+First, ensure that the resource group is allocating enough memory required by the query by tuning resource group parameters such as `CONCURRENCY` and `MEMORY_QUOTA`. Analyze the type of query, whether there will be a lot of intermediate results using memory. If it does exist, you can set a reasonable `gp_resgroup_memory_query_fixed_mem` to allocate more memory at the session level for this specific query.
 
 **After a memory leak OOM the system has a high concurrent load**.
 
diff --git a/docs/performance/update-stats-using-analyze.md b/docs/performance/update-stats-using-analyze.md
index 3f15a12d5..dff83f0ab 100644
--- a/docs/performance/update-stats-using-analyze.md
+++ b/docs/performance/update-stats-using-analyze.md
@@ -50,6 +50,12 @@ Run `ANALYZE`:
 
 `ANALYZE` requires only a read lock on the table, so it might be run in parallel with other database activity. But for performance reasons, it is not recommended to run `ANALYZE` while performing loads, `INSERT`, `UPDATE`, `DELETE`, and `CREATE INDEX` operations.
 
+:::info
+Apache Cloudberry improves the behavior of `ANALYZE` on partitioned tables. When you explicitly run statistics collection on a leaf partition (for example, `ANALYZE sales_1_prt_p2023`), the system no longer updates statistics for the root or other partitions. Only when `ANALYZE` is run on the root table (for example, `ANALYZE sales`), will statistics for the entire table, including all child partitions, be refreshed.
+
+This change gives you finer control over statistics maintenance and avoids unnecessary updates. In practice, it's recommended to selectively analyze specific partitions or the entire table based on data change patterns.
+:::
+
 ## Configure automatic statistics collection
 
 The `gp_autostats_mode` configuration parameter, together with the `gp_autostats_on_change_threshold` parameter, determines when an automatic analyze operation is triggered. When automatic statistics collection is triggered, the planner adds an `ANALYZE` step to the query.
diff --git a/docs/sys-catalogs/gp_toolkit.md b/docs/sys-catalogs/gp_toolkit.md
new file mode 100644
index 000000000..a4498c6c7
--- /dev/null
+++ b/docs/sys-catalogs/gp_toolkit.md
@@ -0,0 +1,1014 @@
+---
+title: gp_toolkit
+---
+
+# The gp_toolkit Administrative Schema
+
+Apache Cloudberry 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:
+
+```sql
+=> ALTER ROLE myrole SET search_path TO myschema,gp_toolkit;
+```
+
+This document describes the most useful views and user-defined functions (UDFs) 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).
+
+:::caution
+Do not change database objects in the gp_toolkit schema. Do not create database objects in the schema. Changes to objects in the schema might affect the accuracy of administrative information returned by schema objects. Any changes made in the gp_toolkit schema are lost when the database is backed up and then restored with the `gpbackup` and `gprestore` utilities.
+:::
+
+These are the categories for views in the `gp_toolkit` schema.
+
+- [Check for tables that need routine maintenance](#check-for-tables-that-need-routine-maintenance)
+- [Check for locks](#check-for-locks)
+- [Check append-optimized tables](#check-append-optimized-tables)
+- [View server log files](#view-server-log-files)
+- [Check server configuration files](#check-server-configuration-files)
+- [Check for failed segments](#check-for-failed-segments)
+- [Check resource group activity and status](#check-resource-group-activity-and-status)
+- [Check resource queue activity and status](#check-resource-queue-activity-and-status)
+- [Check query disk spill space usage](#check-query-disk-spill-space-usage)
+- [View users and groups (roles)](#view-users-and-groups-roles)
+- [Check database object sizes and disk space](#check-database-object-sizes-and-disk-space)
+- [Check for missing and orphaned data files](#check-for-missing-and-orphaned-data-files)
+- [Move orphaned data files](#move-orphaned-data-files)
+- [Check for uneven data distribution](#check-for-uneven-data-distribution)
+- [Maintain partitions](#maintain-partitions)
+
+## About the extension
+
+`gp_toolkit` is implemented as an extension in Apache Cloudberry v2.0.0. Because this extension is registered in the `template1` database, it is both registered an immediately available to use in every Apache Cloudberry database that you create.
+
+## Upgrade the extension
+
+The `gp_toolkit` extension is installed when you install or upgrade Apache Cloudberry. A previous version of the extension will continue to work in existing databases after you upgrade Apache Cloudberry. To upgrade to the most recent version of the extension, you must:
+
+```sql
+ALTER EXTENSION gp_toolkit UPDATE TO '1.4';
+```
+
+in **every** database in which you use the extension.
+
+## Check for tables that need routine maintenance
+
+The following views can help identify tables that need routine table maintenance (`VACUUM` and/or `ANALYZE`).
+
+- [`gp_bloat_diag`](#gp_bloat_diag)
+- [`gp_stats_missing`](#gp_stats_missing)
+
+The `VACUUM` or `VACUUM FULL` command reclaims disk space occupied by deleted or obsolete rows. Because of the MVCC transaction concurrency model used in Apache Cloudberry, data rows that are deleted or updated still occupy physical space on disk even though they are not visible to any new transactions. Expired rows increase table size on disk and eventually slow down scans of the table.
+
+The `ANALYZE` command collects column-level statistics needed by the query optimizer. Apache Cloudberry uses a cost-based query optimizer that relies on database statistics. Accurate statistics allow the query optimizer to better estimate selectivity and the number of rows retrieved by a query operation in order to choose the most efficient query plan.
+
+### gp_bloat_diag
+
+This view shows regular heap-storage tables that have bloat (the actual number of pages on disk exceeds the expected number of pages given the table statistics). Tables that are bloated require a `VACUUM` or a `VACUUM FULL` in order to reclaim disk space occupied by deleted or obsolete rows. This view is accessible to all users, however non-superusers will only be able to see the tables that they have permission to access.
+
+Note
+
+For diagnostic functions that return append-optimized table information, see [Check append-optimized tables](#check-append-optimized-tables).
+
+The columns of this view are described as follows:
+
+- `bdirelid`: Table object id.
+- `bdinspname`: Schema name.
+- `bdirelname`: Table name.
+- `bdirelpages`: Actual number of pages on disk.
+- `bdiexppages`: Expected number of pages given the table data.
+- `bdidiag`: Bloat diagnostic message.
+
+### gp_stats_missing
+
+This view shows tables that do not have statistics and therefore may require an `ANALYZE` be run on the table.
+
+The columns of this view are described as follows:
+
+- `smischema`: Schema name.
+- `smitable`: Table name.
+- `smisize`: Does this table have statistics? False if the table does not have row count and row sizing statistics recorded in the system catalog, which may indicate that the table needs to be analyzed. This will also be false if the table does not contain any rows. For example, the parent tables of partitioned tables are always empty and will always return a false result.
+- `smicols`: Number of columns in the table.
+- `smirecs`: The total number of columns in the table that have statistics recorded.
+
+## Check for locks
+
+When a transaction accesses a relation (such as a table), it acquires a lock. Depending on the type of lock acquired, subsequent transactions may have to wait before they can access the same relation. For more information on the types of locks, see the [Transaction](..). Apache Cloudberry resource queues (used for resource management) also use locks to control the admission of queries into the system.
+
+The `gp_locks_*` family of views can help diagnose queries and sessions that are waiting to access an object due to a lock.
+
+- [`gp_locks_on_relation`](#gp_locks_on_relation)
+- [`gp_locks_on_resqueue`](#gp_locks_on_resqueue)
+
+### gp_locks_on_relation
+
+This view shows any locks currently being held on a relation, and the associated session information about the query associated with the lock. For more information on the types of locks, see the [Transaction](..). This view is accessible to all users, however non-superusers will only be able to see the locks for relations that they have permission to access.
+
+The columns of this view are described as follows:
+
+- `lorlocktype`: Type of the lockable object: `relation`, `extend`, `page`, `tuple`, `transactionid`, `object`, `userlock`, `resource queue`, or `advisory`.
+- `lordatabase`: Object ID of the database in which the object exists, zero if the object is a shared object.
+- `lorrelname`: The name of the relation.
+- `lorrelation`: The object ID of the relation.
+- `lortransaction`: The transaction ID that is affected by the lock.
+- `lorpid`: Process ID of the server process holding or awaiting this lock. `NULL` if the lock is held by a prepared transaction.
+- `lormode`: Name of the lock mode held or desired by this process.
+- `lorgranted`: Displays whether the lock is granted (`true`) or not granted (`false`).
+- `lorcurrentquery`: The current query in the session.
+
+### gp_locks_on_resqueue
+
+:::note
+The `gp_locks_on_resqueue` view is valid only when resource queue-based resource management is active.
+:::
+
+This view shows any locks currently being held on a resource queue, and the associated session information about the query associated with the lock. This view is accessible to all users, however non-superusers will only be able to see the locks associated with their own sessions.
+
+The columns of this view are described as follows:
+
+- `lorusename`: Name of the user running the session.
+- `lorrsqname`: The resource queue name.
+- `lorlocktype`: Type of the lockable object: `resource queue`.
+- `lorobjid`: The ID of the locked transaction.
+- `lortransaction`: The ID of the transaction that is affected by the lock.
+- `lorpid`: The process ID of the transaction that is affected by the lock.
+- `lormode`: The name of the lock mode held or desired by this process.
+- `lorgranted`: Displays whether the lock is granted (`true`) or not granted (`false`).
+- `lorwaiteventtype`: The type of waiting event (for example, I/O, lock, network).
+- `lorwaitevent`: The name or description of the waiting event (for example, the I/O operation or lock object of a file).
+
+## Check append-optimized tables
+
+The `gp_toolkit` schema includes a set of diagnostic functions you can use to investigate the state of append-optimized tables.
+
+When an append-optimized table (or column-oriented append-optimized table) is created, another table is implicitly created, containing metadata about the current state of the table. The metadata includes information such as the number of records in each of the table's segments.
+
+Append-optimized tables may have non-visible rows—rows that have been updated or deleted, but remain in storage until the table is compacted using `VACUUM`. The hidden rows are tracked using an auxiliary visibility map table, or visimap.
+
+The following functions let you access the metadata for append-optimized and column-oriented tables and view non-visible rows.
+
+For most of the functions, the input argument is `regclass`, either the table `name` or the `oid` of a table.
+
+### __gp_aovisimap_compaction_info(oid)
+
+This function displays compaction information for an append-optimized table. The information is for the on-disk data files on database segments that store the table data. You can use the information to determine the data files that will be compacted by a `VACUUM` operation on an append-optimized table.
+
+:::note
+Until a `VACUUM` operation deletes the row from the data file, deleted or updated data rows occupy physical space on disk even though they are hidden to new transactions. The configuration parameter `gp_appendonly_compaction` controls the functionality of the `VACUUM` command.
+:::
+
+This table describes the `__gp_aovisimap_compaction_info` function output table. The columns of this table are described as follows:
+
+- `content`: Database segment ID.
+- `datafile`: ID of the data file on the segment.
+- `compaction_possible`: The value is either `t` or `f`. The value `t` indicates that the data in data file be compacted when a VACUUM operation is performed. The server configuration parameter `gp_appendonly_compaction_threshold` affects this value.
+- `hidden_tupcount`: In the data file, the number of hidden (deleted or updated) rows.
+- `total_tupcount`: In the data file, the total number of rows.
+- `percent_hidden`: In the data file, the ratio (as a percentage) of hidden (deleted or updated) rows to total rows.
+
+### __gp_aoseg(regclass)
+
+This function returns metadata information contained in the append-optimized table's on-disk segment file.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `segment_id`: The ID of the data segment in the cluster.
+- `segno`: The file segment number.
+- `eof`: The effective end of file for this file segment.
+- `tupcount`: The total number of tuples in the segment, including invisible tuples.
+- `varblockcount`: The total number of varblocks in the file segment.
+- `eof_uncompressed`: The end of file if the file segment were uncompressed.
+- `modcount`: The number of data modification operations.
+- `formatversion`: The version of the AO file storage format, which indicates the format version of the file.
+- `state`: The state of the file segment. Indicates if the segment is active or ready to be dropped after compaction.
+
+### __gp_aoseg_history(regclass)
+
+This function returns metadata information contained in the append-optimized table's on-disk segment file. It displays all different versions (heap tuples) of the aoseg meta information. The data is complex, but users with a deep understanding of the system may find it useful for debugging.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `segment_id`: The ID of the data segment in the cluster.
+- `segno`: The number of the segment in the segment file.
+- `tupcount`: The number of tuples, including hidden tuples.
+- `eof`: The effective end of file for the segment.
+- `eof_uncompressed`: The end of file for the segment if data were uncompressed.
+- `modcount`: A count of data modifications.
+- `formatversion`: The version of the AO file storage format, which indicates the format version of the file.
+- `state`: The status of the segment.
+
+### __gp_aocsseg(regclass)
+
+This function returns metadata information contained in a column-oriented append-optimized table's on-disk segment file, excluding non-visible rows. Each row describes a segment for a column in the table.
+
+The input argument is the name or the oid of a column-oriented append-optimized table. The columns of the output are described as follows:
+
+- `segment_id`: The ID of the data segment in the cluster.
+- `segno`: The segment number.
+- `column_num`: The column number.
+- `physical_segno`: The number of the segment in the segment file.
+- `tupcount`: The number of rows in the segment, excluding hidden tuples.
+- `eof`: The effective end of file for the segment.
+- `eof_uncompressed`: The end of file for the segment if the data were uncompressed.
+- `modcount`: A count of data modification operations for the segment.
+- `formatversion`: The version of the AO file storage format, which indicates the format version of the file.
+- `state`: The status of the segment.
+
+### __gp_aocsseg_history(regclass)
+
+This function returns metadata information contained in a column-oriented append-optimized table's on-disk segment file. Each row describes a segment for a column in the table. The data is complex, but users with a deep understanding of the system may find it useful for debugging.
+
+The input argument is the name or the oid of a column-oriented append-optimized table. The columns of the output are described as follows:
+
+- `segment_id`: The ID of the data segment in the cluster.
+- `segno`: The segment number in the segment file.
+- `column_num`: The column number.
+- `physical_segno`: The segment containing data for the column.
+- `tupcount`: The total number of tuples in the segment.
+- `eof`: The effective end of file for the segment.
+- `eof_uncompressed`: The end of file for the segment if the data were uncompressed.
+- `modcount`: A count of the data modification operations.
+- `formatversion`: The version of the AO file storage format, which indicates the format version of the file.
+- `state`: The state of the segment.
+
+### __gp_aovisimap(regclass)
+
+This function returns the tuple ID, the segment file, and the row number of each non-visible tuple according to the visibility map.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `tid`: The tuple id.
+- `segno`: The number of the segment file.
+- `row_num`: The row number of a row that has been deleted or updated.
+
+### __gp_aovisimap_hidden_info(regclass)
+
+This function returns the numbers of hidden and visible tuples in the segment files for an append-optimized table.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `segno`: The number of the segment file.
+- `hidden_tupcount`: The number of hidden tuples in the segment file.
+- `total_tupcount`: The total number of tuples in the segment file.
+
+### __gp_aovisimap_entry(regclass)
+
+This function returns information about each visibility map entry for the table.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `segno`: Segment number of the visibility map entry.
+- `first_row_num`: The first row number of the entry.
+- `hidden_tupcount`: The number of hidden tuples in the entry.
+- `bitmap`: A text representation of the visibility bitmap.
+
+### __gp_aoblkdir(regclass)
+
+For a given AO/AOCO table that had or has an index, this function returns a row for each block directory entry recorded in the block directory relation; it flattens the `minipage` column of block directory relations and returns a row for each `minipage` entry.
+
+The input argument is the name or the oid of an append-optimized table.
+
+You must execute this function in utility mode against every segment, or with `gp_dist_random()` as shown here:
+
+```sql
+SELECT (gp_toolkit.__gp_aoblkdir('<table_name>')).*
+    FROM gp_dist_random('gp_id');
+```
+
+The columns of the output are described as follows:
+
+- `tupleid`: The tuple id of the block directory row containing this block directory entry.
+- `segno`: The physical segment file number.
+- `columngroup_no`: The `attnum` of the column described by this `minipage` entry (always `0` for row-oriented tables).
+- `entry_no`: The entry serial number inside this `minipage` containing this block directory entry.
+- `first_row_no`: The first row number of the rows covered by this block directory entry.
+- `file_offset`: The starting file offset of the rows covered by this block directory entry.
+- `row_count`: The count of rows covered by this block directory entry.
+
+### get_column_size(oid)
+
+For a given AOCO table, this function returns the column size and compression ratio for all columns in the table.
+
+The input argument is the object identifier of a column-oriented append-optimized table. The columns of the output are described as follows:
+
+- `segment`: The segment id.
+- `attnum`: The attribute number of the column.
+- `size`: The size of the column in bytes.
+- `size_uncompressed`: The size of the column in bytes if the column was not compressed.
+- `compression_ratio`: The compression ratio.
+
+### gp_column_size
+
+This view gathers the column size and compression ratio for column-oriented append-optimized tables from all segments. The columns of the view are described as follows:
+
+- `gp_segment_id`: Segment ID.
+- `relid`: The object identifier (OID) of the table.
+- `schema`: The schema to which the table belongs.
+- `relname`: The table name.
+- `attnum`: The attribute number of the column.
+- `attname`: The column name.
+- `size`: The size of the column in bytes.
+- `size_uncompressed`: The size of the column in bytes if the column was not compressed.
+- `compression_ratio`: The compression ratio.
+
+### gp_column_size_summary
+
+This view shows a summary of the `gp_column_size` view. It aggregates the column size and compression ratio for each column in each column-oriented append-optimized table from all segments. The columns of the view are described as follows:
+
+- `relid`: The object identifier (OID) of the table.
+- `schema`: The schema to which the table belongs.
+- `relname`: The table name.
+- `attnum`: The attribute number of the column.
+- `attname`: The column name.
+- `size`: The size of the column in bytes.
+- `size_uncompressed`: The size of the column in bytes if the column were uncompressed.
+- `compression_ratio`: The compression ratio.
+
+## View server log files
+
+Each component of a Apache Cloudberry system (coordinator, standby coordinator, primary segments, and mirror segments) keeps its own server log files. The `gp_log_*` family of views allows you to issue SQL queries against the server log files to find particular entries of interest. The use of these views require superuser permissions.
+
+- [`gp_log_command_timings`](#gp_log_command_timings)
+- [`gp_log_database`](#gp_log_database)
+- [`gp_log_coordinator_concise`](#gp_log_coordinator_concise)
+- [`gp_log_system`](#gp_log_system)
+
+### gp_log_command_timings
+
+This view uses an external table to read the log files on the coordinator and report the run time of SQL commands in a database session. The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `logsession`: The session identifier (prefixed with "con").
+- `logcmdcount`: The command number within a session (prefixed with "cmd").
+- `logdatabase`: The name of the database.
+- `loguser`: The name of the database user.
+- `logpid`: The process id (prefixed with "p").
+- `logtimemin`: The time of the first log message for this command.
+- `logtimemax`: The time of the last log message for this command.
+- `logduration`: Statement duration from start to end time.
+
+### gp_log_database
+
+This view uses an external table to read the server log files of the entire Apache Cloudberry system (coordinator, segments, and mirrors) and lists log entries associated with the current database. Associated log entries can be identified by the session id (logsession) and command id (logcmdcount). The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `logtime`: The timestamp of the log message.
+- `loguser`: The name of the database user.
+- `logdatabase`: The name of the database.
+- `logpid`: The associated process id (prefixed with "p").
+- `logthread`: The associated thread count (prefixed with "th").
+- `loghost`: The segment or coordinator host name.
+- `logport`: The segment or coordinator port.
+- `logsessiontime`: Time session connection was opened.
+- `logtransaction`: Global transaction id.
+- `logsession`: The session identifier (prefixed with "con").
+- `logcmdcount`: The command number within a session (prefixed with "cmd").
+- `logsegment`: The segment content identifier (prefixed with "seg" for primary or "mir" for mirror. The coordinator always has a content id of -1).
+- `logslice`: The slice id (portion of the query plan being run).
+- `logdistxact`: Distributed transaction id.
+- `loglocalxact`: Local transaction id.
+- `logsubxact`: Subtransaction id.
+- `logseverity`: LOG, ERROR, FATAL, PANIC, DEBUG1 or DEBUG2.
+- `logstate`: SQL state code associated with the log message.
+- `logmessage`: Log or error message text.
+- `logdetail`: Detail message text associated with an error message.
+- `loghint`: Hint message text associated with an error message.
+- `logquery`: The internally-generated query text.
+- `logquerypos`: The cursor index into the internally-generated query text.
+- `logcontext`: The context in which this message gets generated.
+- `logdebug`: Query string with full detail for debugging.
+- `logcursorpos`: The cursor index into the query string.
+- `logfunction`: The function in which this message is generated.
+- `logfile`: The log file in which this message is generated.
+- `logline`: The line in the log file in which this message is generated.
+- `logstack`: Full text of the stack trace associated with this message.
+
+### gp_log_coordinator_concise
+
+This view uses an external table to read a subset of the log fields from the coordinator log file. The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `logtime`: The timestamp of the log message.
+- `logdatabase`: The name of the database.
+- `logsession`: The session identifier (prefixed with "con").
+- `logcmdcount`: The command number within a session (prefixed with "cmd").
+- `logseverity`: The log severity level.
+- `logmessage`: Log or error message text.
+
+### gp_log_system
+
+This view uses an external table to read the server log files of the entire Apache Cloudberry system (coordinator, segments, and mirrors) and lists all log entries. Associated log entries can be identified by the session id (logsession) and command id (logcmdcount). The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `logtime`: The timestamp of the log message.
+- `loguser`: The name of the database user.
+- `logdatabase`: The name of the database.
+- `logpid`: The associated process id (prefixed with "p").
+- `logthread`: The associated thread count (prefixed with "th").
+- `loghost`: The segment or coordinator host name.
+- `logport`: The segment or coordinator port.
+- `logsessiontime`: Time session connection was opened.
+- `logtransaction`: Global transaction id.
+- `logsession`: The session identifier (prefixed with "con").
+- `logcmdcount`: The command number within a session (prefixed with "cmd").
+- `logsegment`: The segment content identifier (prefixed with "seg" for primary or "mir" for mirror. The coordinator always has a content id of -1).
+- `logslice`: The slice id (portion of the query plan being run).
+- `logdistxact`: Distributed transaction id.
+- `loglocalxact`: Local transaction id.
+- `logsubxact`: Subtransaction id.
+- `logseverity`: LOG, ERROR, FATAL, PANIC, DEBUG1 or DEBUG2.
+- `logstate`: SQL state code associated with the log message.
+- `logmessage`: Log or error message text.
+- `logdetail`: Detail message text associated with an error message.
+- `loghint`: Hint message text associated with an error message.
+- `logquery`: The internally-generated query text.
+- `logquerypos`: The cursor index into the internally-generated query text.
+- `logcontext`: The context in which this message gets generated.
+- `logdebug`: Query string with full detail for debugging.
+- `logcursorpos`: The cursor index into the query string.
+- `logfunction`: The function in which this message is generated.
+- `logfile`: The log file in which this message is generated.
+- `logline`: The line in the log file in which this message is generated.
+- `logstack`: Full text of the stack trace associated with this message.
+
+## Check server configuration files
+
+Each component of a Apache Cloudberry system (coordinator, standby coordinator, primary segments, and mirror segments) has its own server configuration file (`postgresql.conf`). The following `gp_toolkit` objects can be used to check parameter settings across all primary `postgresql.conf` files in the system:
+
+- [`gp_param_setting('parameter_name')`](#gp_param_settingparameter_name)
+- [`gp_param_settings_seg_value_diffs`](#gp_param_settings_seg_value_diffs)
+
+### gp_param_setting('parameter_name')
+
+This function takes the name of a server configuration parameter and returns the `postgresql.conf` value for the coordinator and each active segment. This function is accessible to all users. The columns of the view are described as follows:
+
+- `paramsegment`: The segment content id (only active segments are shown). The coordinator content id is always -1.
+- `paramname`: The name of the parameter.
+- `paramvalue`: The value of the parameter.
+
+Example:
+
+```sql
+SELECT * FROM gp_toolkit.gp_param_setting('max_connections');
+```
+
+### gp_param_settings_seg_value_diffs
+
+Server configuration parameters that are classified as *local* parameters (meaning each segment gets the parameter value from its own `postgresql.conf` file), should be set identically on all segments. This view shows local parameter settings that are inconsistent. Parameters that are supposed to have different values (such as `port`) are not included. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `psdname`: The name of the parameter.
+- `psdvalue`: The value of the parameter.
+- `psdcount`: The number of segments that have this value.
+
+## Check for failed segments
+
+The [`gp_pgdatabase_invalid`](#gp_pgdatabase_invalid) view can be used to check for down segments.
+
+### gp_pgdatabase_invalid
+
+This view shows information about segments that are marked as down in the system catalog. This view is accessible to all users. The columns of the view are described as follows:
+
+- `pgdbidbid`: The segment dbid. Every segment has a unique dbid.
+- `pgdbiisprimary`: Is the segment currently acting as the primary (active) segment? (t or f).
+- `pgdbicontent`: The content id of this segment. A primary and mirror will have the same content id.
+- `pgdbivalid`: Is this segment up and valid? (t or f).
+- `pgdbidefinedprimary`: Was this segment assigned the role of primary at system initialization time? (t or f).
+
+## Check resource group activity and status
+
+Note
+
+The resource group activity and status views described in this section are valid only when resource group-based resource management is active.
+
+Resource groups manage transactions to avoid exhausting system CPU and memory resources. Every database user is assigned a resource group. Apache Cloudberry evaluates every transaction submitted by a user against the limits configured for the user's resource group before running the transaction.
+
+You can use the `gp_resgroup_config` view to check the configuration of each resource group. You can use the `gp_resgroup_status*` views to display the current transaction status and resource usage of each resource group.
+
+- [`gp_resgroup_config`](#gp_resgroup_config)
+- [`gp_resgroup_role`](#gp_resgroup_role)
+- [`gp_resgroup_status`](#gp_resgroup_status)
+- [`gp_resgroup_status_per_host`](#gp_resgroup_status_per_host)
+- [`gp_resgroup_status_per_segment`](#gp_resgroup_status_per_segment)
+
+### gp_resgroup_config
+
+The `gp_resgroup_config` view allows administrators to see the current CPU, memory, and concurrency limits for a resource group.
+
+This view is accessible to all users. The columns of the view are described as follows:
+
+- `groupid`: The ID of the resource group.
+- `groupname`: The name of the resource group.
+- `concurrency`: The concurrency (`CONCURRENCY`) value specified for the resource group.
+- `cpu_max_percent`: The CPU limit (`CPU_MAX_PERCENT`) value specified for the resource group, or `-1`.
+- `cpu_weight`: The scheduling priority of the resource group (`CPU_WEIGHT`).
+- `cpuset`: The CPU cores reserved for the resource group (CPUSET), or -1.
+- `memory_quota`: The memory limit value specified for the resource group.
+- `min_cost`: The minimum cost of a query plan to be included in the resource group (`MIN_COST`).
+- `io_limit`: The maximum read/write sequential disk I/O throughput, and the maximum read/write I/O operations per second for the queries assigned to a specific tablespace (shown as the tablespace oid) and resource group (`IO_LIMIT`).
+
+### gp_resgroup_role
+
+The `gp_resgroup_role` view allows administrators to see the resource group assigned to every role.
+
+This view is accessible to all users. The columns of the view are described as follows:
+
+- `rrrolname`: The name of the role.
+- `rrrsgname`: The name of the resource group.
+
+### gp_resgroup_status
+
+The `gp_resgroup_status` view allows administrators to see status and activity for a resource group. It shows how many queries are waiting to run and how many queries are currently active in the system for each resource group. The view also displays current memory and CPU usage for the resource group.
+
+:::note
+Resource groups use the Linux control groups (cgroups) configured on the host systems. The cgroups are used to manage host system resources. When resource groups use cgroups that are as part of a nested set of cgroups, resource group limits are relative to the parent cgroup allotment. For information about nested cgroups and Apache Cloudberry resource group limits, see the *Use Resource Groups* document.
+:::
+
+This view is accessible to all users. The columns of the view are described as follows:
+
+- `groupid`: The ID of the resource group.
+- `groupname`: The name of the resource group.
+- `num_running`: The number of transactions currently running in the resource group.
+- `num_queueing`: The number of currently queued transactions for the resource group.
+- `num_queued`: The total number of queued transactions for the resource group since the Apache Cloudberry cluster was last started, excluding the num_queueing.
+- `num_executed`: The total number of transactions run in the resource group since the Apache Cloudberry cluster was last started, excluding the num_running.
+- `total_queue_duration`: The total time any transaction was queued since the Apache Cloudberry cluster was last started.
+
+Sample output for the `gp_resgroup_status` view:
+
+```sql
+select * from gp_toolkit.gp_resgroup_status;
+
+groupid | groupname | num_running | num_queueing | num_queued | num_executed | total_queue_duration 
+---------+-----------+-------------+--------------+------------+--------------+----------------------
+(0 rows)
+```
+
+### gp_resgroup_status_per_host
+
+The `gp_resgroup_status_per_host` view displays the real-time CPU and memory usage (MBs) for each resource group on a per-host basis. The view also displays available and granted group fixed and shared memory for each resource group on a host.
+
+The columns of the view are described as follows:
+
+- `groupid`: The ID of the resource group.
+- `groupname`: The name of the resource group.
+- `hostname`: The hostname of the segment host.
+- `cpu_usage`: The real-time CPU core usage by the resource group on a host. The value is the sum of the percentages (as a float value) of the CPU cores that are used by the resource group on the host.
+- `memory_usage`: The real-time memory usage of the resource group on each database segment's host, in MB.
+
+Sample output for the `gp_resgroup_status_per_host` view:
+
+```sql
+select * from gp_toolkit.gp_resgroup_status_per_host;
+
+groupid | groupname | hostname | cpu_usage | memory_usage 
+---------+-----------+----------+-----------+--------------
+(0 rows)
+```
+
+### gp_resgroup_status_per_segment
+
+The `gp_toolkit.gp_resgroup_status_per_segment` view shows memory usage by resource group on each segment. The statistics are reported by the vmem tracker and measured in MB. This view helps database administrators monitor memory consumption of resource groups across segments.
+
+Note
+
+This view is available only when resource group-based resource management is enabled.
+
+Column descriptions:
+
+- `groupid` (type: `oid`): Unique identifier of the resource group, corresponding to `pg_resgroup.oid`.
+- `groupname` (type: `name`): Name of the resource group, corresponding to `pg_resgroup.rsgname`.
+- `segment_id` (type: `smallint`): Content ID of the corresponding segment instance, taken from `gp_segment_configuration.content`.
+- `vmem_usage` (type: `smallint`): Real-time memory usage (in MB) of the resource group on the corresponding segment.
+
+## Check resource queue activity and status
+
+:::note
+The resource queue activity and status views described in this section are valid only when resource queue-based resource management is active.
+:::
+
+The purpose of resource queues is to limit the number of active queries in the system at any given time in order to avoid exhausting system resources such as memory, CPU, and disk I/O. All database users are assigned to a resource queue, and every statement submitted by a user is first evaluated against the resource queue limits before it can run. The `gp_resq_*` family of views can be used to check the status of statements currently submitted to the system through their respective resou [...]
+
+- [`gp_resq_activity`](#gp_resq_activity)
+- [`gp_resq_activity_by_queue`](#gp_resq_activity_by_queue)
+- [`gp_resq_priority_statement`](#gp_resq_priority_statement)
+- [`gp_resq_role`](#gp_resq_role)
+- [`gp_resqueue_status`](#gp_resqueue_status)
+
+### gp_resq_activity
+
+For the resource queues that have active workload, this view shows one row for each active statement submitted through a resource queue. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `resqprocpid`: Process ID assigned to this statement (on the coordinator).
+- `resqrole`: User name.
+- `resqoid`: Resource queue object id.
+- `resqname`: Resource queue name.
+- `resqstart`: Time statement was issued to the system.
+- `resqstatus`: Status of statement: running, waiting or cancelled.
+
+### gp_resq_activity_by_queue
+
+For the resource queues that have active workload, this view shows a summary of queue activity. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `resqoid`: Resource queue object id.
+- `resqname`: Resource queue name.
+- `resqlast`: Time of the last statement issued to the queue.
+- `resqstatus`: Status of last statement: running, waiting or cancelled.
+- `resqtotal`: Total statements in this queue.
+
+### gp_resq_priority_statement
+
+This view shows the resource queue priority, session ID, and other information for all statements currently running in the Apache Cloudberry system. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `rqpdatname`: The database name that the session is connected to.
+- `rqpusename`: The user who issued the statement.
+- `rqpsession`: The session ID.
+- `rqpcommand`: The number of the statement within this session (the command id and session id uniquely identify a statement).
+- `rqppriority`: The resource queue priority for this statement (`MAX`, `HIGH`, `MEDIUM`, `LOW`).
+- `rqpweight`: An integer value associated with the priority of this statement.
+- `rqpquery`: The query text of the statement.
+
+### gp_resq_role
+
+This view shows the resource queues associated with a role. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `rrrolname`: Role (user) name.
+- `rrrsqname`: The resource queue name assigned to this role. If a role has not been explicitly assigned to a resource queue, it will be in the default resource queue (*pg_default*).
+
+### gp_resqueue_status
+
+This view allows administrators to see status and activity for a resource queue. It shows how many queries are waiting to run and how many queries are currently active in the system from a particular resource queue.
+
+The columns of the view are described as follows:
+
+- `queueid`: The ID of the resource queue.
+- `rsqname`: The name of the resource queue.
+- `rsqcountlimit`: The active query threshold of the resource queue. A value of -1 means no limit.
+- `rsqcountvalue`: The number of active query slots currently being used in the resource queue.
+- `rsqcostlimit`: The query cost threshold of the resource queue. A value of -1 means no limit.
+- `rsqcostvalue`: The total cost of all statements currently in the resource queue.
+- `rsqmemorylimit`: The memory limit for the resource queue.
+- `rsqmemoryvalue`: The total memory used by all statements currently in the resource queue.
+- `rsqwaiters`: The number of statements currently waiting in the resource queue.
+- `rsqholders`: The number of statements currently running on the system from this resource queue.
+
+## Check query disk spill space usage
+
+The *gp_workfile\_* views show information about all the queries that are currently using disk spill space. Apache Cloudberry creates work files on disk if it does not have sufficient memory to run the query in memory. This information can be used for troubleshooting and tuning queries. The information in the views can also be used to specify the values for the Apache Cloudberry configuration parameters `gp_workfile_limit_per_query` and `gp_workfile_limit_per_segment`.
+
+- [`gp_workfile_entries`](#gp_workfile_entries)
+- [`gp_workfile_usage_per_query`](#gp_workfile_usage_per_query)
+- [`gp_workfile_usage_per_segment`](#gp_workfile_usage_per_segment)
+
+### gp_workfile_entries
+
+This view contains one row for each operator using disk space for workfiles on a segment at the current time. The view is accessible to all users, however non-superusers only to see information for the databases that they have permission to access.
+
+The columns of the view are described as follows:
+
+| Column        | Type    | Description                                                            |
+|---------------|---------|------------------------------------------------------------------------|
+| `datname`     | name    | Database name.                                                         |
+| `pid`         | integer | Process ID of the server process.                                      |
+| `sess_id`     | integer | Session ID.                                                            |
+| `command_cnt` | integer | Command ID of the query.                                               |
+| `usename`     | name    | Role name.                                                             |
+| `query`       | text    | Current query that the process is running.                             |
+| `segid`       | integer | Segment ID.                                                            |
+| `slice`       | integer | The query plan slice. The portion of the query plan that is being run. |
+| `optype`      | text    | The query operator type that created the work file.                    |
+| `size`        | bigint  | The size of the work file in bytes.                                    |
+| `numfiles`    | integer | The number of files created.                                           |
+| `prefix`      | text    | Prefix used when naming a related set of workfiles.                    |
+
+### gp_workfile_usage_per_query
+
+This view contains one row for each query using disk space for workfiles on a segment at the current time. The view is accessible to all users, however non-superusers only to see information for the databases that they have permission to access.
+
+The columns of the view are described as follows:
+
+| Column        | Type    | Description                                |
+|---------------|---------|--------------------------------------------|
+| `datname`     | name    | Database name.                             |
+| `pid`         | integer | Process ID of the server process.          |
+| `sess_id`     | integer | Session ID.                                |
+| `command_cnt` | integer | Command ID of the query.                   |
+| `usename`     | name    | Role name.                                 |
+| `query`       | text    | Current query that the process is running. |
+| `segid`       | integer | Segment ID.                                |
+| `size`        | numeric | The size of the work file in bytes.        |
+| `numfiles`    | bigint  | The number of files created.               |
+
+### gp_workfile_usage_per_segment
+
+This view contains one row for each segment. Each row displays the total amount of disk space used for workfiles on the segment at the current time. The view is accessible to all users, however non-superusers only to see information for the databases that they have permission to access.
+
+The columns of the view are described as follows:
+
+| Column     | Type     | Description                                    |
+|------------|----------|------------------------------------------------|
+| `segid`    | smallint | Segment ID.                                    |
+| `size`     | numeric  | The total size of the work files on a segment. |
+| `numfiles` | bigint   | The number of files created.                   |
+
+## View users and groups (roles)
+
+It is frequently convenient to group users (roles) together to ease management of object privileges: that way, privileges can be granted to, or revoked from, a group as a whole. In Apache Cloudberry, this is done by creating a role that represents the group, and then granting membership in the group role to individual user roles.
+
+The `references/sys-catalog/gp-toolkit-schema:gp_roles_assigned` view can be used to see all of the roles in the system, and their assigned members (if the role is also a group role).
+
+### gp_roles_assigned
+
+This view shows all of the roles in the system, and their assigned members (if the role is also a group role). This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `raroleid`: The role object ID. If this role has members (users), it is considered a *group* role.
+- `rarolename`: The role (user or group) name.
+- `ramemberid`: The role object ID of the role that is a member of this role.
+- `ramembername`: Name of the role that is a member of this role.
+
+## Check database object sizes and disk space
+
+The `gp_size_*` family of views can be used to determine the disk space usage for a distributed Apache Cloudberry database, schema, table, or index. The following views calculate the total size of an object across all primary segments (mirrors are not included in the size calculations).
+
+- [`gp_size_of_all_table_indexes`](#gp_size_of_all_table_indexes)
+- [`gp_size_of_database`](#gp_size_of_database)
+- [`gp_size_of_index`](#gp_size_of_index)
+- [`gp_size_of_schema_disk`](#gp_size_of_schema_disk)
+- [`gp_size_of_table_and_indexes_disk`](#gp_size_of_table_and_indexes_disk)
+- [`gp_size_of_table_and_indexes_licensing`](#gp_size_of_table_and_indexes_licensing)
+- [`gp_size_of_table_disk`](#gp_size_of_table_disk)
+- [`gp_size_of_table_uncompressed`](#gp_size_of_table_uncompressed)
+- [`gp_disk_free`](#gp_disk_free)
+
+The table and index sizing views list the relation by object ID (not by name). To check the size of a table or index by name, you must look up the relation name (`relname`) in the `pg_class` table. For example:
+
+```sql
+SELECT relname as name, sotdsize as size, sotdtoastsize as 
+toast, sotdadditionalsize as other 
+FROM gp_size_of_table_disk as sotd, pg_class 
+WHERE sotd.sotdoid=pg_class.oid ORDER BY relname;
+```
+
+### gp_size_of_all_table_indexes
+
+This view shows the total size of all indexes for a table. This view is accessible to all users, however non-superusers will only be able to see relations that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `soatioid`: The object ID of the table.
+- `soatisize`: The total size of all table indexes in bytes.
+- `soatischemaname`: The schema name.
+- `soatitablename`: The table name.
+
+### gp_size_of_database
+
+This view shows the total size of a database. This view is accessible to all users, however non-superusers will only be able to see databases that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `sodddatname`: The name of the database.
+- `sodddatsize`: The size of the database in bytes.
+
+### gp_size_of_index
+
+This view shows the total size of an index. This view is accessible to all users, however non-superusers will only be able to see relations that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `soioid`: The object ID of the index.
+- `soitableoid`: The object ID of the table to which the index belongs.
+- `soisize`: The size of the index in bytes.
+- `soiindexschemaname`: The name of the index schema.
+- `soiindexname`: The name of the index.
+- `soitableschemaname`: The name of the table schema.
+- `soitablename`: The name of the table.
+
+### gp_size_of_schema_disk
+
+This view shows schema sizes for the public schema and the user-created schemas in the current database. This view is accessible to all users, however non-superusers will be able to see only the schemas that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `sosdnsp`: The name of the schema.
+- `sosdschematablesize`: The total size of tables in the schema in bytes.
+- `sosdschemaidxsize`: The total size of indexes in the schema in bytes.
+
+### gp_size_of_table_and_indexes_disk
+
+This view shows the size on disk of tables and their indexes. This view is accessible to all users, however non-superusers will only be able to see relations that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `sotaidoid`: The object ID of the parent table.
+- `sotaidtablesize`: The disk size of the table.
+- `sotaididxsize`: The total size of all indexes on the table.
+- `sotaidschemaname`: The name of the schema.
+- `sotaidtablename`: The name of the table.
+
+### gp_size_of_table_and_indexes_licensing
+
+This view shows the total size of tables and their indexes for licensing purposes. The use of this view requires superuser permissions.
+
+The columns of the view are described as follows:
+
+- `sotailoid`: The object ID of the table.
+- `sotailtablesizedisk`: The total disk size of the table.
+- `sotailtablesizeuncompressed`: If the table is a compressed append-optimized table, shows the uncompressed table size in bytes.
+- `sotailindexessize`: The total size of all indexes in the table.
+- `sotailschemaname`: The schema name.
+- `sotailtablename`: The table name.
+
+### gp_size_of_table_disk
+
+This view shows the size of a table on disk. This view is accessible to all users, however non-superusers will only be able to see tables that they have permission to access. The columns of the view are described as follows:
+
+- `sotdoid`: The object ID of the table.
+- `sotdsize`: The size of the table in bytes. The size is only the main table size. The size does not include auxiliary objects such as oversized (toast) attributes, or additional storage objects for AO tables.
+- `sotdtoastsize`: The size of the TOAST table (oversized attribute storage), if there is one.
+- `sotdadditionalsize`: Reflects the segment and block directory table sizes for append-optimized (AO) tables.
+- `sotdschemaname`: The schema name.
+- `sotdtablename`: The table name.
+
+### gp_size_of_table_uncompressed
+
+This view shows the uncompressed table size for append-optimized (AO) tables. Otherwise, the table size on disk is shown. The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `sotuoid`: The object ID of the table.
+- `sotusize`: The uncompressed size of the table in bytes if it is a compressed AO table. Otherwise, the table size on disk.
+- `sotuschemaname`: The schema name.
+- `sotutablename`: The table name.
+
+### gp_disk_free
+
+This external table runs the `df` (disk free) command on the active segment hosts and reports back the results. Inactive mirrors are not included in the calculation. The use of this external table requires superuser permissions. The columns of the view are described as follows:
+
+- `dfsegment`: The content id of the segment (only active segments are shown).
+- `dfhostname`: The hostname of the segment host.
+- `dfdevice`: The device name.
+- `dfspace`: Free disk space in the segment file system in kilobytes.
+
+## Check for missing and orphaned data files
+
+Apache Cloudberry considers a relation data file that is present in the catalog, but not on disk, to be missing. Conversely, when Apache Cloudberry encounters an unexpected data file on disk that is not referenced in any relation, it considers that file to be orphaned.
+
+Apache Cloudberry provides the following views to help identify if missing or orphaned files exist in the current database:
+
+- [`gp_move_orphaned_files()`](#gp_move_orphaned_files)
+- [`gp_check_orphaned_files`](#gp_check_orphaned_files)
+- [`gp_check_missing_files`](#gp_check_missing_files)
+
+Consider it a best practice to check for these conditions prior to expanding the cluster or before offline maintenance.
+
+By default, the views identified in this section are available to `PUBLIC`.
+
+### gp_check_orphaned_files
+
+The `gp_check_orphaned_files` view scans the default and user-defined tablespaces for orphaned data files. Apache Cloudberry considers normal data files, files with an underscore (`_`) in the name, and extended numbered files (files that contain a `.<N>` in the name) in this check. `gp_check_orphaned_files` gathers results from the Apache Cloudberry coordinator and all segments.
+
+The columns of the view are described as follows:
+
+- `gp_segment_id`: The database segment identifier.
+- `tablespace`: The identifier of the tablespace in which the orphaned file resides.
+- `filename`: The file name of the orphaned data file.
+- `filepath`: The file system path of the orphaned data file, relative to the data directory of the coordinator or segment.
+
+Caution
+
+Use this view as one of many data points to identify orphaned data files. Do not delete files based solely on results from querying this view.
+
+### gp_check_missing_files
+
+The `gp_check_missing_files` view scans heap and append-optimized, column-oriented tables for missing data files. Apache Cloudberry considers only normal data files (files that do not contain a `.` or an `_` in the name) in this check. `gp_check_missing_files` gathers results from the Apache Cloudberry coordinator and all segments.
+
+The columns of the view are described as follows:
+
+- `gp_segment_id`: The database segment identifier.
+- `tablespace`: The identifier of the tablespace in which the table resides.
+- `relname`: The name of the table that has a missing data file(s).
+- `filename`: The file name of the missing data file.
+
+### gp_check_missing_files_ext
+
+The `gp_check_missing_files_ext` view scans only append-optimized, column-oriented tables for missing extended data files. Apache Cloudberry considers both normal data files and extended numbered files (files that contain a `.<N>` in the name) in this check. Files that contain an `_` in the name are not considered. `gp_check_missing_files_ext` gathers results from the Apache Cloudberry database segments only.
+
+The columns of the view are described as follows:
+
+- `gp_segment_id`: The database segment identifier.
+- `tablespace`: The identifier of the tablespace in which the table resides.
+- `relname`: The name of the table that has a missing extended data file(s).
+- `filename`: The file name of the missing extended data file.
+
+## Move orphaned data files
+
+The `gp_move_orphaned_files()` user-defined function (UDF) moves orphaned files found by the [`gp_check_orphaned_files`](#gp_check_orphaned_files) view into a file system location that you specify.
+
+The function signature is: `gp_move_orphaned_files( <target_directory> TEXT )`.
+
+`<target_directory>` must exist on all segment hosts before you move the files, and the specified directory must be accessible by the `gpadmin` user. If you specify a relative path for `<target_directory>`, it is considered relative to the data directory of the coordinator or segment.
+
+Apache Cloudberry renames each moved data file to one that reflects the original location of the file in the data directory. The file name format differs depending on the tablespace in which the orphaned file resides:
+
+| Tablespace     | Renamed file format                                                               |
+|----------------|-----------------------------------------------------------------------------------|
+| `default`      | `seg<num>_base_<database-oid>_<relfilenode>`                                      |
+| `global`       | `seg<num>_global_<relfilenode>`                                                   |
+| `user-defined` | `seg<num>_pg_tblspc_<tablespace-oid>_<gpdb-version>_<database-oid>_<relfilenode>` |
+
+For example, if a file named `12345` in the default tablespace is orphaned on primary segment 2,
+
+```sql
+SELECT * FROM gp_move_orphaned_files('/home/gpadmin/orphaned');
+```
+
+moves and renames the file as follows:
+
+- original location: `<data_directory>/base/13700/12345`
+- new location and file name: `/home/gpadmin/orphaned/seg2_base_13700_12345`
+
+`gp_move_orphaned_files()` returns both the original and the new file system locations for each file that it moves, and also provides an indication of the success or failure of the move operation. For example:
+
+```sql
+SELECT * FROM gp_toolkit.gp_move_orphaned_files('/home/gpadmin/orphaned');
+ gp_segment_id | move_success |           oldpath          |         newpath
+---------------+--------------+----------------------------+-----------------------------------
+            -1 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg-1_base_13715_99999
+             1 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg1_base_13715_99999
+             2 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg2_base_13715_99999
+(3 rows)
+```
+
+Once you move the files, you may choose to remove them or to back them up.
+
+## Check for uneven data distribution
+
+All tables in Apache Cloudberry are distributed, meaning their data is divided across all of the segments in the system. If the data is not distributed evenly, then query processing performance may decrease. The following views can help diagnose if a table has uneven data distribution:
+
+- [`gp_toolkit.gp_skew_coefficients`](#gp_skew_coefficients)
+- [`gp_toolkit.gp_skew_idle_fractions`](#gp_skew_idle_fractions)
+
+### gp_skew_coefficients
+
+This view shows data distribution skew by calculating the coefficient of variation (CV) for the data stored on each segment. This view is accessible to all users, however non-superusers will only be able to see tables that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `skcoid`: The object id of the table.
+- `skcnamespace`: The namespace where the table is defined.
+- `skcrelname`: The table name.
+- `skccoeff`: The coefficient of variation (CV) is calculated as the standard deviation divided by the average. It takes into account both the average and variability around the average of a data series. The lower the value, the better. Higher values indicate greater data skew.
+
+### gp_skew_idle_fractions
+
+This view shows data distribution skew by calculating the percentage of the system that is idle during a table scan, which is an indicator of processing data skew. This view is accessible to all users, however non-superusers will only be able to see tables that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `sifoid`: The object id of the table.
+- `sifnamespace`: The namespace where the table is defined.
+- `sifrelname`: The table name.
+- `siffraction`: The percentage of the system that is idle during a table scan, which is an indicator of uneven data distribution or query processing skew. For example, a value of `0.1` indicates 10% skew, a value of `0.5` indicates 50% skew, and so on. Tables that have more than 10% skew should have their distribution policies evaluated.
+
+## Maintain partitions
+
+If your database employs partitions you will need to perform certain tasks regularly to help maintain those partitions. Apache Cloudberry includes a view and a number of user-defined functions to help with these tasks.
+
+### The gp_partitions view
+
+The `gp_partitions` view shows all leaf partitions in a database.
+
+This view provides backwards compatibility with the legacy `pg_partitions` view (available in earlier major versions of Apache Cloudberry). The columns of the view are described as follows:
+
+| Column                     | Type     | Description                                                                                                     |
+|----------------------------|----------|-----------------------------------------------------------------------------------------------------------------|
+| `schemaname`               | name     | The name of the schema the partitioned table is in.                                                             |
+| `tablename`                | name     | The name of the top-level parent table.                                                                         |
+| `partitionschemaname`      | name     | The schema of the partition table.                                                                              |
+| `partitiontablename`       | name     | The relation name of the partitioned table (this is the table name to use if accessing the partition directly). |
+| `parentpartitiontablename` | regclass | The relation name of the parent table one level up from this partition.                                         |
+| `partitiontype`            | text     | The type of partition (range or list).                                                                          |
+| `partitionlevel`           | integer  | The level of this partition in the hierarchy.                                                                   |
+| `partitionrank`            | integer  | For range partitions, the rank of the partition compared to other partitions of the same level.                 |
+| `partitionlistvalues`      | text     | For list partitions, the list value(s) associated with this partition.                                          |
+| `partitionrangestart`      | text     | For range partitions, the start value of this partition.                                                        |
+| `partitionrangeend`        | text     | For range partitions, the end value of this partition.                                                          |
+| `partitionisdefault`       | boolean  | T if this is a default partition, otherwise F.                                                                  |
+| `partitionboundary`        | text     | The entire partition specification for this partition.                                                          |
+| `parenttablespace`         | name     | The tablespace of the parent table one level up from this partition.                                            |
+| `partitiontablespace`      | name     | The tablespace of this partition.                                                                               |
+
+### User-defined functions for partition maintenance
+
+The following table summarizes the functions Apache Cloudberry provides to help you maintain partitions:
+
+| Function                                  | Return type | Description                                                                                                                                           |
+|-------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `pg_partition_rank(rp regclass)`          | integer     | For range partitions, returns the rank of the partition compared to other partitions of the same level. For other partition types, it returns `NULL`. |
+| `pg_partition_range_from(rp regclass)`    | text        | Returns the lower bound of a range partition.                                                                                                         |
+| `pg_partition_range_to(rp regclass)`      | text        | Returns the upper bound of a range partition.                                                                                                         |
+| `pg_partition_isdefault(rp regclass)`     | boolean     | Evaluates whether a given partition is a default partition.                                                                                           |
+| `pg_partition_lowest_child(rp regclass)`  | regclass    | Finds the lowest ranked child of given partition.                                                                                                     |
+| `pg_partition_highest_child(rp regclass)` | regclass    | Finds the highest ranked child of given partition.                                                                                                    |
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/performance/index.md b/i18n/zh/docusaurus-plugin-content-docs/current/performance/index.md
new file mode 100644
index 000000000..4974be31c
--- /dev/null
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/performance/index.md
@@ -0,0 +1,37 @@
+---
+title: 查询性能概述
+---
+
+# 查询性能概述
+
+Apache Cloudberry 能动态地清除无关分区以减少内存分配,以此来优化查询性能。这些机制可以显著减少查询扫描的数据量,加快查询执行速度,并提升系统的并发处理能力。
+
+:::tip 提示
+Apache Cloudberry 默认启用 GPORCA 优化器,扩展了原生 Postgres 优化器的查询规划与优化能力。
+:::
+
+## 动态分区消除
+
+在 Apache Cloudberry 中,系统利用仅在执行查询时才能确定的值来动态地对分区进行裁剪,从而提高查询处理速度。该功能称为动态分区消除(Dynamic Partition Elimination,简称 DPE)。
+
+DPE 适用于以下类型的连接操作:
+
+- `Hash Inner Join`
+- `Hash Left Join`
+- `Hash Right Join`(自 v2.0.0 起支持)
+
+启用 DPE 需满足以下条件:
+
+- 分区表必须作为 Join 的连接外表。
+- Join 条件必须是基于分区键的等值条件。
+- 必须对分区表收集统计信息,例如:
+
+    ```sql
+    ANALYZE <root partition>;
+    ```
+
+参数 `gp_dynamic_partition_pruning` 用于控制是否启用 DPE,默认值为 `ON`。该参数仅对 Postgres 优化器有效。你可以通过 `EXPLAIN` 查看执行计划中是否包含 `Partition Selector` 节点,以判断 DPE 是否实际生效。
+
+## 内存优化
+
+Apache Cloudberry 会根据查询中各个运算符的特点动态分配内存,并在查询不同阶段主动释放或重新分配内存资源,从而实现更高效的资源使用和查询执行。
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/performance/manage-resources-using-resource-groups.md b/i18n/zh/docusaurus-plugin-content-docs/current/performance/manage-resources-using-resource-groups.md
index b768ed812..621b2334d 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/performance/manage-resources-using-resource-groups.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/performance/manage-resources-using-resource-groups.md
@@ -29,10 +29,10 @@ Apache Cloudberry 支持两种类型的资源组:用于管理角色资源的
 | `CPU_WEIGHT`      | 资源组的调度优先级。                                                               | \[1,500\]                 | 100                                                       |
 | `CPUSET`          | 为该资源组保留的特定 CPU 逻辑核(或超线程中的逻辑线程)。                          | 取决于系统核配置          | -1                                                        |
 | `IO_LIMIT`        | 读取/写入磁盘 I/O 吞吐量的最大限制,以及每秒的最大读/写 I/O 操作。按表空间设置值。 | \[2,4294967295 或 `max`\] | -1                                                        |
-| `MEMORY_LIMIT`    | 为资源组指定的内存限制值。                                                         | `Integar`(MB)           | -1(未设置,使用 `statement_mem` 作为单个查询的内存限制) |
+| `MEMORY_QUOTA`    | 为资源组指定的内存限制值。                                                         | `Integar`(MB)           | -1(未设置,使用 `statement_mem` 作为单个查询的内存限制) |
 | `MIN_COST`        | 查询计划被包含在资源组中的最小成本。                                               | `Integar`                 | 0                                                         |
 
-:::note
+:::note 注意
 对于 `SET` 、 `RESET` 和 `SHOW` 命令,不强制执行资源限制。
 :::
 
@@ -130,15 +130,15 @@ Apache Cloudberry 使用服务器配置参数 `gp_resource_group_cpu_limit` 来
 
 分配给查询的内存量由以下参数确定:
 
-资源组的 `MEMORY_LIMIT` 参数设置此资源组在段上的最大内存量。这决定了查询执行期间该段主机上所有工作进程可消耗的内存总量。分配给查询的内存量是组内存限制除以组并发限制: `MEMORY_LIMIT` / `CONCURRENCY`。
+资源组的 `MEMORY_QUOTA` 参数设置此资源组在段上的最大内存量。这决定了查询执行期间该段主机上所有工作进程可消耗的内存总量。分配给查询的内存量是组内存限制除以组并发限制: `MEMORY_QUOTA` / `CONCURRENCY`。
 
 如果查询需要大量内存,您可以使用服务器配置参数 `gp_resgroup_memory_query_fixed_mem` 在会话级别为查询设置固定的内存量。该参数会覆盖并可以超出资源组的分配内存。
 
-Apache Cloudberry 在处理传入查询时使用 `gp_resgroup_memory_query_fixed_mem` 的值(如果设置),以绕过资源组设置。否则,它使用 `MEMORY_LIMIT` / `CONCURRENCY` 作为查询的分配内存。如果 `MEMORY_LIMIT` 未设置,则查询内存分配的默认值为 `statement_mem`。
+Apache Cloudberry 在处理传入查询时使用 `gp_resgroup_memory_query_fixed_mem` 的值(如果设置),以绕过资源组设置。否则,它使用 `MEMORY_QUOTA` / `CONCURRENCY` 作为查询的分配内存。如果 `MEMORY_QUOTA` 未设置,则查询内存分配的默认值为 `statement_mem`。
 
 对于所有查询,如果系统内存不足,它们会溢出到磁盘。当达到限制 `gp_workfile_limit_files_per_query` 时,Apache Cloudberry 数据库会生成内存不足 (OOM) 错误。
 
-例如,考虑一个名为 `adhoc` 的资源组,其 `MEMORY_LIMIT` 设置为 1.5 GB,`CONCURRENCY` 设置为 3。默认情况下,提交给该组的每个语句分配 500 MB 的内存。现在考虑以下一系列事件:
+例如,考虑一个名为 `adhoc` 的资源组,其 `MEMORY_QUOTA` 设置为 1.5 GB,`CONCURRENCY` 设置为 3。默认情况下,提交给该组的每个语句分配 500 MB 的内存。现在考虑以下一系列事件:
 
 1. 用户 `ADHOC_1` 提交查询 `Q1`, 将 `gp_resgroup_memory_query_fixed_mem` 重写为 800MB。 `Q1` 语句被接纳到系统中。
 
@@ -154,10 +154,10 @@ Apache Cloudberry 在处理传入查询时使用 `gp_resgroup_memory_query_fixed
 
 有关内存限制的一些特殊使用注意事项:
 
-- 如果设置配置参数 `gp_resource_group_bypass` 或 `gp_resource_group_bypass_catalog_query` 以绕过资源组限制,则查询的内存限制取 `statement_mem` 的值。
-- 当 (`MEMORY_LIMIT` / `CONCURRENCY`) \< `statement_mem` 时,Apache Cloudberry 使用 `statement_mem` 作为分配给查询的固定内存量。
-- `statement_mem` 的最大值被限制为 `max_statement_mem`。
-- 计划成本低于限制 `MIN_COST` 的查询使用 `statement_mem` 的内存限制。
+- 如果设置了配置参数 `gp_resource_group_bypass` 或 `gp_resource_group_bypass_catalog_query` 来绕过资源组限制,则查询的内存限制将取决于 `statement_mem` 的值。
+- 当 (`MEMORY_QUOTA` / `CONCURRENCY`) 小于 `statement_mem` 时,系统会直接使用 `statement_mem` 作为该查询的固定内存分配值。
+- `statement_mem` 的最大取值受 `max_statement_mem` 限制。
+- 查询的计划成本如果低于设定的 `MIN_COST`,则该查询也将使用 `statement_mem` 所指定的内存作为限制。
 
 ### 磁盘 I/O 限制
 
@@ -190,11 +190,12 @@ stat -fc %T /sys/fs/cgroup/
 
 对于 cgroup v1,输出为 `tmpfs`。对于 cgroup v2,输出为 `cgroup2fs`。
 
-:::note
-Linux 控制组可被更改,但如果你使用较旧版本的操作系统,例如 Centos 7.x 或更早,将只能使用默认的 `cgroup v1` 控制组;如果你使用的是 Centos 8.x,可按照下方步骤,将控制组从 v1 切换到 v2。
+:::note 注意
+- Linux 控制组可被更改,但如果您使用较旧版本的操作系统,例如 Centos 7.x 或更早,将只能使用默认的 `cgroup v1` 控制组;如果你使用的是 Centos 8.x,可按照下方步骤,将控制组从 v1 切换到 v2。
+- 从 v2.0.0 起,对于 `cpu.pressure`,即使 `gp_resource_manager` 设置为 `group-v2`,Apache Cloudberry 也不再检查 `/proc/pressure/cpu` 接口的权限或是否存在。因此,即使未启用 PSI(Pressure Stall Information),只要内核版本兼容,仍可正常使用 `group-v2` 模式。
 :::
 
-如无需更改 cgroup 版本,可以直接跳到 `optimize-performance/manage-resources-using-resource-groups:配置 cgroup v1` 或 `optimize-performance/manage-resources-using-resource-groups:配置 cgroup v2` 完成配置先决条件。
+如无需更改 cgroup 版本,可以直接跳到[配置 cgroup v1](#配置-cgroup-v1) 或[配置 cgroup v2](#配置-cgroup-v2) 完成配置先决条件。
 
 如希望从 cgroup v1 切换到 v2,可以以 root 身份运行以下命令:
 
@@ -405,12 +406,12 @@ SELECT * FROM gp_toolkit.gp_resgroup_config;
 
 当为角色创建资源组时,需要提供名称和 CPU 资源分配模式(核或百分比)。还可以选择性地提供并发事务限制、内存限制、CPU 软优先级、磁盘 I/O 限制和最低成本。使用 `CREATE RESOURCE GROUP` 命令创建新的资源组。
 
-为角色创建资源组时,必须提供 `CPU_MAX_PERCENT` 或 `CPUSET` 限制值。这些限制确定分配给该资源组的 Apache Cloudberry CPU 资源的百分比。可指定 `MEMORY_LIMIT` 来为资源组保留固定数量的内存。
+为角色创建资源组时,必须提供 `CPU_MAX_PERCENT` 或 `CPUSET` 限制值。这些限制确定分配给该资源组的 Apache Cloudberry CPU 资源的百分比。可指定 `MEMORY_QUOTA` 来为资源组保留固定数量的内存。
 
 例如,要创建一个名为 *rgroup1* 的资源组,其 CPU 限制为 20,内存限制为 25,CPU 软优先级为 500,最低成本为 50,以及 `pg_default` 表空间的磁盘 I/O 限制:
 
 ``` sql
-CREATE RESOURCE GROUP rgroup1 WITH (CONCURRENCY=20, CPU_MAX_PERCENT=20, MEMORY_LIMIT=250, CPU_WEIGHT=500, MIN_COST=50, IO_LIMIT='pg_default: wbps=1000, rbps=1000, wiops=100, riops=100');
+CREATE RESOURCE GROUP rgroup1 WITH (CONCURRENCY=20, CPU_MAX_PERCENT=20, MEMORY_QUOTA=250, CPU_WEIGHT=500, MIN_COST=50, IO_LIMIT='pg_default: wbps=1000, rbps=1000, wiops=100, riops=100');
 ```
 
 :::note
@@ -423,7 +424,7 @@ CPU 限制 20 被分配给每个分配到 `rgroup1` 的角色。同样,内存
 
 ``` sql
 ALTER RESOURCE GROUP rg_role_light SET CONCURRENCY 7;
-ALTER RESOURCE GROUP exec SET MEMORY_LIMIT 30;
+ALTER RESOURCE GROUP exec SET MEMORY_QUOTA 30;
 ALTER RESOURCE GROUP rgroup1 SET CPUSET '1;2,4';
 ALTER RESOURCE GROUP sales SET IO_LIMIT 'tablespace1:wbps=2000,wiops=2000;tablespace2:rbps=2024,riops=2024'; 
 ```
@@ -471,7 +472,7 @@ ALTER ROLE mary RESOURCE GROUP NONE;
 
 ### 浏览资源组限制
 
-`gp_resgroup_config`. `gp_toolkit` 系统视图显示资源组的当前限制。要查看所有资源组的限制:
+`gp_toolkit.gp_resgroup_config` 系统视图显示资源组的当前限制。要查看所有资源组的限制:
 
 ``` sql
 SELECT * FROM gp_toolkit.gp_resgroup_config;
@@ -479,7 +480,7 @@ SELECT * FROM gp_toolkit.gp_resgroup_config;
 
 ### 浏览资源组查询状态
 
-`gp_resgroup_status`.`gp_toolkit` 系统视图能够查看资源组的状态和活动。该视图显示正在运行和排队的事务数量。要查看此信息:
+`gp_toolkit.gp_resgroup_status` 系统视图能够查看资源组的状态和活动。该视图显示正在运行和排队的事务数量。要查看此信息:
 
 ``` sql
 SELECT * FROM gp_toolkit.gp_resgroup_status;
@@ -487,7 +488,7 @@ SELECT * FROM gp_toolkit.gp_resgroup_status;
 
 ### 按主机浏览资源组内存使用
 
-`gp_resgroup_status_per_host` `gp_toolkit` 系统视图能按主机查看资源组的实时内存使用情况。要查看此信息:
+`gp_toolkit.gp_resgroup_status_per_host` 系统视图能按主机查看资源组的实时内存使用情况。要查看此信息:
 
 ``` sql
 SELECT * FROM gp_toolkit.gp_resgroup_status_per_host;
@@ -504,7 +505,7 @@ WHERE pg_roles.rolresgroup=pg_resgroup.oid;
 
 ### 浏览资源组磁盘 I/O 使用情况
 
-`gp_resgroup_iostats_per_host` `gp_toolkit` 系统视图能按主机查看资源组的实时磁盘 I/O 使用情况。要查看此信息:
+`gp_toolkit.gp_resgroup_iostats_per_host` 系统视图能按主机查看资源组的实时磁盘 I/O 使用情况。要查看此信息:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_iostats_per_host;
@@ -615,7 +616,7 @@ Apache Cloudberry 在运行事务之前会考虑内存可用性,如果没有
 
 **我的查询由于内存不足而无法运行,导致内存泄漏(OOM)。**
 
-首先,确保资源组分配的内存足够满足查询的需求,通过调整资源组参数,如 `CONCURRENCY` 和 `MEMORY_LIMIT`。分析查询的类型,是否会产生大量的中间结果占用内存。如果确实存在,可设置合理的 `gp_resgroup_memory_query_fixed_mem`,以便在会话级别为该特定查询分配更多内存。
+首先,确保资源组分配的内存足够满足查询的需求,通过调整资源组参数,如 `CONCURRENCY` 和 `MEMORY_QUOTA`。分析查询的类型,是否会产生大量的中间结果占用内存。如果确实存在,可设置合理的 `gp_resgroup_memory_query_fixed_mem`,以便在会话级别为该特定查询分配更多内存。
 
 **在内存泄漏(OOM)后,系统的并发负载很高。**
 
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/performance/update-stats-using-analyze.md b/i18n/zh/docusaurus-plugin-content-docs/current/performance/update-stats-using-analyze.md
index 0ec475686..0d532d1c6 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/performance/update-stats-using-analyze.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/performance/update-stats-using-analyze.md
@@ -50,6 +50,12 @@ SELECT * FROM pg_partition_tree( 'parent_table' );
 
 `ANALYZE` 只需要对表进行读取锁定,因此可以与其他数据库操作并行执行。但出于性能原因,不建议在执行加载、`INSERT`、`UPDATE`、`DELETE` 和 `CREATE INDEX` 操作时执行 `ANALYZE`。
 
+:::info 提示
+Apache Cloudberry 优化了分区表执行 `ANALYZE` 时的行为。当对某个叶分区(例如 `ANALYZE sales_1_prt_p2023`)显式执行统计信息收集时,系统不会再自动更新根表或其他分区的统计信息。只有显式对根表(例如 `ANALYZE sales`)执行 `ANALYZE` 时,才会更新整张表的统计信息,包括所有子分区。
+
+这种行为的改进提高了统计信息管理的控制力,避免了不必要的统计刷新。在实际使用中,推荐根据数据变化情况选择性地分析具体分区或整表。
+:::
+
 ## 配置自动统计信息收集
 
 配置参数 `gp_autostats_mode` 与 `gp_autostats_on_change_threshold` 一起确定何时触发自动分析操作。当触发自动统计信息收集时,优化器会在查询中加入 `ANALYZE` 步骤。
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/query-performance-overview.md b/i18n/zh/docusaurus-plugin-content-docs/current/query-performance-overview.md
deleted file mode 100644
index a0de42a18..000000000
--- a/i18n/zh/docusaurus-plugin-content-docs/current/query-performance-overview.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: 查询性能概述
----
-
-# 查询性能概述
-
-Apache Cloudberry 能动态地清除表中的无关分区,并对查询中的不同运算符进行最优内存分配。有了这些优化,数据库执行查询时会减少扫描的数据量,加速查询处理,并支持更多并发。
-
-- 动态分区消除
-
-    在 Apache Cloudberry 中,系统会利用仅在执行查询时才能确定的值来动态地对分区进行裁剪,从而提高查询处理速度。通过设置服务器配置参数 `gp_dynamic_partition_pruning` 为 `ON` 或 `OFF` 来启用或禁用动态分区裁剪,默认情况下为 `ON`。
-
-- 内存优化
-
-    Apache Cloudberry 为查询中的不同运算符进行最优分配内存,在处理查询的不同阶段释放或重新分配内存。
-
-:::tip 提示
-Apache Cloudberry 默认使用 GPORCA 优化器。 GPORCA 扩展了 Postgres 优化器的规划和优化能力。
-:::
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/sys-catalogs/gp_toolkit.md b/i18n/zh/docusaurus-plugin-content-docs/current/sys-catalogs/gp_toolkit.md
new file mode 100644
index 000000000..2f23d9f5d
--- /dev/null
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/sys-catalogs/gp_toolkit.md
@@ -0,0 +1,1007 @@
+# 使用 gp_toolkit Schema 查看系统信息
+
+Apache Cloudberry 提供了一个名为 `gp_toolkit` 的管理 Schema,你可以用它查询系统目录、日志文件和操作环境中的系统状态信息。`gp_toolkit` Schema 包含多个视图,可以通过 SQL 命令访问这些视图。所有数据库用户都能访问 `gp_toolkit` Schema,虽然某些对象可能需要超级用户权限。为了方便使用,你可以将 `gp_toolkit` Schema 添加到你的 Schema 搜索路径中。例如:
+
+```sql
+=> ALTER ROLE myrole SET search_path TO myschema,gp_toolkit;
+```
+
+本文档描述了 `gp_toolkit` 中一些最有用的视图和用户定义函数(UDF)。你可能会发现 `gp_toolkit` Schema 中还有其他对象(视图、函数和外部表),这些对象是为了支持本节中描述的视图而存在,本文件中未具体描述它们。
+
+:::caution 小心
+请勿更改 `gp_toolkit` Schema 中的数据库对象,也不要在该 Schema 中创建新的数据库对象,否则可能会影响这些对象所返回信息的准确性。通过 `gpbackup` 和 `gprestore` 工具进行数据库备份和恢复时,对 `gp_toolkit` Schema 所做的任何更改都会丢失。
+:::
+
+`gp_toolkit` Schema 中的视图可以分为以下几类:
+
+[检查需要例行维护的表](#检查需要例行维护的表)
+[检查锁](#检查锁)
+[检查 ao 表](#检查-ao-表)
+[查看 apache cloudberry 服务器日志文件](#查看-apache-cloudberry-服务器日志文件)
+[检查服务器配置文件](#检查服务器配置文件)
+[检查下线的 segment](#检查下线的-segment)
+[检查资源组活动和状态](#检查资源组活动和状态)
+[检查资源队列活动和状态](#检查资源队列活动和状态)
+[查询磁盘溢出空间使用情况](#查询磁盘溢出空间使用情况)
+[查看用户和角色](#查看用户和角色)
+[检查数据库对象大小和磁盘空间](#检查数据库对象大小和磁盘空间)
+[检查缺失和孤立数据文件](#检查缺失和孤立数据文件)
+[移动孤立数据文件](#移动孤立数据文件)
+[检查不均匀的数据分布](#检查不均匀的数据分布)
+[维护分区](#维护分区)
+
+## 关于扩展
+
+`gp_toolkit` 是在 Apache Cloudberry 中作为扩展实现的。因为此扩展在 `template1` 数据库中注册,所以你在创建的每个 Apache Cloudberry 数据库中都可以立即使用它。
+
+## 升级扩展
+
+安装或升级 Apache Cloudberry 时,`gp_toolkit` 扩展会自动安装。即使升级了 Apache Cloudberry,之前版本的扩展仍可在现有数据库中使用。要将扩展升级到最新版本,你需要在**每个**使用该扩展的数据库中执行以下命令:
+
+```sql
+ALTER EXTENSION gp_toolkit UPDATE TO '1.4';
+```
+
+## 检查需要例行维护的表
+
+以下视图可以帮助识别需要进行例行维护的表(如 `VACUUM` 和/或 `ANALYZE`)。
+
+- [`gp_bloat_diag`](#gp_bloat_diag)
+- [`gp_stats_missing`](#gp_stats_missing)
+
+`VACUUM` 或 `VACUUM FULL` 命令用于回收被删除或过期行占用的磁盘空间。由于 Apache Cloudberry 使用的是 MVCC 事务并发模型,被删除或更新的数据行虽然对新事务不可见,但仍然占用磁盘空间。过期的行会增加表在磁盘上的体积,进而降低表的扫描速度。
+
+`ANALYZE` 命令用于收集查询优化器所需的列级统计信息。Apache Cloudberry 使用基于成本的查询优化器,依赖于数据库统计信息。准确的统计信息有助于查询优化器更好地估计选择性和查询操作将检索的行数,从而选择最有效的查询计划。
+
+### gp_bloat_diag
+
+该视图显示了存在膨胀问题的常规堆存储表(即实际磁盘页数超过表统计信息中预期的页数)。这些膨胀的表需要执行 `VACUUM` 或 `VACUUM FULL` 操作,以回收被删除或过期行占用的磁盘空间。所有用户都可以访问该视图,但非超级用户只能查看他们有权限访问的表。
+
+:::tip 提示
+有关返回更多表优化信息的诊断功能,请参见[检查 AO 表](#检查-ao-表)视图。
+:::
+
+该视图的列说明如下:
+
+- `bdirelid`:表对象 ID。
+- `bdinspname`:Schema 名称。
+- `bdirelname`:表名称。
+- `bdirelpages`:磁盘上的实际页数。
+- `bdiexppages`:表数据预期的页数。
+- `bdidiag`:膨胀诊断信息。
+
+### gp_stats_missing
+
+该视图显示了没有统计信息的表,这些表可能需要执行 `ANALYZE` 操作。
+
+该视图的列说明如下:
+
+- `smischema`:Schema 名称。
+- `smitable`:表名称。
+- `smisize`:该表是否具有统计信息?如果表没有记录行计数和行大小统计信息,则此值为假,表明该表可能需要分析。如果表中没有任何行,这个值也会为假。例如,分区表的父表始终是空的,因此始终返回假值。
+- `smicols`:表中的列数。
+- `smirecs`:表中记录了统计信息的列数。
+
+## 检查锁
+
+当事务访问某个关系(如表)时,会获取一个锁。根据获取的锁类型,后续事务可能需要等待才能访问相同的关系。有关锁类型的更多信息,请参见[事务中的并发控制](../transactional-concurrency-control.md#事务中的并发控制)的多版本并发控制机制。Apache Cloudberry 的资源队列(用于资源管理)也使用锁来控制查询进入系统。
+
+`gp_locks_*` 系列视图可以帮助诊断由于锁而导致查询和会话等待访问对象的情况。
+
+- [`gp_locks_on_relation`](#gp_locks_on_relation)
+- [`gp_locks_on_resqueue`](#gp_locks_on_resqueue)
+
+### gp_locks_on_relation
+
+该视图显示当前在关系上持有的任何锁,以及与该锁相关的查询的会话信息。有关锁类型的更多信息,请参见[事务中的并发控制](../transactional-concurrency-control.md#事务中的并发控制)。所有用户都可以访问该视图,但非超级用户只能看到他们有权限访问的关系的锁。
+
+该视图的列说明如下:
+
+- `lorlocktype`:可锁对象的类型:`relation`、`extend`、`page`、`tuple`、`transactionid`、`object`、`userlock`、`resource queue` 或 `advisory`。
+- `lordatabase`:对象所在数据库的对象 ID,如果对象是共享对象,则为零。
+- `lorrelname`:关系名称。
+- `lorrelation`:关系对象 ID。
+- `lortransaction`:受锁影响的事务 ID。
+- `lorpid`:持有或等待此锁的服务器进程的进程 ID。如果锁被准备事务持有,则为 `NULL`。
+- `lormode`:当前进程持有或期望的锁模式名称。
+- `lorgranted`:显示锁是否已授予(`true`)或未授予(`false`)。
+- `lorcurrentquery`:当前会话中的查询。
+
+### gp_locks_on_resqueue
+
+:::note 注意
+`gp_locks_on_resqueue` 视图只有在基于资源队列的资源管理启用时才有效。
+:::
+
+该视图显示当前在资源队列上持有的锁及相关查询会话的信息。所有用户都可以访问该视图,但非超级用户只能看到与自己会话相关的锁。
+
+该视图的列描述如下:
+
+- `lorusename`:运行会话的用户名称。
+- `lorrsqname`:资源队列名称。
+- `lorlocktype`:锁对象的类型:`resource queue`。
+- `lorobjid`:锁定事务的 ID。
+- `lortransaction`:受锁影响的事务 ID。
+- `lorpid`:受锁影响事务的进程 ID。
+- `lormode`:该进程持有或期望的锁模式名称。
+- `lorgranted`:显示锁是否被授予(`true`)或未被授予(`false`)。
+- `lorwaiteventtype`:等待事件的类别(例如 I/O、锁定、网络等)。
+- `lorwaitevent`:具体等待事件的名称或描述(例如某个文件的 I/O 操作或锁的对象)。
+
+## 检查 AO 表
+
+`gp_toolkit` Schema 包含一组诊断函数,用于检查 AO 表(即 Append-Optimized 表)的状态。
+
+创建 AO 表(或列式 AO 表)时,会自动创建一张表来存储该表的元数据信息。元数据包括每个表 Segment 中的记录数量等信息。
+
+AO 表中可能包含不可见行——这些是已更新或删除的行,在表执行 `VACUUM` 压缩前,这些行仍保留在存储中。隐藏行通过辅助的可见性映射表(visimap)进行跟踪。
+
+以下函数可以让你访问 AO 表和列式表的元数据,并查看其中的不可见行。
+
+大多数函数的输入参数是 `regclass`,可以是表的 `name` 或表的 `oid`。
+
+### __gp_aovisimap_compaction_info(oid)
+
+该函数显示 AO 表的压缩信息,针对存储表数据的数据库 Segment 上的磁盘数据文件。你可以利用这些信息确定 `VACUUM` 操作将压缩哪些 AO 表的数据文件。
+
+:::tip 提示
+在 `VACUUM` 操作删除数据文件中的行之前,尽管这些行对新事务不可见,已删除或更新的行仍会占用磁盘空间。配置参数 `gp_appendonly_compaction` 控制 `VACUUM` 的功能。
+:::
+
+下表描述了 `__gp_aovisimap_compaction_info` 函数输出的列信息:
+
+- `content`:数据库 Segment ID。
+- `datafile`:Segment 上的数据文件 ID。
+- `compaction_possible`:此值为 `t` 或 `f`,值为 `t` 表示执行 `VACUUM` 时可以对数据文件进行压缩。服务器配置参数 `gp_appendonly_compaction_threshold` 会影响此值。
+- `hidden_tupcount`:数据文件中隐藏(已删除或更新)行的数量。
+- `total_tupcount`:数据文件中的行总数。
+- `percent_hidden`:数据文件中隐藏行占总行数的百分比。
+
+### __gp_aoseg(regclass)
+
+该函数返回 AO 表磁盘 Segment 文件的元数据。
+
+输入参数是 AO 表的名称或 OID。输出的列描述如下:
+
+- `segment_id`:数据分片在集群中的 Segment ID。
+- `segno`:文件 Segment 编号。
+- `eof`:该文件 Segment 的有效文件结束位置。
+- `tupcount`:Segment 中的元组总数,包括不可见的元组。
+- `varblockcount`:文件 Segment 中的可变块总数。
+- `eof_uncompressed`:如果文件 Segment 未压缩,则显示文件结束的位置。
+- `modcount`:数据修改操作的次数。
+- `formatversion`:AO 文件的存储格式版本,用于指示文件所使用的格式版本。
+- `state`:文件 Segment 的状态,指示该 Segment 是否处于活动状态或在压缩后等待删除。
+
+### __gp_aoseg_history(regclass)
+
+该函数返回 AO 表磁盘 Segment 文件的元数据历史信息,显示所有不同版本(堆元组)的 `aoseg` 元数据。虽然数据较复杂,但对于有系统深入理解的用户来说,可能在调试时有用。
+
+输入参数是 AO 表的名称或 OID。输出的列描述如下:
+
+- `segment_id`:数据分片在集群中的 Segment ID。
+- `segno`:文件 Segment 编号。
+- `tupcount`:Segment 中的元组总数,包括不可见的元组。
+- `eof`:该文件 Segment 的有效文件结束位置。
+- `eof_uncompressed`:如果文件 Segment 未压缩,则显示文件结束的位置。
+- `modcount`:数据修改操作的次数。
+- `formatversion`:AO 文件的存储格式版本,用于指示文件所使用的格式版本。
+- `state`:文件 Segment 的状态,指示该 Segment 是否处于活动状态或在压缩后等待删除。
+
+### __gp_aocsseg(regclass)
+
+该函数返回列存储的 AO 表的磁盘 Segment 文件中的元数据信息,不包括不可见行。每行描述表中某列的 Segment 信息。
+
+输入参数是列存储 AO 表的名称或 OID。输出的列描述如下:
+
+- `segment_id`:数据分片在集群中的 Segment ID。
+- `segno`:文件 Segment 编号。
+- `column_num`:列号。
+- `physical_segno`:Segment 文件中的 Segment 编号。
+- `tupcount`:Segment 中的元组总数,包括不可见的元组。
+- `eof`:该文件 Segment 的有效文件结束位置。
+- `eof_uncompressed`:如果文件 Segment 未压缩,则显示文件结束的位置。
+- `modcount`:数据修改操作的次数。
+- `formatversion`:AO 文件的存储格式版本,用于指示文件所使用的格式版本。
+- `state`:文件 Segment 的状态,指示该 Segment 是否处于活动状态或在压缩后等待删除。
+
+### __gp_aocsseg_history(regclass)
+
+此函数返回列式 AO 表的磁盘 Segment 文件中的元数据信息。每一行描述表中某列的一个 Segment。数据较为复杂,但对于深入了解系统的用户来说,这些信息可能对调试有所帮助。
+
+输入参数为列式 AO 表的名称或 oid。输出的列描述如下:
+
+- `segment_id`:数据分片在集群中的 Segment ID。
+- `segno`:文件 Segment 编号。
+- `column_num`:列号。
+- `physical_segno`:包含列数据的 Segment。
+- `tupcount`:Segment 中的元组总数。
+- `eof`:该文件 Segment 的有效文件结束位置。
+- `eof_uncompressed`:如果文件 Segment 未压缩,则显示文件结束的位置。
+- `modcount`:数据修改操作的次数。
+- `formatversion`:AO 文件的存储格式版本,用于指示文件所使用的格式版本。
+- `state`:文件 Segment 的状态,指示该 Segment 是否处于活动状态或在压缩后等待删除。
+
+### __gp_aovisimap(regclass)
+
+此函数根据可见性映射返回每个不可见元组的元组 ID、Segment 文件和行号。
+
+输入参数为 AO 表的名称或 oid。输出的列描述如下:
+
+- `tid`:元组 ID。
+- `segno`:Segment 文件的编号。
+- `row_num`:被删除或更新行的行号。
+
+### __gp_aovisimap_hidden_info(regclass)
+
+此函数返回 AO 表的 Segment 文件中隐藏和可见元组的数量。
+
+输入参数为 AO 表的名称或 oid。输出的列描述如下:
+
+- `segno`:Segment 文件的编号。
+- `hidden_tupcount`:Segment 文件中隐藏元组的数量。
+- `total_tupcount`:Segment 文件中的元组总数。
+
+### __gp_aovisimap_entry(regclass)
+
+此函数返回有关表的每个可见性图条目的信息。
+
+输入参数是 AO 表的名称或 OID。输出列的描述如下:
+
+- `segno`:可见性图条目的 Segment 号。
+- `first_row_num`:条目的首行编号。
+- `hidden_tupcount`:条目中隐藏元组的数量。
+- `bitmap`:可见性位图的文本表示。
+
+### __gp_aoblkdir(regclass)
+
+对于具有或曾经具有索引的 AO/AOCO 表,此函数返回在块目录关系中记录的每个块目录条目的行;它将块目录关系的 `minipage` 列扁平化,并为每个 `minipage` 条目返回一行。
+
+输入参数是 AO 表的名称或OID。
+
+你必须在实用模式下对每个 Segment 执行此函数,或使用 `gp_dist_random()`,如以下示例所示:
+
+```sql
+SELECT (gp_toolkit.__gp_aoblkdir('<table_name>')).*
+    FROM gp_dist_random('gp_id');
+```
+
+输出列的描述如下:
+
+- `tupleid`:包含此块目录条目的块目录行的元组 ID。
+- `segno`:物理 Segment 文件编号。
+- `columngroup_no`:此 `minipage` 条目所描述列的 `attnum`(对于面向行的表始终为 `0`)。
+- `entry_no`:此 `minipage` 内包含此块目录条目的条目序列号。
+- `first_row_no`:此块目录条目所覆盖行的首行编号。
+- `file_offset`:此块目录条目所覆盖行的起始文件偏移量。
+- `row_count`:此块目录条目所覆盖行的数量。
+
+### get_column_size(oid)
+
+对于给定的 AOCO 表,此函数返回表中所有列的列大小和压缩比。
+
+输入参数是列式 AO 表的对象标识符。输出列的描述如下:
+
+- `segment`:Segment ID。
+- `attnum`:列的属性编号。
+- `size`:列的大小(以字节为单位)。
+- `size_uncompressed`:如果列未压缩,则列的大小(以字节为单位)。
+- `compression_ratio`:压缩比。
+
+### gp_column_size
+
+该视图汇总了所有 Segment 中列式 AO 表的列大小和压缩比。视图的列说明如下:
+
+- `gp_segment_id`:Segment ID。
+- `relid`:表的 OID(对象标识符)。
+- `schema`:表所属的 schema 名称。
+- `relname`:表名。
+- `attnum`:列的属性编号。
+- `attname`:列名。
+- `size`:列的大小(以字节为单位)。
+- `size_uncompressed`:如果列未被压缩,则列的大小(以字节为单位)。
+- `compression_ratio`:压缩比。
+
+### gp_column_size_summary
+
+该视图展示了 `gp_column_size` 视图的汇总信息。它聚合了所有 Segment 中每个列式 AO 表的每列的大小和压缩比。视图的列说明如下:
+
+- `relid`:表的 OID(对象标识符)。
+- `schema`:表所属的 schema 名称。
+- `relname`:表名。
+- `attnum`:列的属性编号。
+- `attname`:列名。
+- `size`:列的大小(以字节为单位)。
+- `size_uncompressed`:如果列未压缩,则列的大小(以字节为单位)。
+- `compression_ratio`:压缩比。
+
+## 查看 Apache Cloudberry 服务器日志文件
+
+Apache Cloudberry 系统的每个组件(Coordinator、Standby Coordinator、主 Segment 和镜像 Segment)都会保留自己的服务器日志文件。`gp_log_*` 系列视图允许你对服务器日志文件发出 SQL 查询,以查找特定感兴趣的条目。使用这些视图需要超级用户权限。
+
+- [`gp_log_command_timings`](#gp_log_command_timings)
+- [`gp_log_database`](#gp_log_database)
+- [`gp_log_coordinator_concise`](#gp_log_coordinator_concise)
+- [`gp_log_system`](#gp_log_system)
+
+### gp_log_command_timings
+
+该视图使用外部表读取 Coordinator 上的日志文件,并报告数据库会话中 SQL 命令的运行时间。使用该视图需要超级用户权限。视图的列描述如下:
+
+- `logsession`:会话标识符(以 "con" 为前缀)。
+- `logcmdcount`:会话中的命令编号(以 "cmd" 为前缀)。
+- `logdatabase`:数据库名称。
+- `loguser`:数据库用户名称。
+- `logpid`:进程 ID(以 "p" 为前缀)。
+- `logtimemin`:此命令的第一个日志消息的时间。
+- `logtimemax`:此命令的最后一个日志消息的时间。
+- `logduration`:从开始到结束的语句持续时间。
+
+### gp_log_database
+
+该视图使用外部表读取整个 Apache Cloudberry 系统(Coordinator、Segment 和镜像)的服务器日志文件,并列出与当前数据库相关的日志条目。相关的日志条目可以通过会话 ID(`logsession`)和命令 ID(`logcmdcount`)识别。使用该视图需要超级用户权限。视图的列描述如下:
+
+- `logtime`:日志消息的时间戳。
+- `loguser`:数据库用户名称。
+- `logdatabase`:数据库名称。
+- `logpid`:关联的进程 ID(以 "p" 为前缀)。
+- `logthread`:关联的线程计数(以 "th" 为前缀)。
+- `loghost`:Segment 或 Coordinator 主机名。
+- `logport`:Segment 或 Coordinator 端口。
+- `logsessiontime`:会话连接打开的时间。
+- `logtransaction`:全局事务 ID。
+- `logsession`:会话标识符(以 "con" 为前缀)。
+- `logcmdcount`:会话中的命令编号(以 "cmd" 为前缀)。
+- `logsegment`:Segment 内容标识符(主 Segment 以 "seg" 为前缀,镜像以 "mir" 为前缀, Coordinator 的内容 ID 始终为 -1)。
+- `logslice`:切片 ID(正在运行的查询计划部分)。
+- `logdistxact`:分布式事务 ID。
+- `loglocalxact`:本地事务 ID。
+- `logsubxact`:子事务 ID。
+- `logseverity`:日志级别,包括 `LOG`、`ERROR`、`FATAL`、`PANIC`、`DEBUG1` 或 `DEBUG2`。
+- `logstate`:与日志消息关联的 SQL 状态代码。
+- `logmessage`:日志或错误消息文本。
+- `logdetail`:与错误消息关联的详细信息文本。
+- `loghint`:与错误消息关联的提示信息文本。
+- `logquery`:系统生成的查询文本。
+- `logquerypos`:系统生成的查询文本中的游标索引。
+- `logcontext`:生成此消息的上下文。
+- `logdebug`:用于调试的查询字符串,包含详细信息。
+- `logcursorpos`:查询字符串中的游标索引。
+- `logfunction`:生成此消息的函数。
+- `logfile`:生成此消息的日志文件。
+- `logline`:生成此消息的日志文件中的行。
+- `logstack`:与此消息相关的堆栈跟踪的完整文本。
+
+### gp_log_coordinator_concise
+
+该视图使用外部表从 Coordinator 日志文件中读取一部分日志字Segment。使用该视图需要超级用户权限。视图的列描述如下:
+
+- `logtime`:日志消息的时间戳。
+- `logdatabase`:数据库的名称。
+- `logsession`:会话标识符(以 "con" 为前缀)。
+- `logcmdcount`:会话中的命令编号(以 "cmd" 为前缀)。
+- `logseverity`:日志的严重性级别。
+- `logmessage`:日志或错误消息文本。
+
+### gp_log_system
+
+该视图使用外部表读取整个 Apache Cloudberry 系统(Coordinator 、Segment 和镜像)的服务器日志文件,并列出所有日志条目。相关日志条目可以通过会话 ID(`logsession`)和命令 ID(`logcmdcount`)进行识别。使用该视图需要超级用户权限。视图的列描述如下:
+
+- `logtime`:日志消息的时间戳。
+- `loguser`:数据库用户的名称。
+- `logdatabase`:数据库的名称。
+- `logpid`:相关的进程 ID(以 "p" 为前缀)。
+- `logthread`:相关的线程计数(以 "th" 为前缀)。
+- `loghost`:Segment 或 Coordinator 的主机名称。
+- `logport`:Segment 或 Coordinator 的端口。
+- `logsessiontime`:会话连接打开的时间。
+- `logtransaction`:全局事务 ID。
+- `logsession`:会话标识符(以 "con" 为前缀)。
+- `logcmdcount`:会话中的命令编号(以 "cmd" 为前缀)。
+- `logsegment`:Segment 内容标识符(对于主 Segment 以 "seg" 为前缀,镜像 Segment 以 "mir" 为前缀。Coordinator 的内容 ID 始终为 -1)。
+- `logslice`:切片 ID(运行中的查询计划的一部分)。
+- `logdistxact`:分布式事务 ID。
+- `loglocalxact`:本地事务 ID。
+- `logsubxact`:子事务 ID。
+- `logseverity`:LOG、ERROR、FATAL、PANIC、DEBUG1 或 DEBUG2。
+- `logstate`:与日志消息关联的 SQL 状态码。
+- `logmessage`:日志或错误消息文本。
+- `logdetail`:与错误消息相关的详细消息文本。
+- `loghint`:与错误消息相关的提示消息文本。
+- `logquery`:内部生成的查询文本。
+- `logquerypos`:内部生成的查询文本中的游标索引。
+- `logcontext`:生成此消息的上下文。
+- `logdebug`:包含完整调试信息的查询字符串。
+- `logcursorpos`:查询字符串中的游标索引。
+- `logfunction`:生成此消息的函数。
+- `logfile`:生成此消息的日志文件。
+- `logline`:生成此消息的日志文件中的行。
+- `logstack`:与此消息关联的堆栈跟踪的完整文本。
+
+## 检查服务器配置文件
+
+每个 Apache Cloudberry 系统的组件(Coordinator、Standby Coordinator、主 Segment 和镜像 Segment)都有自己的服务器配置文件(`postgresql.conf`)。可以使用以下 `gp_toolkit` 对象检查系统中所有主 `postgresql.conf` 文件的参数设置:
+
+- [`gp_param_setting('parameter_name')`](#gp_param_settingparameter_name)
+- [`gp_param_settings_seg_value_diffs`](#gp_param_settings_seg_value_diffs)
+
+### gp_param_setting('parameter_name')
+
+该函数接收一个服务器配置参数的名称,并返回 Coordinator 和每个活动 Segment 的 `postgresql.conf` 值。此函数对所有用户可用。视图的列描述如下:
+
+- `paramsegment`:Segment 内容 ID(仅显示活动 Segment )。Coordinator 内容 ID 始终为 `-1`。
+- `paramname`:参数名称。
+- `paramvalue`:参数值。
+
+示例:
+
+```sql
+SELECT * FROM gp_toolkit.gp_param_setting('max_connections');
+```
+
+### gp_param_settings_seg_value_diffs
+
+被分类为 *local* 参数的服务器配置参数(即每个 Segment 从其自己的 `postgresql.conf` 文件中获取参数值)应该在所有 Segment 上设置为相同的值。该视图显示了不一致的本地参数设置。预期有不同值的参数(例如 `port`)不包括在内。该视图对所有用户可用。
+
+视图的列描述如下:
+
+- `psdname`:参数名称。
+- `psdvalue`:参数值。
+- `psdcount`:拥有该值的 Segment 的数量。
+
+## 检查下线的 Segment
+
+可以使用 [`gp_pgdatabase_invalid`](#gp_pgdatabase_invalid) 视图检查处于下线状态的 Segment。
+
+### gp_pgdatabase_invalid
+
+该视图显示系统目录中标记为下线 Segment 的信息。该视图对所有用户可用。视图的列描述如下:
+
+- `pgdbidbid`:Segment 的 dbid。每个 Segment 都有一个唯一的 dbid。
+- `pgdbiisprimary`:该 Segment 当前是否作为主 Segment (活动 Segment)?(`t` 或 `f`)。
+- `pgdbicontent`:此 Segment 的内容 ID。主 Segment 和镜像 Segment 将具有相同的内容 ID。
+- `pgdbivalid`:此 Segment 是否在线并有效?(`t` 或 `f`)。
+- `pgdbidefinedprimary`:此 Segment 在系统初始化时是否被分配为主 Segment 角色?(`t` 或 `f`)。
+
+## 检查资源组活动和状态
+
+:::note 注意
+本节描述的资源组活动和状态视图仅在基于资源组的资源管理处于激活状态时有效。
+:::
+
+资源组用于管理事务,以避免耗尽系统的 CPU 和内存资源。每个数据库用户都被分配到一个资源组。Apache Cloudberry 在执行用户提交的事务之前,会根据用户资源组的配置限制来评估该事务。
+
+你可以使用 `gp_resgroup_config` 视图查看每个资源组的配置情况。你可以使用 `gp_resgroup_status*` 视图来显示每个资源组的当前事务状态和资源使用情况。
+
+- [`gp_resgroup_config`](#gp_resgroup_config)
+- [`gp_resgroup_role`](#gp_resgroup_role)
+- [`gp_resgroup_status`](#gp_resgroup_status)
+- [`gp_resgroup_status_per_host`](#gp_resgroup_status_per_host)
+- [`gp_resgroup_status_per_segment`](#gp_resgroup_status_per_segment)
+
+### gp_resgroup_config
+
+`gp_resgroup_config` 视图允许管理员查看资源组的当前 CPU、内存和并发限制。
+
+该视图对所有用户可用。视图的列描述如下:
+
+- `groupid`:资源组的 ID。
+- `groupname`:资源组的名称。
+- `concurrency`:资源组指定的并发 (`CONCURRENCY`) 值。
+- `cpu_max_percent`:资源组指定的 CPU 限制 (`CPU_MAX_PERCENT`) 值,或为 `-1`。
+- `cpu_weight`:资源组的调度优先级 (`CPU_WEIGHT`)。
+- `cpuset`:为资源组保留的 CPU 核心 (CPUSET),或为 -1。
+- `memory_quota`:资源组指定的内存配额值。
+- `min_cost`:要包含在资源组中的查询计划的最小成本 (`MIN_COST`)。
+- `io_limit`:为分配给特定表空间 (以表空间 oid 显示) 和资源组的查询设置的最大顺序读写磁盘 I/O 吞吐量,以及每秒的最大读写 I/O 操作 (`IO_LIMIT`)。
+
+### gp_resgroup_role
+
+`gp_resgroup_role` 视图允许管理员查看分配给每个角色的资源组。
+
+该视图对所有用户可用。视图的列描述如下:
+
+- `rrrolname`:角色的名称。
+- `rrrsgname`:资源组的名称。
+
+### gp_resgroup_status
+
+`gp_resgroup_status` 视图允许管理员查看资源组的状态和活动。它显示每个资源组有多少查询在等待执行,以及当前系统中有多少查询正在运行。该视图还展示了资源组的当前内存和 CPU 使用情况。
+
+:::note 注意
+资源组使用主机系统上配置的 Linux 控制组(cgroups)。这些 cgroups 用于管理主机系统资源。当资源组使用的是嵌套 cgroups 中的一部分时,资源组的限制是相对于父 cgroup 的分配。有关嵌套 cgroups 和 Apache Cloudberry 资源组限制的信息,请参阅《使用资源组》文档。
+:::
+
+该视图对所有用户开放。视图的各列描述如下:
+
+- `groupid`:资源组的 ID。
+- `groupname`:资源组的名称。
+- `num_running`:当前在资源组中运行的事务数量。
+- `num_queueing`:当前在资源组中排队的事务数量。
+- `num_queued`:自 Apache Cloudberry 集群上次启动以来,资源组中排队的事务总数(不包括 `num_queueing`)。
+- `num_executed`:自 Apache Cloudberry 集群上次启动以来,在资源组中执行的事务总数(不包括 `num_running`)。
+- `total_queue_duration`:自 Apache Cloudberry 集群上次启动以来,任何事务排队的总时长。
+
+`gp_resgroup_status` 视图的示例输出:
+
+```sql
+select * from gp_toolkit.gp_resgroup_status;
+
+groupid | groupname | num_running | num_queueing | num_queued | num_executed | total_queue_duration 
+---------+-----------+-------------+--------------+------------+--------------+----------------------
+(0 rows)
+```
+
+### gp_resgroup_status_per_host
+
+`gp_resgroup_status_per_host` 视图显示每个资源组在每个主机上的实时 CPU 和内存使用情况(MB)。该视图还展示了每个资源组在主机上的可用和分配的固定内存和共享内存。
+
+视图的各列描述如下:
+
+- `groupid`:资源组的 ID。
+- `groupname`:资源组的名称。
+- `hostname`:分 Segment 主机的主机名。
+- `cpu_usage`:资源组在主机上的实时 CPU 核心使用情况。该值为资源组在主机上使用的 CPU 核心百分比(以浮点值表示)的总和。
+- `memory_usage`:每个数据库 Segment 主机上资源组的实时内存使用情况,以 MB 为单位。
+
+`gp_resgroup_status_per_host` 视图的示例输出:
+
+```sql
+select * from gp_toolkit.gp_resgroup_status_per_host;
+groupid | groupname | hostname | cpu_usage | memory_usage 
+---------+-----------+----------+-----------+--------------
+(0 rows)
+```
+
+### gp_resgroup_status_per_segment
+
+`gp_toolkit.gp_resgroup_status_per_segment` 视图用于展示按 Segment 分组的资源组内存使用情况,统计数据由 vmem tracker 提供,单位为 MB。该视图适用于数据库管理员监控各 Segment 上资源组的内存占用情况。
+
+:::note 注意
+此视图仅在启用了资源组(Resource Group)资源管理功能的情况下可用。
+:::
+
+视图各列含义如下:
+
+- `groupid`(类型:`oid`):资源组的唯一标识,对应 `pg_resgroup.oid`。
+- `groupname`(类型:`name`):资源组名称,对应 `pg_resgroup.rsgname`。
+- `segment_id`(类型:`smallint`):对应 Segment 实例的 content ID,来源于 `gp_segment_configuration.content`。
+- `vmem_usage`(类型:`smallint`):该资源组在对应 Segment 上的实时内存使用量(单位:MB)。
+
+## 检查资源队列活动和状态
+
+Note
+
+本节描述的资源队列活动和状态视图仅在基于资源队列的资源管理处于活动状态时有效。
+
+资源队列的目的是限制系统在任何时刻可以执行的活动查询数量,以避免耗尽系统资源,如内存、CPU 和磁盘 I/O。所有数据库用户都被分配到一个资源队列,用户提交的每条语句在运行之前,都会先评估是否符合资源队列的限制。`gp_resq_*` 系列视图可用于检查通过各自的资源队列当前提交到系统的语句状态。需要注意的是,超级用户发出的语句不受资源排队的限制。
+
+- [`gp_resq_activity`](#gp_resq_activity)
+- [`gp_resq_activity_by_queue`](#gp_resq_activity_by_queue)
+- [`gp_resq_priority_statement`](#gp_resq_priority_statement)
+- [`gp_resq_role`](#gp_resq_role)
+- [`gp_resqueue_status`](#gp_resqueue_status)
+
+### gp_resq_activity
+
+对于具有活动工作负载的资源队列,该视图显示每个通过资源队列提交的活动语句的一行。该视图对所有用户可见。
+
+视图中的列描述如下:
+
+- `resqprocpid`:分配给此语句的进程ID(在 Coordinator 上)。
+- `resqrole`:用户名。
+- `resqoid`:资源队列对象ID。
+- `resqname`:资源队列名称。
+- `resqstart`:语句提交给系统的时间。
+- `resqstatus`:语句的状态:运行中、等待中或已取消。
+
+### gp_resq_activity_by_queue
+
+对于具有活动工作负载的资源队列,该视图显示队列活动的汇总。该视图对所有用户可见。
+
+视图中的列描述如下:
+
+- `resqoid`:资源队列对象ID。
+- `resqname`:资源队列名称。
+- `resqlast`:提交到队列的最后一条语句的时间。
+- `resqstatus`:最后一条语句的状态:运行中、等待中或已取消。
+- `resqtotal`:此队列中的语句总数。
+
+### gp_resq_priority_statement
+
+该视图显示了当前在 Apache Cloudberry 系统中运行的所有语句的资源队列优先级、会话 ID 以及其他相关信息。所有用户均可访问该视图。
+
+视图中的列描述如下:
+
+- `rqpdatname`:当前会话连接的数据库名称。
+- `rqpusename`:发出该语句的用户。
+- `rqpsession`:会话 ID。
+- `rqpcommand`:该会话中的语句编号(命令 ID 和会话 ID 唯一标识一条语句)。
+- `rqppriority`:此语句的资源队列优先级(`MAX`、`HIGH`、`MEDIUM`、`LOW`)。
+- `rqpweight`:与该语句优先级相关的整数值。
+- `rqpquery`:该语句的查询文本。
+
+### gp_resq_role
+
+该视图显示与某个角色相关联的资源队列。所有用户均可访问该视图。
+
+视图中的列描述如下:
+
+- `rrrolname`:角色(用户)名称。
+- `rrrsqname`:分配给该角色的资源队列名称。如果角色没有明确分配给资源队列,则它将处于默认资源队列 (*pg_default*) 中。
+
+### gp_resqueue_status
+
+该视图允许管理员查看资源队列的状态和活动情况。它显示有多少查询正在等待执行,以及来自特定资源队列的当前活动查询数量。
+
+视图中的列描述如下:
+
+- `queueid`:资源队列的 ID。
+- `rsqname`:资源队列的名称。
+- `rsqcountlimit`:资源队列的活动查询阈值。值为 `-1` 表示没有限制。
+- `rsqcountvalue`:当前在资源队列中使用的活动查询槽数量。
+- `rsqcostlimit`:资源队列的查询成本阈值。值为 `-1` 表示没有限制。
+- `rsqcostvalue`:当前在资源队列中的所有语句的总成本。
+- `rsqmemorylimit`:资源队列的内存限制。
+- `rsqmemoryvalue`:当前在资源队列中的所有语句所使用的总内存。
+- `rsqwaiters`:当前在资源队列中等待的语句数量。
+- `rsqholders`:当前从该资源队列在系统中运行的语句数量。
+
+## 查询磁盘溢出空间使用情况
+
+*gp_workfile* 视图显示了当前使用磁盘溢出空间的所有查询的信息。当 Apache Cloudberry 由于内存不足无法在内存中运行查询时,会在磁盘上创建工作文件。这些信息可用于故障排除和查询优化。此外,这些视图中的信息还可以用于指定 Apache Cloudberry 配置参数 `gp_workfile_limit_per_query` 和 `gp_workfile_limit_per_segment` 的值。
+
+- [`gp_workfile_entries`](#gp_workfile_entries)
+- [`gp_workfile_usage_per_query`](#gp_workfile_usage_per_query)
+- [`gp_workfile_usage_per_segment`](#gp_workfile_usage_per_segment)
+
+### gp_workfile_entries
+
+该视图为当前每个在 Segment 上使用工作文件的操作符提供一行信息。该视图对所有用户可用,但非超级用户只能查看他们有权限访问的数据库的信息。
+
+视图中的列描述如下:
+
+| 列            | 类型    | 描述                                     |
+|---------------|---------|------------------------------------------|
+| `datname`     | name    | 数据库名称。                             |
+| `pid`         | integer | 服务器进程的进程 ID。                    |
+| `sess_id`     | integer | 会话 ID。                                |
+| `command_cnt` | integer | 查询的命令 ID。                          |
+| `usename`     | name    | 角色名称。                               |
+| `query`       | text    | 当前正在运行的查询。                     |
+| `segid`       | integer | Segment ID。                             |
+| `slice`       | integer | 查询计划片段,即当前执行的查询计划部分。 |
+| `optype`      | text    | 创建工作文件的查询操作符类型。           |
+| `size`        | bigint  | 工作文件的大小(以字节为单位)。         |
+| `numfiles`    | integer | 创建的文件数量。                         |
+| `prefix`      | text    | 命名相关工作文件集时使用的前缀。         |
+
+### gp_workfile_usage_per_query
+
+该视图为每个当前使用磁盘空间进行工作文件的查询提供一行信息。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的数据库信息。
+
+视图的列描述如下:
+
+| 列            | 类型    | 描述                             |
+|---------------|---------|----------------------------------|
+| `datname`     | name    | 数据库名称。                     |
+| `pid`         | integer | 服务器进程的进程 ID。            |
+| `sess_id`     | integer | 会话 ID。                        |
+| `command_cnt` | integer | 查询的命令 ID。                  |
+| `usename`     | name    | 角色名称。                       |
+| `query`       | text    | 当前进程正在运行的查询。         |
+| `segid`       | integer | Segment ID。                     |
+| `size`        | numeric | 工作文件的大小(以字节为单位)。 |
+| `numfiles`    | bigint  | 创建的文件数量。                 |
+
+### gp_workfile_usage_per_segment
+
+该视图为每个 Segment 包含一行数据。每行显示当前时间 Segment 上工作文件使用的总磁盘空间。该视图对所有用户可用,但非超级用户只能查看其有权限访问的数据库的信息。
+
+视图的列描述如下:
+
+| 列         | 类型     | 描述                        |
+|------------|----------|-----------------------------|
+| `segid`    | smallint | Segment ID。                |
+| `size`     | numeric  | Segment上工作文件的总大小。 |
+| `numfiles` | bigint   | 创建的文件数量。            |
+
+## 查看用户和角色
+
+将用户(角色)进行分组,以便更方便地管理对象权限是很常见的做法。通过这种方式,可以对整个组授予或撤销权限。在 Apache Cloudberry 中,这通过创建一个代表该组的角色来实现,然后将用户角色加入该组角色的成员。
+
+可以使用 [`gp_roles_assigned`](#gp_roles_assigned) 视图查看系统中的所有角色及其分配的成员(如果该角色也是一个组角色)。
+
+### gp_roles_assigned
+
+该视图显示系统中的所有角色及其分配的成员(如果该角色也是一个组角色)。所有用户均可访问该视图。
+
+视图的列说明如下:
+
+- `raroleid`:角色对象 ID。如果该角色有成员(用户),则视为\*组\*角色。
+- `rarolename`:角色(用户或组)名称。
+- `ramemberid`:作为该角色成员的角色对象 ID。
+- `ramembername`:作为该角色成员的角色名称。
+
+## 检查数据库对象大小和磁盘空间
+
+`gp_size_*` 系列视图可用于确定分布式 Apache Cloudberry 数据库、Schema、表或索引的磁盘空间使用情况。以下视图计算所有主 Segment (不包括镜像)的对象总大小。
+
+- [`gp_size_of_all_table_indexes`](#gp_size_of_all_table_indexes)
+- [`gp_size_of_database`](#gp_size_of_database)
+- [`gp_size_of_index`](#gp_size_of_index)
+- [`gp_size_of_schema_disk`](#gp_size_of_schema_disk)
+- [`gp_size_of_table_and_indexes_disk`](#gp_size_of_table_and_indexes_disk)
+- [`gp_size_of_table_and_indexes_licensing`](#gp_size_of_table_and_indexes_licensing)
+- [`gp_size_of_table_disk`](#gp_size_of_table_disk)
+- [`gp_size_of_table_uncompressed`](#gp_size_of_table_uncompressed)
+- [`gp_disk_free`](#gp_disk_free)
+
+表和索引大小视图按对象 ID 列出关系(而不是按名称)。要按名称检查表或索引的大小,必须在 `pg_class` 表中查找关系名称(`relname`)。例如:
+
+```sql
+SELECT relname as name, sotdsize as size, sotdtoastsize as 
+toast, sotdadditionalsize as other 
+FROM gp_size_of_table_disk as sotd, pg_class 
+WHERE sotd.sotdoid=pg_class.oid ORDER BY relname;
+```
+
+### gp_size_of_all_table_indexes
+
+该视图显示某个表所有索引的总大小。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的关系。
+
+视图的列说明如下:
+
+- `soatioid`:表的对象 ID。
+- `soatisize`:所有表索引的总大小(以字节为单位)。
+- `soatischemaname`:Schema 名称。
+- `soatitablename`:表名称。
+
+### gp_size_of_database
+
+该视图显示了数据库的总大小。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的数据库。
+
+视图中的列描述如下:
+
+- `sodddatname`:数据库名称。
+- `sodddatsize`:数据库大小(以字节为单位)。
+
+### gp_size_of_index
+
+该视图显示了索引的总大小。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的关系。
+
+视图中的列描述如下:
+
+- `soioid`:索引的对象 ID。
+- `soitableoid`:该索引所属表的对象 ID。
+- `soisize`:索引大小(以字节为单位)。
+- `soiindexschemaname`:索引 Schema 名称。
+- `soiindexname`:索引名称。
+- `soitableschemaname`:表 Schema 名称。
+- `soitablename`:表的名称。
+
+### gp_size_of_schema_disk
+
+该视图显示当前数据库中公共 Schema 和用户创建 Schema 的大小。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的 Schema。
+
+视图中的列描述如下:
+
+- `sosdnsp`:Schema 名称。
+- `sosdschematablesize`:Schema 中表的总大小(以字节为单位)。
+- `sosdschemaidxsize`:Schema 中索引的总大小(以字节为单位)。
+
+### gp_size_of_table_and_indexes_disk
+
+该视图显示表及其索引在磁盘上的大小。所有用户都可以访问该视图,但非超级用户只能查看他们有权限访问的关系。
+
+该视图的列描述如下:
+
+- `sotaidoid`:父表的对象 ID。
+- `sotaidtablesize`:表的磁盘大小。
+- `sotaididxsize`:表上所有索引的总大小。
+- `sotaidschemaname`:Schema 名称。
+- `sotaidtablename`:表名称。
+
+### gp_size_of_table_and_indexes_licensing
+
+该视图显示用于许可目的的表及其索引的总大小。使用该视图需要超级用户权限。
+
+该视图的列描述如下:
+
+- `sotailoid`:表的对象 ID。
+- `sotailtablesizedisk`:表的总磁盘大小。
+- `sotailtablesizeuncompressed`:如果表是压缩的追加优化表,显示未压缩的表大小(以字节为单位)。
+- `sotailindexessize`:表中所有索引的总大小。
+- `sotailschemaname`:Schema 名称。
+- `sotailtablename`:表名称。
+
+### gp_size_of_table_disk
+
+该视图显示表在磁盘上的大小。所有用户都可以访问该视图,但非超级用户只能查看他们有权限访问的表。该视图的列描述如下:
+
+- `sotdoid`:表的对象 ID。
+- `sotdsize`:表的大小(以字节为单位)。该大小仅为主表的大小,不包括超大(TOAST)属性等辅助对象或 AO 表的额外存储对象。
+- `sotdtoastsize`:如果存在,则为 TOAST 表(超大属性存储)的大小。
+- `sotdadditionalsize`:反映追加优化(AO)表的 Segment 和块目录表大小。
+- `sotdschemaname`:Schema 名称。
+- `sotdtablename`:表名称。
+
+### gp_size_of_table_uncompressed
+
+该视图显示追加优化(AO)表的未压缩表大小。否则,将显示表在磁盘上的大小。使用该视图需要超级用户权限。该视图的列描述如下:
+
+- `sotuoid`:表的对象 ID。
+- `sotusize`:如果是压缩的 AO 表,则为未压缩的表大小(以字节为单位)。否则,显示表在磁盘上的大小。
+- `sotuschemaname`:Schema 名称。
+- `sotutablename`:表名称。
+
+### gp_disk_free
+
+这个外部表在活动 Segment 主机上运行 `df`(磁盘空闲)命令,并返回结果。未激活的镜像不包括在计算中。使用此外部表需要超级用户权限。视图的列描述如下:
+
+- `dfsegment`:Segment 的内容 ID(仅显示活动 Segment)。
+- `dfhostname`:Segment 主机的主机名。
+- `dfdevice`:设备名称。
+- `dfspace`:Segment 文件系统中的空闲磁盘空间,以千字节为单位。
+
+## 检查缺失和孤立数据文件
+
+Apache Cloudberry 将在目录中存在但在磁盘上缺失的关系数据文件视为缺失。相反,当 Apache Cloudberry 遇到未在任何关系中引用的意外数据文件时,它会将该文件视为孤立。
+
+Apache Cloudberry 提供以下视图,以帮助识别当前数据库中是否存在缺失或孤立的文件:
+
+- [`gp_move_orphaned_files()`](#gp_move_orphaned_files)
+- [`gp_check_orphaned_files`](#gp_check_orphaned_files)
+- [`gp_check_missing_files`](#gp_check_missing_files)
+
+在扩展集群或进行离线维护之前,最好检查这些情况。
+
+默认情况下,本节中识别的视图对 `PUBLIC` 可用。
+
+### gp_check_orphaned_files
+
+`gp_check_orphaned_files` 视图扫描默认和用户定义的表空间以查找孤立的数据文件。Apache Cloudberry 在此检查中考虑正常数据文件、名称中带下划线(`_`)的文件,以及扩展编号文件(名称中包含 `.<N>` 的文件)。`gp_check_orphaned_files` 从 Apache Cloudberry Coordinator和所有 Segment 收集结果。
+
+视图的列描述如下:
+
+- `gp_segment_id`:数据库 Segment 标识符。
+- `tablespace`:孤立文件所在的表空间标识符。
+- `filename`:孤立数据文件的文件名。
+- `filepath`:孤立数据文件的文件系统路径,相对于 Coordinator 或 Segment 的数据目录。
+
+:::caution 注意
+将该视图作为识别孤立数据文件的众多数据点之一,请勿仅根据查询该视图的结果删除文件。
+:::
+
+### gp_check_missing_files
+
+`gp_check_missing_files` 视图扫描堆和追加优化的列式表,以查找缺失的数据文件。Apache Cloudberry 在此检查中仅考虑正常的数据文件(文件名中不包含 `.` 或 `_` 的文件)。`gp_check_missing_files` 收集来自 Apache Cloudberry Coordinator 和所有 Segment 的结果。
+
+该视图的列描述如下:
+
+- `gp_segment_id`:数据库 Segment 标识符。
+- `tablespace`:表所在表空间的标识符。
+- `relname`:缺失数据文件的表名。
+- `filename`:缺失数据文件的文件名。
+
+### gp_check_missing_files_ext
+
+`gp_check_missing_files_ext` 视图仅扫描追加优化的列式表,以查找缺失的扩展数据文件。Apache Cloudberry 在此检查中同时考虑正常数据文件和带有编号的扩展文件(文件名中包含 `.<N>` 的文件)。包含 `_` 的文件不在考虑范围内。`gp_check_missing_files_ext` 仅收集来自 Apache Cloudberry 数据库 Segment 的结果。
+
+该视图的列描述如下:
+
+- `gp_segment_id`:数据库 Segment 标识符。
+- `tablespace`:表所在表空间的标识符。
+- `relname`:缺失扩展数据文件的表名。
+- `filename`:缺失扩展数据文件的文件名。
+
+## 移动孤立数据文件
+
+`gp_move_orphaned_files()` 用户定义函数(UDF)将通过 [`gp_check_orphaned_files`](#gp_check_orphaned_files) 视图找到的孤立文件移动到你指定的文件系统位置。
+
+该函数的签名为: `gp_move_orphaned_files( <target_directory> TEXT )`。
+
+`<target_directory>` 必须在所有 Segment 主机上存在,且指定的目录必须可由 `gpadmin` 用户访问。如果你为 `<target_directory>` 指定相对路径,则该路径相对于 Coordinator 或 Segment 的数据目录。
+
+Apache Cloudberry 会将每个移动的数据文件重命名为一个反映文件在数据目录中原始位置的名称。文件名的格式取决于孤立文件所在的表空间:
+
+| 表空间         | 重命名的文件格式                                                                  |
+|----------------|-----------------------------------------------------------------------------------|
+| `default`      | `seg<num>_base_<database-oid>_<relfilenode>`                                      |
+| `global`       | `seg<num>_global_<relfilenode>`                                                   |
+| `user-defined` | `seg<num>_pg_tblspc_<tablespace-oid>_<gpdb-version>_<database-oid>_<relfilenode>` |
+
+例如,如果在默认表空间中名为 `12345` 的文件在主 Segment 2 中孤立,
+
+```sql
+SELECT * FROM gp_move_orphaned_files('/home/gpadmin/orphaned');
+```
+
+该命令将移动并重命名文件,如下所示:
+
+- 原始位置: `<data_directory>/base/13700/12345`
+- 新位置和文件名: `/home/gpadmin/orphaned/seg2_base_13700_12345`
+
+`gp_move_orphaned_files()` 会返回每个移动文件的原始和新文件系统位置,并指示移动操作的成功或失败。例如:
+
+```sql
+SELECT * FROM gp_toolkit.gp_move_orphaned_files('/home/gpadmin/orphaned');
+ gp_segment_id | move_success |           oldpath          |         newpath
+---------------+--------------+----------------------------+-----------------------------------
+            -1 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg-1_base_13715_99999
+             1 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg1_base_13715_99999
+             2 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg2_base_13715_99999
+(3 rows)
+```
+
+移动文件后,你可以选择删除它们或进行备份。
+
+## 检查不均匀的数据分布
+
+在 Apache Cloudberry 中,所有表都是分布式的,这意味着它们的数据被划分到系统中的所有 Segment 上。如果数据分布不均匀,查询处理性能可能会下降。以下视图可以帮助诊断表是否存在不均匀的数据分布:
+
+- [`gp_toolkit.gp_skew_coefficients`](#gp_skew_coefficients)
+- [`gp_toolkit.gp_skew_idle_fractions`](#gp_skew_idle_fractions)
+
+### gp_skew_coefficients
+
+该视图通过计算存储在每个 Segment 上的数据的变异系数 (CV) 来显示数据分布的偏斜情况。该视图对所有用户开放,但非超级用户只能查看他们有权限访问的表。
+
+视图中的列描述如下:
+
+- `skcoid`:表的对象 ID。
+- `skcnamespace`:定义表的命名空间。
+- `skcrelname`:表的名称。
+- `skccoeff`:变异系数 (CV) 的计算方法是标准偏差除以平均值。它考虑了数据系列的平均值及其变动性。值越低越好,值越高则表示数据偏斜程度越大。
+
+### gp_skew_idle_fractions
+
+该视图通过计算在表扫描过程中系统处于空闲状态的百分比来显示数据分布的偏斜情况,这也是处理数据偏斜的一个指标。该视图对所有用户开放,但非超级用户只能查看他们有权限访问的表。
+
+视图中的列描述如下:
+
+- `sifoid`:表的对象 ID。
+- `sifnamespace`:定义表的命名空间。
+- `sifrelname`:表的名称。
+- `siffraction`:在表扫描过程中系统处于空闲状态的百分比,这是不均匀数据分布或查询处理偏斜的一个指标。例如,`0.1` 表示 10% 的偏斜,`0.5` 表示 50% 的偏斜,依此类推。偏斜超过 10% 的表应评估其分布策略。
+
+## 维护分区
+
+如果你的数据库使用了分区,则需要定期执行某些任务以帮助维护这些分区。Apache Cloudberry 提供了一个视图和多个用户定义的函数来协助完成这些任务。
+
+### gp_partitions
+
+`gp_partitions` 视图显示数据库中的所有叶子分区。
+
+该视图与旧版的 `pg_partitions` 视图保持向后兼容(该视图在 Apache Cloudberry 的早期主要版本中可用)。视图的各列描述如下:
+
+| 列                         | 类型     | 描述                                               |
+|----------------------------|----------|----------------------------------------------------|
+| `schemaname`               | name     | 分区表所在 Schema 的名称。                         |
+| `tablename`                | name     | 顶层父表的名称。                                   |
+| `partitionschemaname`      | name     | 分区表的 Schema。                                  |
+| `partitiontablename`       | name     | 分区表的关系名称(如果直接访问分区时使用的表名)。 |
+| `parentpartitiontablename` | regclass | 该分区上一级父表的关系名称。                       |
+| `partitiontype`            | text     | 分区类型(范围或列表)。                           |
+| `partitionlevel`           | integer  | 此分区在层级中的级别。                             |
+| `partitionrank`            | integer  | 对于范围分区,与同级其他分区相比的排名。           |
+| `partitionlistvalues`      | text     | 对于列表分区,与该分区相关的列表值。               |
+| `partitionrangestart`      | text     | 对于范围分区,此分区的起始值。                     |
+| `partitionrangeend`        | text     | 对于范围分区,此分区的结束值。                     |
+| `partitionisdefault`       | boolean  | 如果这是默认分区,则为 T,否则为 F。               |
+| `partitionboundary`        | text     | 此分区的完整分区规范。                             |
+| `parenttablespace`         | name     | 该分区上一级父表的表空间。                         |
+| `partitiontablespace`      | name     | 此分区的表空间。                                   |
+
+### 用户定义的分区维护函数
+
+下表总结了 Apache Cloudberry 可帮助你维护分区的函数:
+
+| 函数                                      | 返回类型 | 描述                                                                      |
+|-------------------------------------------|----------|---------------------------------------------------------------------------|
+| `pg_partition_rank(rp regclass)`          | integer  | 对于范围分区,返回与同级其他分区的排名。对于其他类型的分区,返回 `NULL`。 |
+| `pg_partition_range_from(rp regclass)`    | text     | 返回范围分区的下界。                                                      |
+| `pg_partition_range_to(rp regclass)`      | text     | 返回范围分区的上界。                                                      |
+| `pg_partition_isdefault(rp regclass)`     | boolean  | 判断给定分区是否为默认分区。                                              |
+| `pg_partition_lowest_child(rp regclass)`  | regclass | 找到给定分区的最低排名子分区。                                            |
+| `pg_partition_highest_child(rp regclass)` | regclass | 找到给定分区的最高排名子分区。                                            |
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/index.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/index.md
new file mode 100644
index 000000000..4974be31c
--- /dev/null
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/index.md
@@ -0,0 +1,37 @@
+---
+title: 查询性能概述
+---
+
+# 查询性能概述
+
+Apache Cloudberry 能动态地清除无关分区以减少内存分配,以此来优化查询性能。这些机制可以显著减少查询扫描的数据量,加快查询执行速度,并提升系统的并发处理能力。
+
+:::tip 提示
+Apache Cloudberry 默认启用 GPORCA 优化器,扩展了原生 Postgres 优化器的查询规划与优化能力。
+:::
+
+## 动态分区消除
+
+在 Apache Cloudberry 中,系统利用仅在执行查询时才能确定的值来动态地对分区进行裁剪,从而提高查询处理速度。该功能称为动态分区消除(Dynamic Partition Elimination,简称 DPE)。
+
+DPE 适用于以下类型的连接操作:
+
+- `Hash Inner Join`
+- `Hash Left Join`
+- `Hash Right Join`(自 v2.0.0 起支持)
+
+启用 DPE 需满足以下条件:
+
+- 分区表必须作为 Join 的连接外表。
+- Join 条件必须是基于分区键的等值条件。
+- 必须对分区表收集统计信息,例如:
+
+    ```sql
+    ANALYZE <root partition>;
+    ```
+
+参数 `gp_dynamic_partition_pruning` 用于控制是否启用 DPE,默认值为 `ON`。该参数仅对 Postgres 优化器有效。你可以通过 `EXPLAIN` 查看执行计划中是否包含 `Partition Selector` 节点,以判断 DPE 是否实际生效。
+
+## 内存优化
+
+Apache Cloudberry 会根据查询中各个运算符的特点动态分配内存,并在查询不同阶段主动释放或重新分配内存资源,从而实现更高效的资源使用和查询执行。
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/manage-resources-using-resource-groups.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/manage-resources-using-resource-groups.md
index b768ed812..621b2334d 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/manage-resources-using-resource-groups.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/manage-resources-using-resource-groups.md
@@ -29,10 +29,10 @@ Apache Cloudberry 支持两种类型的资源组:用于管理角色资源的
 | `CPU_WEIGHT`      | 资源组的调度优先级。                                                               | \[1,500\]                 | 100                                                       |
 | `CPUSET`          | 为该资源组保留的特定 CPU 逻辑核(或超线程中的逻辑线程)。                          | 取决于系统核配置          | -1                                                        |
 | `IO_LIMIT`        | 读取/写入磁盘 I/O 吞吐量的最大限制,以及每秒的最大读/写 I/O 操作。按表空间设置值。 | \[2,4294967295 或 `max`\] | -1                                                        |
-| `MEMORY_LIMIT`    | 为资源组指定的内存限制值。                                                         | `Integar`(MB)           | -1(未设置,使用 `statement_mem` 作为单个查询的内存限制) |
+| `MEMORY_QUOTA`    | 为资源组指定的内存限制值。                                                         | `Integar`(MB)           | -1(未设置,使用 `statement_mem` 作为单个查询的内存限制) |
 | `MIN_COST`        | 查询计划被包含在资源组中的最小成本。                                               | `Integar`                 | 0                                                         |
 
-:::note
+:::note 注意
 对于 `SET` 、 `RESET` 和 `SHOW` 命令,不强制执行资源限制。
 :::
 
@@ -130,15 +130,15 @@ Apache Cloudberry 使用服务器配置参数 `gp_resource_group_cpu_limit` 来
 
 分配给查询的内存量由以下参数确定:
 
-资源组的 `MEMORY_LIMIT` 参数设置此资源组在段上的最大内存量。这决定了查询执行期间该段主机上所有工作进程可消耗的内存总量。分配给查询的内存量是组内存限制除以组并发限制: `MEMORY_LIMIT` / `CONCURRENCY`。
+资源组的 `MEMORY_QUOTA` 参数设置此资源组在段上的最大内存量。这决定了查询执行期间该段主机上所有工作进程可消耗的内存总量。分配给查询的内存量是组内存限制除以组并发限制: `MEMORY_QUOTA` / `CONCURRENCY`。
 
 如果查询需要大量内存,您可以使用服务器配置参数 `gp_resgroup_memory_query_fixed_mem` 在会话级别为查询设置固定的内存量。该参数会覆盖并可以超出资源组的分配内存。
 
-Apache Cloudberry 在处理传入查询时使用 `gp_resgroup_memory_query_fixed_mem` 的值(如果设置),以绕过资源组设置。否则,它使用 `MEMORY_LIMIT` / `CONCURRENCY` 作为查询的分配内存。如果 `MEMORY_LIMIT` 未设置,则查询内存分配的默认值为 `statement_mem`。
+Apache Cloudberry 在处理传入查询时使用 `gp_resgroup_memory_query_fixed_mem` 的值(如果设置),以绕过资源组设置。否则,它使用 `MEMORY_QUOTA` / `CONCURRENCY` 作为查询的分配内存。如果 `MEMORY_QUOTA` 未设置,则查询内存分配的默认值为 `statement_mem`。
 
 对于所有查询,如果系统内存不足,它们会溢出到磁盘。当达到限制 `gp_workfile_limit_files_per_query` 时,Apache Cloudberry 数据库会生成内存不足 (OOM) 错误。
 
-例如,考虑一个名为 `adhoc` 的资源组,其 `MEMORY_LIMIT` 设置为 1.5 GB,`CONCURRENCY` 设置为 3。默认情况下,提交给该组的每个语句分配 500 MB 的内存。现在考虑以下一系列事件:
+例如,考虑一个名为 `adhoc` 的资源组,其 `MEMORY_QUOTA` 设置为 1.5 GB,`CONCURRENCY` 设置为 3。默认情况下,提交给该组的每个语句分配 500 MB 的内存。现在考虑以下一系列事件:
 
 1. 用户 `ADHOC_1` 提交查询 `Q1`, 将 `gp_resgroup_memory_query_fixed_mem` 重写为 800MB。 `Q1` 语句被接纳到系统中。
 
@@ -154,10 +154,10 @@ Apache Cloudberry 在处理传入查询时使用 `gp_resgroup_memory_query_fixed
 
 有关内存限制的一些特殊使用注意事项:
 
-- 如果设置配置参数 `gp_resource_group_bypass` 或 `gp_resource_group_bypass_catalog_query` 以绕过资源组限制,则查询的内存限制取 `statement_mem` 的值。
-- 当 (`MEMORY_LIMIT` / `CONCURRENCY`) \< `statement_mem` 时,Apache Cloudberry 使用 `statement_mem` 作为分配给查询的固定内存量。
-- `statement_mem` 的最大值被限制为 `max_statement_mem`。
-- 计划成本低于限制 `MIN_COST` 的查询使用 `statement_mem` 的内存限制。
+- 如果设置了配置参数 `gp_resource_group_bypass` 或 `gp_resource_group_bypass_catalog_query` 来绕过资源组限制,则查询的内存限制将取决于 `statement_mem` 的值。
+- 当 (`MEMORY_QUOTA` / `CONCURRENCY`) 小于 `statement_mem` 时,系统会直接使用 `statement_mem` 作为该查询的固定内存分配值。
+- `statement_mem` 的最大取值受 `max_statement_mem` 限制。
+- 查询的计划成本如果低于设定的 `MIN_COST`,则该查询也将使用 `statement_mem` 所指定的内存作为限制。
 
 ### 磁盘 I/O 限制
 
@@ -190,11 +190,12 @@ stat -fc %T /sys/fs/cgroup/
 
 对于 cgroup v1,输出为 `tmpfs`。对于 cgroup v2,输出为 `cgroup2fs`。
 
-:::note
-Linux 控制组可被更改,但如果你使用较旧版本的操作系统,例如 Centos 7.x 或更早,将只能使用默认的 `cgroup v1` 控制组;如果你使用的是 Centos 8.x,可按照下方步骤,将控制组从 v1 切换到 v2。
+:::note 注意
+- Linux 控制组可被更改,但如果您使用较旧版本的操作系统,例如 Centos 7.x 或更早,将只能使用默认的 `cgroup v1` 控制组;如果你使用的是 Centos 8.x,可按照下方步骤,将控制组从 v1 切换到 v2。
+- 从 v2.0.0 起,对于 `cpu.pressure`,即使 `gp_resource_manager` 设置为 `group-v2`,Apache Cloudberry 也不再检查 `/proc/pressure/cpu` 接口的权限或是否存在。因此,即使未启用 PSI(Pressure Stall Information),只要内核版本兼容,仍可正常使用 `group-v2` 模式。
 :::
 
-如无需更改 cgroup 版本,可以直接跳到 `optimize-performance/manage-resources-using-resource-groups:配置 cgroup v1` 或 `optimize-performance/manage-resources-using-resource-groups:配置 cgroup v2` 完成配置先决条件。
+如无需更改 cgroup 版本,可以直接跳到[配置 cgroup v1](#配置-cgroup-v1) 或[配置 cgroup v2](#配置-cgroup-v2) 完成配置先决条件。
 
 如希望从 cgroup v1 切换到 v2,可以以 root 身份运行以下命令:
 
@@ -405,12 +406,12 @@ SELECT * FROM gp_toolkit.gp_resgroup_config;
 
 当为角色创建资源组时,需要提供名称和 CPU 资源分配模式(核或百分比)。还可以选择性地提供并发事务限制、内存限制、CPU 软优先级、磁盘 I/O 限制和最低成本。使用 `CREATE RESOURCE GROUP` 命令创建新的资源组。
 
-为角色创建资源组时,必须提供 `CPU_MAX_PERCENT` 或 `CPUSET` 限制值。这些限制确定分配给该资源组的 Apache Cloudberry CPU 资源的百分比。可指定 `MEMORY_LIMIT` 来为资源组保留固定数量的内存。
+为角色创建资源组时,必须提供 `CPU_MAX_PERCENT` 或 `CPUSET` 限制值。这些限制确定分配给该资源组的 Apache Cloudberry CPU 资源的百分比。可指定 `MEMORY_QUOTA` 来为资源组保留固定数量的内存。
 
 例如,要创建一个名为 *rgroup1* 的资源组,其 CPU 限制为 20,内存限制为 25,CPU 软优先级为 500,最低成本为 50,以及 `pg_default` 表空间的磁盘 I/O 限制:
 
 ``` sql
-CREATE RESOURCE GROUP rgroup1 WITH (CONCURRENCY=20, CPU_MAX_PERCENT=20, MEMORY_LIMIT=250, CPU_WEIGHT=500, MIN_COST=50, IO_LIMIT='pg_default: wbps=1000, rbps=1000, wiops=100, riops=100');
+CREATE RESOURCE GROUP rgroup1 WITH (CONCURRENCY=20, CPU_MAX_PERCENT=20, MEMORY_QUOTA=250, CPU_WEIGHT=500, MIN_COST=50, IO_LIMIT='pg_default: wbps=1000, rbps=1000, wiops=100, riops=100');
 ```
 
 :::note
@@ -423,7 +424,7 @@ CPU 限制 20 被分配给每个分配到 `rgroup1` 的角色。同样,内存
 
 ``` sql
 ALTER RESOURCE GROUP rg_role_light SET CONCURRENCY 7;
-ALTER RESOURCE GROUP exec SET MEMORY_LIMIT 30;
+ALTER RESOURCE GROUP exec SET MEMORY_QUOTA 30;
 ALTER RESOURCE GROUP rgroup1 SET CPUSET '1;2,4';
 ALTER RESOURCE GROUP sales SET IO_LIMIT 'tablespace1:wbps=2000,wiops=2000;tablespace2:rbps=2024,riops=2024'; 
 ```
@@ -471,7 +472,7 @@ ALTER ROLE mary RESOURCE GROUP NONE;
 
 ### 浏览资源组限制
 
-`gp_resgroup_config`. `gp_toolkit` 系统视图显示资源组的当前限制。要查看所有资源组的限制:
+`gp_toolkit.gp_resgroup_config` 系统视图显示资源组的当前限制。要查看所有资源组的限制:
 
 ``` sql
 SELECT * FROM gp_toolkit.gp_resgroup_config;
@@ -479,7 +480,7 @@ SELECT * FROM gp_toolkit.gp_resgroup_config;
 
 ### 浏览资源组查询状态
 
-`gp_resgroup_status`.`gp_toolkit` 系统视图能够查看资源组的状态和活动。该视图显示正在运行和排队的事务数量。要查看此信息:
+`gp_toolkit.gp_resgroup_status` 系统视图能够查看资源组的状态和活动。该视图显示正在运行和排队的事务数量。要查看此信息:
 
 ``` sql
 SELECT * FROM gp_toolkit.gp_resgroup_status;
@@ -487,7 +488,7 @@ SELECT * FROM gp_toolkit.gp_resgroup_status;
 
 ### 按主机浏览资源组内存使用
 
-`gp_resgroup_status_per_host` `gp_toolkit` 系统视图能按主机查看资源组的实时内存使用情况。要查看此信息:
+`gp_toolkit.gp_resgroup_status_per_host` 系统视图能按主机查看资源组的实时内存使用情况。要查看此信息:
 
 ``` sql
 SELECT * FROM gp_toolkit.gp_resgroup_status_per_host;
@@ -504,7 +505,7 @@ WHERE pg_roles.rolresgroup=pg_resgroup.oid;
 
 ### 浏览资源组磁盘 I/O 使用情况
 
-`gp_resgroup_iostats_per_host` `gp_toolkit` 系统视图能按主机查看资源组的实时磁盘 I/O 使用情况。要查看此信息:
+`gp_toolkit.gp_resgroup_iostats_per_host` 系统视图能按主机查看资源组的实时磁盘 I/O 使用情况。要查看此信息:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_iostats_per_host;
@@ -615,7 +616,7 @@ Apache Cloudberry 在运行事务之前会考虑内存可用性,如果没有
 
 **我的查询由于内存不足而无法运行,导致内存泄漏(OOM)。**
 
-首先,确保资源组分配的内存足够满足查询的需求,通过调整资源组参数,如 `CONCURRENCY` 和 `MEMORY_LIMIT`。分析查询的类型,是否会产生大量的中间结果占用内存。如果确实存在,可设置合理的 `gp_resgroup_memory_query_fixed_mem`,以便在会话级别为该特定查询分配更多内存。
+首先,确保资源组分配的内存足够满足查询的需求,通过调整资源组参数,如 `CONCURRENCY` 和 `MEMORY_QUOTA`。分析查询的类型,是否会产生大量的中间结果占用内存。如果确实存在,可设置合理的 `gp_resgroup_memory_query_fixed_mem`,以便在会话级别为该特定查询分配更多内存。
 
 **在内存泄漏(OOM)后,系统的并发负载很高。**
 
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/update-stats-using-analyze.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/update-stats-using-analyze.md
index 0ec475686..0d532d1c6 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/update-stats-using-analyze.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.x/performance/update-stats-using-analyze.md
@@ -50,6 +50,12 @@ SELECT * FROM pg_partition_tree( 'parent_table' );
 
 `ANALYZE` 只需要对表进行读取锁定,因此可以与其他数据库操作并行执行。但出于性能原因,不建议在执行加载、`INSERT`、`UPDATE`、`DELETE` 和 `CREATE INDEX` 操作时执行 `ANALYZE`。
 
+:::info 提示
+Apache Cloudberry 优化了分区表执行 `ANALYZE` 时的行为。当对某个叶分区(例如 `ANALYZE sales_1_prt_p2023`)显式执行统计信息收集时,系统不会再自动更新根表或其他分区的统计信息。只有显式对根表(例如 `ANALYZE sales`)执行 `ANALYZE` 时,才会更新整张表的统计信息,包括所有子分区。
+
+这种行为的改进提高了统计信息管理的控制力,避免了不必要的统计刷新。在实际使用中,推荐根据数据变化情况选择性地分析具体分区或整表。
+:::
+
 ## 配置自动统计信息收集
 
 配置参数 `gp_autostats_mode` 与 `gp_autostats_on_change_threshold` 一起确定何时触发自动分析操作。当触发自动统计信息收集时,优化器会在查询中加入 `ANALYZE` 步骤。
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.x/query-performance-overview.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.x/query-performance-overview.md
deleted file mode 100644
index a0de42a18..000000000
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.x/query-performance-overview.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: 查询性能概述
----
-
-# 查询性能概述
-
-Apache Cloudberry 能动态地清除表中的无关分区,并对查询中的不同运算符进行最优内存分配。有了这些优化,数据库执行查询时会减少扫描的数据量,加速查询处理,并支持更多并发。
-
-- 动态分区消除
-
-    在 Apache Cloudberry 中,系统会利用仅在执行查询时才能确定的值来动态地对分区进行裁剪,从而提高查询处理速度。通过设置服务器配置参数 `gp_dynamic_partition_pruning` 为 `ON` 或 `OFF` 来启用或禁用动态分区裁剪,默认情况下为 `ON`。
-
-- 内存优化
-
-    Apache Cloudberry 为查询中的不同运算符进行最优分配内存,在处理查询的不同阶段释放或重新分配内存。
-
-:::tip 提示
-Apache Cloudberry 默认使用 GPORCA 优化器。 GPORCA 扩展了 Postgres 优化器的规划和优化能力。
-:::
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.x/sys-catalogs/gp_toolkit.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.x/sys-catalogs/gp_toolkit.md
new file mode 100644
index 000000000..2f23d9f5d
--- /dev/null
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.x/sys-catalogs/gp_toolkit.md
@@ -0,0 +1,1007 @@
+# 使用 gp_toolkit Schema 查看系统信息
+
+Apache Cloudberry 提供了一个名为 `gp_toolkit` 的管理 Schema,你可以用它查询系统目录、日志文件和操作环境中的系统状态信息。`gp_toolkit` Schema 包含多个视图,可以通过 SQL 命令访问这些视图。所有数据库用户都能访问 `gp_toolkit` Schema,虽然某些对象可能需要超级用户权限。为了方便使用,你可以将 `gp_toolkit` Schema 添加到你的 Schema 搜索路径中。例如:
+
+```sql
+=> ALTER ROLE myrole SET search_path TO myschema,gp_toolkit;
+```
+
+本文档描述了 `gp_toolkit` 中一些最有用的视图和用户定义函数(UDF)。你可能会发现 `gp_toolkit` Schema 中还有其他对象(视图、函数和外部表),这些对象是为了支持本节中描述的视图而存在,本文件中未具体描述它们。
+
+:::caution 小心
+请勿更改 `gp_toolkit` Schema 中的数据库对象,也不要在该 Schema 中创建新的数据库对象,否则可能会影响这些对象所返回信息的准确性。通过 `gpbackup` 和 `gprestore` 工具进行数据库备份和恢复时,对 `gp_toolkit` Schema 所做的任何更改都会丢失。
+:::
+
+`gp_toolkit` Schema 中的视图可以分为以下几类:
+
+[检查需要例行维护的表](#检查需要例行维护的表)
+[检查锁](#检查锁)
+[检查 ao 表](#检查-ao-表)
+[查看 apache cloudberry 服务器日志文件](#查看-apache-cloudberry-服务器日志文件)
+[检查服务器配置文件](#检查服务器配置文件)
+[检查下线的 segment](#检查下线的-segment)
+[检查资源组活动和状态](#检查资源组活动和状态)
+[检查资源队列活动和状态](#检查资源队列活动和状态)
+[查询磁盘溢出空间使用情况](#查询磁盘溢出空间使用情况)
+[查看用户和角色](#查看用户和角色)
+[检查数据库对象大小和磁盘空间](#检查数据库对象大小和磁盘空间)
+[检查缺失和孤立数据文件](#检查缺失和孤立数据文件)
+[移动孤立数据文件](#移动孤立数据文件)
+[检查不均匀的数据分布](#检查不均匀的数据分布)
+[维护分区](#维护分区)
+
+## 关于扩展
+
+`gp_toolkit` 是在 Apache Cloudberry 中作为扩展实现的。因为此扩展在 `template1` 数据库中注册,所以你在创建的每个 Apache Cloudberry 数据库中都可以立即使用它。
+
+## 升级扩展
+
+安装或升级 Apache Cloudberry 时,`gp_toolkit` 扩展会自动安装。即使升级了 Apache Cloudberry,之前版本的扩展仍可在现有数据库中使用。要将扩展升级到最新版本,你需要在**每个**使用该扩展的数据库中执行以下命令:
+
+```sql
+ALTER EXTENSION gp_toolkit UPDATE TO '1.4';
+```
+
+## 检查需要例行维护的表
+
+以下视图可以帮助识别需要进行例行维护的表(如 `VACUUM` 和/或 `ANALYZE`)。
+
+- [`gp_bloat_diag`](#gp_bloat_diag)
+- [`gp_stats_missing`](#gp_stats_missing)
+
+`VACUUM` 或 `VACUUM FULL` 命令用于回收被删除或过期行占用的磁盘空间。由于 Apache Cloudberry 使用的是 MVCC 事务并发模型,被删除或更新的数据行虽然对新事务不可见,但仍然占用磁盘空间。过期的行会增加表在磁盘上的体积,进而降低表的扫描速度。
+
+`ANALYZE` 命令用于收集查询优化器所需的列级统计信息。Apache Cloudberry 使用基于成本的查询优化器,依赖于数据库统计信息。准确的统计信息有助于查询优化器更好地估计选择性和查询操作将检索的行数,从而选择最有效的查询计划。
+
+### gp_bloat_diag
+
+该视图显示了存在膨胀问题的常规堆存储表(即实际磁盘页数超过表统计信息中预期的页数)。这些膨胀的表需要执行 `VACUUM` 或 `VACUUM FULL` 操作,以回收被删除或过期行占用的磁盘空间。所有用户都可以访问该视图,但非超级用户只能查看他们有权限访问的表。
+
+:::tip 提示
+有关返回更多表优化信息的诊断功能,请参见[检查 AO 表](#检查-ao-表)视图。
+:::
+
+该视图的列说明如下:
+
+- `bdirelid`:表对象 ID。
+- `bdinspname`:Schema 名称。
+- `bdirelname`:表名称。
+- `bdirelpages`:磁盘上的实际页数。
+- `bdiexppages`:表数据预期的页数。
+- `bdidiag`:膨胀诊断信息。
+
+### gp_stats_missing
+
+该视图显示了没有统计信息的表,这些表可能需要执行 `ANALYZE` 操作。
+
+该视图的列说明如下:
+
+- `smischema`:Schema 名称。
+- `smitable`:表名称。
+- `smisize`:该表是否具有统计信息?如果表没有记录行计数和行大小统计信息,则此值为假,表明该表可能需要分析。如果表中没有任何行,这个值也会为假。例如,分区表的父表始终是空的,因此始终返回假值。
+- `smicols`:表中的列数。
+- `smirecs`:表中记录了统计信息的列数。
+
+## 检查锁
+
+当事务访问某个关系(如表)时,会获取一个锁。根据获取的锁类型,后续事务可能需要等待才能访问相同的关系。有关锁类型的更多信息,请参见[事务中的并发控制](../transactional-concurrency-control.md#事务中的并发控制)的多版本并发控制机制。Apache Cloudberry 的资源队列(用于资源管理)也使用锁来控制查询进入系统。
+
+`gp_locks_*` 系列视图可以帮助诊断由于锁而导致查询和会话等待访问对象的情况。
+
+- [`gp_locks_on_relation`](#gp_locks_on_relation)
+- [`gp_locks_on_resqueue`](#gp_locks_on_resqueue)
+
+### gp_locks_on_relation
+
+该视图显示当前在关系上持有的任何锁,以及与该锁相关的查询的会话信息。有关锁类型的更多信息,请参见[事务中的并发控制](../transactional-concurrency-control.md#事务中的并发控制)。所有用户都可以访问该视图,但非超级用户只能看到他们有权限访问的关系的锁。
+
+该视图的列说明如下:
+
+- `lorlocktype`:可锁对象的类型:`relation`、`extend`、`page`、`tuple`、`transactionid`、`object`、`userlock`、`resource queue` 或 `advisory`。
+- `lordatabase`:对象所在数据库的对象 ID,如果对象是共享对象,则为零。
+- `lorrelname`:关系名称。
+- `lorrelation`:关系对象 ID。
+- `lortransaction`:受锁影响的事务 ID。
+- `lorpid`:持有或等待此锁的服务器进程的进程 ID。如果锁被准备事务持有,则为 `NULL`。
+- `lormode`:当前进程持有或期望的锁模式名称。
+- `lorgranted`:显示锁是否已授予(`true`)或未授予(`false`)。
+- `lorcurrentquery`:当前会话中的查询。
+
+### gp_locks_on_resqueue
+
+:::note 注意
+`gp_locks_on_resqueue` 视图只有在基于资源队列的资源管理启用时才有效。
+:::
+
+该视图显示当前在资源队列上持有的锁及相关查询会话的信息。所有用户都可以访问该视图,但非超级用户只能看到与自己会话相关的锁。
+
+该视图的列描述如下:
+
+- `lorusename`:运行会话的用户名称。
+- `lorrsqname`:资源队列名称。
+- `lorlocktype`:锁对象的类型:`resource queue`。
+- `lorobjid`:锁定事务的 ID。
+- `lortransaction`:受锁影响的事务 ID。
+- `lorpid`:受锁影响事务的进程 ID。
+- `lormode`:该进程持有或期望的锁模式名称。
+- `lorgranted`:显示锁是否被授予(`true`)或未被授予(`false`)。
+- `lorwaiteventtype`:等待事件的类别(例如 I/O、锁定、网络等)。
+- `lorwaitevent`:具体等待事件的名称或描述(例如某个文件的 I/O 操作或锁的对象)。
+
+## 检查 AO 表
+
+`gp_toolkit` Schema 包含一组诊断函数,用于检查 AO 表(即 Append-Optimized 表)的状态。
+
+创建 AO 表(或列式 AO 表)时,会自动创建一张表来存储该表的元数据信息。元数据包括每个表 Segment 中的记录数量等信息。
+
+AO 表中可能包含不可见行——这些是已更新或删除的行,在表执行 `VACUUM` 压缩前,这些行仍保留在存储中。隐藏行通过辅助的可见性映射表(visimap)进行跟踪。
+
+以下函数可以让你访问 AO 表和列式表的元数据,并查看其中的不可见行。
+
+大多数函数的输入参数是 `regclass`,可以是表的 `name` 或表的 `oid`。
+
+### __gp_aovisimap_compaction_info(oid)
+
+该函数显示 AO 表的压缩信息,针对存储表数据的数据库 Segment 上的磁盘数据文件。你可以利用这些信息确定 `VACUUM` 操作将压缩哪些 AO 表的数据文件。
+
+:::tip 提示
+在 `VACUUM` 操作删除数据文件中的行之前,尽管这些行对新事务不可见,已删除或更新的行仍会占用磁盘空间。配置参数 `gp_appendonly_compaction` 控制 `VACUUM` 的功能。
+:::
+
+下表描述了 `__gp_aovisimap_compaction_info` 函数输出的列信息:
+
+- `content`:数据库 Segment ID。
+- `datafile`:Segment 上的数据文件 ID。
+- `compaction_possible`:此值为 `t` 或 `f`,值为 `t` 表示执行 `VACUUM` 时可以对数据文件进行压缩。服务器配置参数 `gp_appendonly_compaction_threshold` 会影响此值。
+- `hidden_tupcount`:数据文件中隐藏(已删除或更新)行的数量。
+- `total_tupcount`:数据文件中的行总数。
+- `percent_hidden`:数据文件中隐藏行占总行数的百分比。
+
+### __gp_aoseg(regclass)
+
+该函数返回 AO 表磁盘 Segment 文件的元数据。
+
+输入参数是 AO 表的名称或 OID。输出的列描述如下:
+
+- `segment_id`:数据分片在集群中的 Segment ID。
+- `segno`:文件 Segment 编号。
+- `eof`:该文件 Segment 的有效文件结束位置。
+- `tupcount`:Segment 中的元组总数,包括不可见的元组。
+- `varblockcount`:文件 Segment 中的可变块总数。
+- `eof_uncompressed`:如果文件 Segment 未压缩,则显示文件结束的位置。
+- `modcount`:数据修改操作的次数。
+- `formatversion`:AO 文件的存储格式版本,用于指示文件所使用的格式版本。
+- `state`:文件 Segment 的状态,指示该 Segment 是否处于活动状态或在压缩后等待删除。
+
+### __gp_aoseg_history(regclass)
+
+该函数返回 AO 表磁盘 Segment 文件的元数据历史信息,显示所有不同版本(堆元组)的 `aoseg` 元数据。虽然数据较复杂,但对于有系统深入理解的用户来说,可能在调试时有用。
+
+输入参数是 AO 表的名称或 OID。输出的列描述如下:
+
+- `segment_id`:数据分片在集群中的 Segment ID。
+- `segno`:文件 Segment 编号。
+- `tupcount`:Segment 中的元组总数,包括不可见的元组。
+- `eof`:该文件 Segment 的有效文件结束位置。
+- `eof_uncompressed`:如果文件 Segment 未压缩,则显示文件结束的位置。
+- `modcount`:数据修改操作的次数。
+- `formatversion`:AO 文件的存储格式版本,用于指示文件所使用的格式版本。
+- `state`:文件 Segment 的状态,指示该 Segment 是否处于活动状态或在压缩后等待删除。
+
+### __gp_aocsseg(regclass)
+
+该函数返回列存储的 AO 表的磁盘 Segment 文件中的元数据信息,不包括不可见行。每行描述表中某列的 Segment 信息。
+
+输入参数是列存储 AO 表的名称或 OID。输出的列描述如下:
+
+- `segment_id`:数据分片在集群中的 Segment ID。
+- `segno`:文件 Segment 编号。
+- `column_num`:列号。
+- `physical_segno`:Segment 文件中的 Segment 编号。
+- `tupcount`:Segment 中的元组总数,包括不可见的元组。
+- `eof`:该文件 Segment 的有效文件结束位置。
+- `eof_uncompressed`:如果文件 Segment 未压缩,则显示文件结束的位置。
+- `modcount`:数据修改操作的次数。
+- `formatversion`:AO 文件的存储格式版本,用于指示文件所使用的格式版本。
+- `state`:文件 Segment 的状态,指示该 Segment 是否处于活动状态或在压缩后等待删除。
+
+### __gp_aocsseg_history(regclass)
+
+此函数返回列式 AO 表的磁盘 Segment 文件中的元数据信息。每一行描述表中某列的一个 Segment。数据较为复杂,但对于深入了解系统的用户来说,这些信息可能对调试有所帮助。
+
+输入参数为列式 AO 表的名称或 oid。输出的列描述如下:
+
+- `segment_id`:数据分片在集群中的 Segment ID。
+- `segno`:文件 Segment 编号。
+- `column_num`:列号。
+- `physical_segno`:包含列数据的 Segment。
+- `tupcount`:Segment 中的元组总数。
+- `eof`:该文件 Segment 的有效文件结束位置。
+- `eof_uncompressed`:如果文件 Segment 未压缩,则显示文件结束的位置。
+- `modcount`:数据修改操作的次数。
+- `formatversion`:AO 文件的存储格式版本,用于指示文件所使用的格式版本。
+- `state`:文件 Segment 的状态,指示该 Segment 是否处于活动状态或在压缩后等待删除。
+
+### __gp_aovisimap(regclass)
+
+此函数根据可见性映射返回每个不可见元组的元组 ID、Segment 文件和行号。
+
+输入参数为 AO 表的名称或 oid。输出的列描述如下:
+
+- `tid`:元组 ID。
+- `segno`:Segment 文件的编号。
+- `row_num`:被删除或更新行的行号。
+
+### __gp_aovisimap_hidden_info(regclass)
+
+此函数返回 AO 表的 Segment 文件中隐藏和可见元组的数量。
+
+输入参数为 AO 表的名称或 oid。输出的列描述如下:
+
+- `segno`:Segment 文件的编号。
+- `hidden_tupcount`:Segment 文件中隐藏元组的数量。
+- `total_tupcount`:Segment 文件中的元组总数。
+
+### __gp_aovisimap_entry(regclass)
+
+此函数返回有关表的每个可见性图条目的信息。
+
+输入参数是 AO 表的名称或 OID。输出列的描述如下:
+
+- `segno`:可见性图条目的 Segment 号。
+- `first_row_num`:条目的首行编号。
+- `hidden_tupcount`:条目中隐藏元组的数量。
+- `bitmap`:可见性位图的文本表示。
+
+### __gp_aoblkdir(regclass)
+
+对于具有或曾经具有索引的 AO/AOCO 表,此函数返回在块目录关系中记录的每个块目录条目的行;它将块目录关系的 `minipage` 列扁平化,并为每个 `minipage` 条目返回一行。
+
+输入参数是 AO 表的名称或OID。
+
+你必须在实用模式下对每个 Segment 执行此函数,或使用 `gp_dist_random()`,如以下示例所示:
+
+```sql
+SELECT (gp_toolkit.__gp_aoblkdir('<table_name>')).*
+    FROM gp_dist_random('gp_id');
+```
+
+输出列的描述如下:
+
+- `tupleid`:包含此块目录条目的块目录行的元组 ID。
+- `segno`:物理 Segment 文件编号。
+- `columngroup_no`:此 `minipage` 条目所描述列的 `attnum`(对于面向行的表始终为 `0`)。
+- `entry_no`:此 `minipage` 内包含此块目录条目的条目序列号。
+- `first_row_no`:此块目录条目所覆盖行的首行编号。
+- `file_offset`:此块目录条目所覆盖行的起始文件偏移量。
+- `row_count`:此块目录条目所覆盖行的数量。
+
+### get_column_size(oid)
+
+对于给定的 AOCO 表,此函数返回表中所有列的列大小和压缩比。
+
+输入参数是列式 AO 表的对象标识符。输出列的描述如下:
+
+- `segment`:Segment ID。
+- `attnum`:列的属性编号。
+- `size`:列的大小(以字节为单位)。
+- `size_uncompressed`:如果列未压缩,则列的大小(以字节为单位)。
+- `compression_ratio`:压缩比。
+
+### gp_column_size
+
+该视图汇总了所有 Segment 中列式 AO 表的列大小和压缩比。视图的列说明如下:
+
+- `gp_segment_id`:Segment ID。
+- `relid`:表的 OID(对象标识符)。
+- `schema`:表所属的 schema 名称。
+- `relname`:表名。
+- `attnum`:列的属性编号。
+- `attname`:列名。
+- `size`:列的大小(以字节为单位)。
+- `size_uncompressed`:如果列未被压缩,则列的大小(以字节为单位)。
+- `compression_ratio`:压缩比。
+
+### gp_column_size_summary
+
+该视图展示了 `gp_column_size` 视图的汇总信息。它聚合了所有 Segment 中每个列式 AO 表的每列的大小和压缩比。视图的列说明如下:
+
+- `relid`:表的 OID(对象标识符)。
+- `schema`:表所属的 schema 名称。
+- `relname`:表名。
+- `attnum`:列的属性编号。
+- `attname`:列名。
+- `size`:列的大小(以字节为单位)。
+- `size_uncompressed`:如果列未压缩,则列的大小(以字节为单位)。
+- `compression_ratio`:压缩比。
+
+## 查看 Apache Cloudberry 服务器日志文件
+
+Apache Cloudberry 系统的每个组件(Coordinator、Standby Coordinator、主 Segment 和镜像 Segment)都会保留自己的服务器日志文件。`gp_log_*` 系列视图允许你对服务器日志文件发出 SQL 查询,以查找特定感兴趣的条目。使用这些视图需要超级用户权限。
+
+- [`gp_log_command_timings`](#gp_log_command_timings)
+- [`gp_log_database`](#gp_log_database)
+- [`gp_log_coordinator_concise`](#gp_log_coordinator_concise)
+- [`gp_log_system`](#gp_log_system)
+
+### gp_log_command_timings
+
+该视图使用外部表读取 Coordinator 上的日志文件,并报告数据库会话中 SQL 命令的运行时间。使用该视图需要超级用户权限。视图的列描述如下:
+
+- `logsession`:会话标识符(以 "con" 为前缀)。
+- `logcmdcount`:会话中的命令编号(以 "cmd" 为前缀)。
+- `logdatabase`:数据库名称。
+- `loguser`:数据库用户名称。
+- `logpid`:进程 ID(以 "p" 为前缀)。
+- `logtimemin`:此命令的第一个日志消息的时间。
+- `logtimemax`:此命令的最后一个日志消息的时间。
+- `logduration`:从开始到结束的语句持续时间。
+
+### gp_log_database
+
+该视图使用外部表读取整个 Apache Cloudberry 系统(Coordinator、Segment 和镜像)的服务器日志文件,并列出与当前数据库相关的日志条目。相关的日志条目可以通过会话 ID(`logsession`)和命令 ID(`logcmdcount`)识别。使用该视图需要超级用户权限。视图的列描述如下:
+
+- `logtime`:日志消息的时间戳。
+- `loguser`:数据库用户名称。
+- `logdatabase`:数据库名称。
+- `logpid`:关联的进程 ID(以 "p" 为前缀)。
+- `logthread`:关联的线程计数(以 "th" 为前缀)。
+- `loghost`:Segment 或 Coordinator 主机名。
+- `logport`:Segment 或 Coordinator 端口。
+- `logsessiontime`:会话连接打开的时间。
+- `logtransaction`:全局事务 ID。
+- `logsession`:会话标识符(以 "con" 为前缀)。
+- `logcmdcount`:会话中的命令编号(以 "cmd" 为前缀)。
+- `logsegment`:Segment 内容标识符(主 Segment 以 "seg" 为前缀,镜像以 "mir" 为前缀, Coordinator 的内容 ID 始终为 -1)。
+- `logslice`:切片 ID(正在运行的查询计划部分)。
+- `logdistxact`:分布式事务 ID。
+- `loglocalxact`:本地事务 ID。
+- `logsubxact`:子事务 ID。
+- `logseverity`:日志级别,包括 `LOG`、`ERROR`、`FATAL`、`PANIC`、`DEBUG1` 或 `DEBUG2`。
+- `logstate`:与日志消息关联的 SQL 状态代码。
+- `logmessage`:日志或错误消息文本。
+- `logdetail`:与错误消息关联的详细信息文本。
+- `loghint`:与错误消息关联的提示信息文本。
+- `logquery`:系统生成的查询文本。
+- `logquerypos`:系统生成的查询文本中的游标索引。
+- `logcontext`:生成此消息的上下文。
+- `logdebug`:用于调试的查询字符串,包含详细信息。
+- `logcursorpos`:查询字符串中的游标索引。
+- `logfunction`:生成此消息的函数。
+- `logfile`:生成此消息的日志文件。
+- `logline`:生成此消息的日志文件中的行。
+- `logstack`:与此消息相关的堆栈跟踪的完整文本。
+
+### gp_log_coordinator_concise
+
+该视图使用外部表从 Coordinator 日志文件中读取一部分日志字Segment。使用该视图需要超级用户权限。视图的列描述如下:
+
+- `logtime`:日志消息的时间戳。
+- `logdatabase`:数据库的名称。
+- `logsession`:会话标识符(以 "con" 为前缀)。
+- `logcmdcount`:会话中的命令编号(以 "cmd" 为前缀)。
+- `logseverity`:日志的严重性级别。
+- `logmessage`:日志或错误消息文本。
+
+### gp_log_system
+
+该视图使用外部表读取整个 Apache Cloudberry 系统(Coordinator 、Segment 和镜像)的服务器日志文件,并列出所有日志条目。相关日志条目可以通过会话 ID(`logsession`)和命令 ID(`logcmdcount`)进行识别。使用该视图需要超级用户权限。视图的列描述如下:
+
+- `logtime`:日志消息的时间戳。
+- `loguser`:数据库用户的名称。
+- `logdatabase`:数据库的名称。
+- `logpid`:相关的进程 ID(以 "p" 为前缀)。
+- `logthread`:相关的线程计数(以 "th" 为前缀)。
+- `loghost`:Segment 或 Coordinator 的主机名称。
+- `logport`:Segment 或 Coordinator 的端口。
+- `logsessiontime`:会话连接打开的时间。
+- `logtransaction`:全局事务 ID。
+- `logsession`:会话标识符(以 "con" 为前缀)。
+- `logcmdcount`:会话中的命令编号(以 "cmd" 为前缀)。
+- `logsegment`:Segment 内容标识符(对于主 Segment 以 "seg" 为前缀,镜像 Segment 以 "mir" 为前缀。Coordinator 的内容 ID 始终为 -1)。
+- `logslice`:切片 ID(运行中的查询计划的一部分)。
+- `logdistxact`:分布式事务 ID。
+- `loglocalxact`:本地事务 ID。
+- `logsubxact`:子事务 ID。
+- `logseverity`:LOG、ERROR、FATAL、PANIC、DEBUG1 或 DEBUG2。
+- `logstate`:与日志消息关联的 SQL 状态码。
+- `logmessage`:日志或错误消息文本。
+- `logdetail`:与错误消息相关的详细消息文本。
+- `loghint`:与错误消息相关的提示消息文本。
+- `logquery`:内部生成的查询文本。
+- `logquerypos`:内部生成的查询文本中的游标索引。
+- `logcontext`:生成此消息的上下文。
+- `logdebug`:包含完整调试信息的查询字符串。
+- `logcursorpos`:查询字符串中的游标索引。
+- `logfunction`:生成此消息的函数。
+- `logfile`:生成此消息的日志文件。
+- `logline`:生成此消息的日志文件中的行。
+- `logstack`:与此消息关联的堆栈跟踪的完整文本。
+
+## 检查服务器配置文件
+
+每个 Apache Cloudberry 系统的组件(Coordinator、Standby Coordinator、主 Segment 和镜像 Segment)都有自己的服务器配置文件(`postgresql.conf`)。可以使用以下 `gp_toolkit` 对象检查系统中所有主 `postgresql.conf` 文件的参数设置:
+
+- [`gp_param_setting('parameter_name')`](#gp_param_settingparameter_name)
+- [`gp_param_settings_seg_value_diffs`](#gp_param_settings_seg_value_diffs)
+
+### gp_param_setting('parameter_name')
+
+该函数接收一个服务器配置参数的名称,并返回 Coordinator 和每个活动 Segment 的 `postgresql.conf` 值。此函数对所有用户可用。视图的列描述如下:
+
+- `paramsegment`:Segment 内容 ID(仅显示活动 Segment )。Coordinator 内容 ID 始终为 `-1`。
+- `paramname`:参数名称。
+- `paramvalue`:参数值。
+
+示例:
+
+```sql
+SELECT * FROM gp_toolkit.gp_param_setting('max_connections');
+```
+
+### gp_param_settings_seg_value_diffs
+
+被分类为 *local* 参数的服务器配置参数(即每个 Segment 从其自己的 `postgresql.conf` 文件中获取参数值)应该在所有 Segment 上设置为相同的值。该视图显示了不一致的本地参数设置。预期有不同值的参数(例如 `port`)不包括在内。该视图对所有用户可用。
+
+视图的列描述如下:
+
+- `psdname`:参数名称。
+- `psdvalue`:参数值。
+- `psdcount`:拥有该值的 Segment 的数量。
+
+## 检查下线的 Segment
+
+可以使用 [`gp_pgdatabase_invalid`](#gp_pgdatabase_invalid) 视图检查处于下线状态的 Segment。
+
+### gp_pgdatabase_invalid
+
+该视图显示系统目录中标记为下线 Segment 的信息。该视图对所有用户可用。视图的列描述如下:
+
+- `pgdbidbid`:Segment 的 dbid。每个 Segment 都有一个唯一的 dbid。
+- `pgdbiisprimary`:该 Segment 当前是否作为主 Segment (活动 Segment)?(`t` 或 `f`)。
+- `pgdbicontent`:此 Segment 的内容 ID。主 Segment 和镜像 Segment 将具有相同的内容 ID。
+- `pgdbivalid`:此 Segment 是否在线并有效?(`t` 或 `f`)。
+- `pgdbidefinedprimary`:此 Segment 在系统初始化时是否被分配为主 Segment 角色?(`t` 或 `f`)。
+
+## 检查资源组活动和状态
+
+:::note 注意
+本节描述的资源组活动和状态视图仅在基于资源组的资源管理处于激活状态时有效。
+:::
+
+资源组用于管理事务,以避免耗尽系统的 CPU 和内存资源。每个数据库用户都被分配到一个资源组。Apache Cloudberry 在执行用户提交的事务之前,会根据用户资源组的配置限制来评估该事务。
+
+你可以使用 `gp_resgroup_config` 视图查看每个资源组的配置情况。你可以使用 `gp_resgroup_status*` 视图来显示每个资源组的当前事务状态和资源使用情况。
+
+- [`gp_resgroup_config`](#gp_resgroup_config)
+- [`gp_resgroup_role`](#gp_resgroup_role)
+- [`gp_resgroup_status`](#gp_resgroup_status)
+- [`gp_resgroup_status_per_host`](#gp_resgroup_status_per_host)
+- [`gp_resgroup_status_per_segment`](#gp_resgroup_status_per_segment)
+
+### gp_resgroup_config
+
+`gp_resgroup_config` 视图允许管理员查看资源组的当前 CPU、内存和并发限制。
+
+该视图对所有用户可用。视图的列描述如下:
+
+- `groupid`:资源组的 ID。
+- `groupname`:资源组的名称。
+- `concurrency`:资源组指定的并发 (`CONCURRENCY`) 值。
+- `cpu_max_percent`:资源组指定的 CPU 限制 (`CPU_MAX_PERCENT`) 值,或为 `-1`。
+- `cpu_weight`:资源组的调度优先级 (`CPU_WEIGHT`)。
+- `cpuset`:为资源组保留的 CPU 核心 (CPUSET),或为 -1。
+- `memory_quota`:资源组指定的内存配额值。
+- `min_cost`:要包含在资源组中的查询计划的最小成本 (`MIN_COST`)。
+- `io_limit`:为分配给特定表空间 (以表空间 oid 显示) 和资源组的查询设置的最大顺序读写磁盘 I/O 吞吐量,以及每秒的最大读写 I/O 操作 (`IO_LIMIT`)。
+
+### gp_resgroup_role
+
+`gp_resgroup_role` 视图允许管理员查看分配给每个角色的资源组。
+
+该视图对所有用户可用。视图的列描述如下:
+
+- `rrrolname`:角色的名称。
+- `rrrsgname`:资源组的名称。
+
+### gp_resgroup_status
+
+`gp_resgroup_status` 视图允许管理员查看资源组的状态和活动。它显示每个资源组有多少查询在等待执行,以及当前系统中有多少查询正在运行。该视图还展示了资源组的当前内存和 CPU 使用情况。
+
+:::note 注意
+资源组使用主机系统上配置的 Linux 控制组(cgroups)。这些 cgroups 用于管理主机系统资源。当资源组使用的是嵌套 cgroups 中的一部分时,资源组的限制是相对于父 cgroup 的分配。有关嵌套 cgroups 和 Apache Cloudberry 资源组限制的信息,请参阅《使用资源组》文档。
+:::
+
+该视图对所有用户开放。视图的各列描述如下:
+
+- `groupid`:资源组的 ID。
+- `groupname`:资源组的名称。
+- `num_running`:当前在资源组中运行的事务数量。
+- `num_queueing`:当前在资源组中排队的事务数量。
+- `num_queued`:自 Apache Cloudberry 集群上次启动以来,资源组中排队的事务总数(不包括 `num_queueing`)。
+- `num_executed`:自 Apache Cloudberry 集群上次启动以来,在资源组中执行的事务总数(不包括 `num_running`)。
+- `total_queue_duration`:自 Apache Cloudberry 集群上次启动以来,任何事务排队的总时长。
+
+`gp_resgroup_status` 视图的示例输出:
+
+```sql
+select * from gp_toolkit.gp_resgroup_status;
+
+groupid | groupname | num_running | num_queueing | num_queued | num_executed | total_queue_duration 
+---------+-----------+-------------+--------------+------------+--------------+----------------------
+(0 rows)
+```
+
+### gp_resgroup_status_per_host
+
+`gp_resgroup_status_per_host` 视图显示每个资源组在每个主机上的实时 CPU 和内存使用情况(MB)。该视图还展示了每个资源组在主机上的可用和分配的固定内存和共享内存。
+
+视图的各列描述如下:
+
+- `groupid`:资源组的 ID。
+- `groupname`:资源组的名称。
+- `hostname`:分 Segment 主机的主机名。
+- `cpu_usage`:资源组在主机上的实时 CPU 核心使用情况。该值为资源组在主机上使用的 CPU 核心百分比(以浮点值表示)的总和。
+- `memory_usage`:每个数据库 Segment 主机上资源组的实时内存使用情况,以 MB 为单位。
+
+`gp_resgroup_status_per_host` 视图的示例输出:
+
+```sql
+select * from gp_toolkit.gp_resgroup_status_per_host;
+groupid | groupname | hostname | cpu_usage | memory_usage 
+---------+-----------+----------+-----------+--------------
+(0 rows)
+```
+
+### gp_resgroup_status_per_segment
+
+`gp_toolkit.gp_resgroup_status_per_segment` 视图用于展示按 Segment 分组的资源组内存使用情况,统计数据由 vmem tracker 提供,单位为 MB。该视图适用于数据库管理员监控各 Segment 上资源组的内存占用情况。
+
+:::note 注意
+此视图仅在启用了资源组(Resource Group)资源管理功能的情况下可用。
+:::
+
+视图各列含义如下:
+
+- `groupid`(类型:`oid`):资源组的唯一标识,对应 `pg_resgroup.oid`。
+- `groupname`(类型:`name`):资源组名称,对应 `pg_resgroup.rsgname`。
+- `segment_id`(类型:`smallint`):对应 Segment 实例的 content ID,来源于 `gp_segment_configuration.content`。
+- `vmem_usage`(类型:`smallint`):该资源组在对应 Segment 上的实时内存使用量(单位:MB)。
+
+## 检查资源队列活动和状态
+
+Note
+
+本节描述的资源队列活动和状态视图仅在基于资源队列的资源管理处于活动状态时有效。
+
+资源队列的目的是限制系统在任何时刻可以执行的活动查询数量,以避免耗尽系统资源,如内存、CPU 和磁盘 I/O。所有数据库用户都被分配到一个资源队列,用户提交的每条语句在运行之前,都会先评估是否符合资源队列的限制。`gp_resq_*` 系列视图可用于检查通过各自的资源队列当前提交到系统的语句状态。需要注意的是,超级用户发出的语句不受资源排队的限制。
+
+- [`gp_resq_activity`](#gp_resq_activity)
+- [`gp_resq_activity_by_queue`](#gp_resq_activity_by_queue)
+- [`gp_resq_priority_statement`](#gp_resq_priority_statement)
+- [`gp_resq_role`](#gp_resq_role)
+- [`gp_resqueue_status`](#gp_resqueue_status)
+
+### gp_resq_activity
+
+对于具有活动工作负载的资源队列,该视图显示每个通过资源队列提交的活动语句的一行。该视图对所有用户可见。
+
+视图中的列描述如下:
+
+- `resqprocpid`:分配给此语句的进程ID(在 Coordinator 上)。
+- `resqrole`:用户名。
+- `resqoid`:资源队列对象ID。
+- `resqname`:资源队列名称。
+- `resqstart`:语句提交给系统的时间。
+- `resqstatus`:语句的状态:运行中、等待中或已取消。
+
+### gp_resq_activity_by_queue
+
+对于具有活动工作负载的资源队列,该视图显示队列活动的汇总。该视图对所有用户可见。
+
+视图中的列描述如下:
+
+- `resqoid`:资源队列对象ID。
+- `resqname`:资源队列名称。
+- `resqlast`:提交到队列的最后一条语句的时间。
+- `resqstatus`:最后一条语句的状态:运行中、等待中或已取消。
+- `resqtotal`:此队列中的语句总数。
+
+### gp_resq_priority_statement
+
+该视图显示了当前在 Apache Cloudberry 系统中运行的所有语句的资源队列优先级、会话 ID 以及其他相关信息。所有用户均可访问该视图。
+
+视图中的列描述如下:
+
+- `rqpdatname`:当前会话连接的数据库名称。
+- `rqpusename`:发出该语句的用户。
+- `rqpsession`:会话 ID。
+- `rqpcommand`:该会话中的语句编号(命令 ID 和会话 ID 唯一标识一条语句)。
+- `rqppriority`:此语句的资源队列优先级(`MAX`、`HIGH`、`MEDIUM`、`LOW`)。
+- `rqpweight`:与该语句优先级相关的整数值。
+- `rqpquery`:该语句的查询文本。
+
+### gp_resq_role
+
+该视图显示与某个角色相关联的资源队列。所有用户均可访问该视图。
+
+视图中的列描述如下:
+
+- `rrrolname`:角色(用户)名称。
+- `rrrsqname`:分配给该角色的资源队列名称。如果角色没有明确分配给资源队列,则它将处于默认资源队列 (*pg_default*) 中。
+
+### gp_resqueue_status
+
+该视图允许管理员查看资源队列的状态和活动情况。它显示有多少查询正在等待执行,以及来自特定资源队列的当前活动查询数量。
+
+视图中的列描述如下:
+
+- `queueid`:资源队列的 ID。
+- `rsqname`:资源队列的名称。
+- `rsqcountlimit`:资源队列的活动查询阈值。值为 `-1` 表示没有限制。
+- `rsqcountvalue`:当前在资源队列中使用的活动查询槽数量。
+- `rsqcostlimit`:资源队列的查询成本阈值。值为 `-1` 表示没有限制。
+- `rsqcostvalue`:当前在资源队列中的所有语句的总成本。
+- `rsqmemorylimit`:资源队列的内存限制。
+- `rsqmemoryvalue`:当前在资源队列中的所有语句所使用的总内存。
+- `rsqwaiters`:当前在资源队列中等待的语句数量。
+- `rsqholders`:当前从该资源队列在系统中运行的语句数量。
+
+## 查询磁盘溢出空间使用情况
+
+*gp_workfile* 视图显示了当前使用磁盘溢出空间的所有查询的信息。当 Apache Cloudberry 由于内存不足无法在内存中运行查询时,会在磁盘上创建工作文件。这些信息可用于故障排除和查询优化。此外,这些视图中的信息还可以用于指定 Apache Cloudberry 配置参数 `gp_workfile_limit_per_query` 和 `gp_workfile_limit_per_segment` 的值。
+
+- [`gp_workfile_entries`](#gp_workfile_entries)
+- [`gp_workfile_usage_per_query`](#gp_workfile_usage_per_query)
+- [`gp_workfile_usage_per_segment`](#gp_workfile_usage_per_segment)
+
+### gp_workfile_entries
+
+该视图为当前每个在 Segment 上使用工作文件的操作符提供一行信息。该视图对所有用户可用,但非超级用户只能查看他们有权限访问的数据库的信息。
+
+视图中的列描述如下:
+
+| 列            | 类型    | 描述                                     |
+|---------------|---------|------------------------------------------|
+| `datname`     | name    | 数据库名称。                             |
+| `pid`         | integer | 服务器进程的进程 ID。                    |
+| `sess_id`     | integer | 会话 ID。                                |
+| `command_cnt` | integer | 查询的命令 ID。                          |
+| `usename`     | name    | 角色名称。                               |
+| `query`       | text    | 当前正在运行的查询。                     |
+| `segid`       | integer | Segment ID。                             |
+| `slice`       | integer | 查询计划片段,即当前执行的查询计划部分。 |
+| `optype`      | text    | 创建工作文件的查询操作符类型。           |
+| `size`        | bigint  | 工作文件的大小(以字节为单位)。         |
+| `numfiles`    | integer | 创建的文件数量。                         |
+| `prefix`      | text    | 命名相关工作文件集时使用的前缀。         |
+
+### gp_workfile_usage_per_query
+
+该视图为每个当前使用磁盘空间进行工作文件的查询提供一行信息。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的数据库信息。
+
+视图的列描述如下:
+
+| 列            | 类型    | 描述                             |
+|---------------|---------|----------------------------------|
+| `datname`     | name    | 数据库名称。                     |
+| `pid`         | integer | 服务器进程的进程 ID。            |
+| `sess_id`     | integer | 会话 ID。                        |
+| `command_cnt` | integer | 查询的命令 ID。                  |
+| `usename`     | name    | 角色名称。                       |
+| `query`       | text    | 当前进程正在运行的查询。         |
+| `segid`       | integer | Segment ID。                     |
+| `size`        | numeric | 工作文件的大小(以字节为单位)。 |
+| `numfiles`    | bigint  | 创建的文件数量。                 |
+
+### gp_workfile_usage_per_segment
+
+该视图为每个 Segment 包含一行数据。每行显示当前时间 Segment 上工作文件使用的总磁盘空间。该视图对所有用户可用,但非超级用户只能查看其有权限访问的数据库的信息。
+
+视图的列描述如下:
+
+| 列         | 类型     | 描述                        |
+|------------|----------|-----------------------------|
+| `segid`    | smallint | Segment ID。                |
+| `size`     | numeric  | Segment上工作文件的总大小。 |
+| `numfiles` | bigint   | 创建的文件数量。            |
+
+## 查看用户和角色
+
+将用户(角色)进行分组,以便更方便地管理对象权限是很常见的做法。通过这种方式,可以对整个组授予或撤销权限。在 Apache Cloudberry 中,这通过创建一个代表该组的角色来实现,然后将用户角色加入该组角色的成员。
+
+可以使用 [`gp_roles_assigned`](#gp_roles_assigned) 视图查看系统中的所有角色及其分配的成员(如果该角色也是一个组角色)。
+
+### gp_roles_assigned
+
+该视图显示系统中的所有角色及其分配的成员(如果该角色也是一个组角色)。所有用户均可访问该视图。
+
+视图的列说明如下:
+
+- `raroleid`:角色对象 ID。如果该角色有成员(用户),则视为\*组\*角色。
+- `rarolename`:角色(用户或组)名称。
+- `ramemberid`:作为该角色成员的角色对象 ID。
+- `ramembername`:作为该角色成员的角色名称。
+
+## 检查数据库对象大小和磁盘空间
+
+`gp_size_*` 系列视图可用于确定分布式 Apache Cloudberry 数据库、Schema、表或索引的磁盘空间使用情况。以下视图计算所有主 Segment (不包括镜像)的对象总大小。
+
+- [`gp_size_of_all_table_indexes`](#gp_size_of_all_table_indexes)
+- [`gp_size_of_database`](#gp_size_of_database)
+- [`gp_size_of_index`](#gp_size_of_index)
+- [`gp_size_of_schema_disk`](#gp_size_of_schema_disk)
+- [`gp_size_of_table_and_indexes_disk`](#gp_size_of_table_and_indexes_disk)
+- [`gp_size_of_table_and_indexes_licensing`](#gp_size_of_table_and_indexes_licensing)
+- [`gp_size_of_table_disk`](#gp_size_of_table_disk)
+- [`gp_size_of_table_uncompressed`](#gp_size_of_table_uncompressed)
+- [`gp_disk_free`](#gp_disk_free)
+
+表和索引大小视图按对象 ID 列出关系(而不是按名称)。要按名称检查表或索引的大小,必须在 `pg_class` 表中查找关系名称(`relname`)。例如:
+
+```sql
+SELECT relname as name, sotdsize as size, sotdtoastsize as 
+toast, sotdadditionalsize as other 
+FROM gp_size_of_table_disk as sotd, pg_class 
+WHERE sotd.sotdoid=pg_class.oid ORDER BY relname;
+```
+
+### gp_size_of_all_table_indexes
+
+该视图显示某个表所有索引的总大小。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的关系。
+
+视图的列说明如下:
+
+- `soatioid`:表的对象 ID。
+- `soatisize`:所有表索引的总大小(以字节为单位)。
+- `soatischemaname`:Schema 名称。
+- `soatitablename`:表名称。
+
+### gp_size_of_database
+
+该视图显示了数据库的总大小。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的数据库。
+
+视图中的列描述如下:
+
+- `sodddatname`:数据库名称。
+- `sodddatsize`:数据库大小(以字节为单位)。
+
+### gp_size_of_index
+
+该视图显示了索引的总大小。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的关系。
+
+视图中的列描述如下:
+
+- `soioid`:索引的对象 ID。
+- `soitableoid`:该索引所属表的对象 ID。
+- `soisize`:索引大小(以字节为单位)。
+- `soiindexschemaname`:索引 Schema 名称。
+- `soiindexname`:索引名称。
+- `soitableschemaname`:表 Schema 名称。
+- `soitablename`:表的名称。
+
+### gp_size_of_schema_disk
+
+该视图显示当前数据库中公共 Schema 和用户创建 Schema 的大小。所有用户均可访问该视图,但非超级用户只能查看他们有权限访问的 Schema。
+
+视图中的列描述如下:
+
+- `sosdnsp`:Schema 名称。
+- `sosdschematablesize`:Schema 中表的总大小(以字节为单位)。
+- `sosdschemaidxsize`:Schema 中索引的总大小(以字节为单位)。
+
+### gp_size_of_table_and_indexes_disk
+
+该视图显示表及其索引在磁盘上的大小。所有用户都可以访问该视图,但非超级用户只能查看他们有权限访问的关系。
+
+该视图的列描述如下:
+
+- `sotaidoid`:父表的对象 ID。
+- `sotaidtablesize`:表的磁盘大小。
+- `sotaididxsize`:表上所有索引的总大小。
+- `sotaidschemaname`:Schema 名称。
+- `sotaidtablename`:表名称。
+
+### gp_size_of_table_and_indexes_licensing
+
+该视图显示用于许可目的的表及其索引的总大小。使用该视图需要超级用户权限。
+
+该视图的列描述如下:
+
+- `sotailoid`:表的对象 ID。
+- `sotailtablesizedisk`:表的总磁盘大小。
+- `sotailtablesizeuncompressed`:如果表是压缩的追加优化表,显示未压缩的表大小(以字节为单位)。
+- `sotailindexessize`:表中所有索引的总大小。
+- `sotailschemaname`:Schema 名称。
+- `sotailtablename`:表名称。
+
+### gp_size_of_table_disk
+
+该视图显示表在磁盘上的大小。所有用户都可以访问该视图,但非超级用户只能查看他们有权限访问的表。该视图的列描述如下:
+
+- `sotdoid`:表的对象 ID。
+- `sotdsize`:表的大小(以字节为单位)。该大小仅为主表的大小,不包括超大(TOAST)属性等辅助对象或 AO 表的额外存储对象。
+- `sotdtoastsize`:如果存在,则为 TOAST 表(超大属性存储)的大小。
+- `sotdadditionalsize`:反映追加优化(AO)表的 Segment 和块目录表大小。
+- `sotdschemaname`:Schema 名称。
+- `sotdtablename`:表名称。
+
+### gp_size_of_table_uncompressed
+
+该视图显示追加优化(AO)表的未压缩表大小。否则,将显示表在磁盘上的大小。使用该视图需要超级用户权限。该视图的列描述如下:
+
+- `sotuoid`:表的对象 ID。
+- `sotusize`:如果是压缩的 AO 表,则为未压缩的表大小(以字节为单位)。否则,显示表在磁盘上的大小。
+- `sotuschemaname`:Schema 名称。
+- `sotutablename`:表名称。
+
+### gp_disk_free
+
+这个外部表在活动 Segment 主机上运行 `df`(磁盘空闲)命令,并返回结果。未激活的镜像不包括在计算中。使用此外部表需要超级用户权限。视图的列描述如下:
+
+- `dfsegment`:Segment 的内容 ID(仅显示活动 Segment)。
+- `dfhostname`:Segment 主机的主机名。
+- `dfdevice`:设备名称。
+- `dfspace`:Segment 文件系统中的空闲磁盘空间,以千字节为单位。
+
+## 检查缺失和孤立数据文件
+
+Apache Cloudberry 将在目录中存在但在磁盘上缺失的关系数据文件视为缺失。相反,当 Apache Cloudberry 遇到未在任何关系中引用的意外数据文件时,它会将该文件视为孤立。
+
+Apache Cloudberry 提供以下视图,以帮助识别当前数据库中是否存在缺失或孤立的文件:
+
+- [`gp_move_orphaned_files()`](#gp_move_orphaned_files)
+- [`gp_check_orphaned_files`](#gp_check_orphaned_files)
+- [`gp_check_missing_files`](#gp_check_missing_files)
+
+在扩展集群或进行离线维护之前,最好检查这些情况。
+
+默认情况下,本节中识别的视图对 `PUBLIC` 可用。
+
+### gp_check_orphaned_files
+
+`gp_check_orphaned_files` 视图扫描默认和用户定义的表空间以查找孤立的数据文件。Apache Cloudberry 在此检查中考虑正常数据文件、名称中带下划线(`_`)的文件,以及扩展编号文件(名称中包含 `.<N>` 的文件)。`gp_check_orphaned_files` 从 Apache Cloudberry Coordinator和所有 Segment 收集结果。
+
+视图的列描述如下:
+
+- `gp_segment_id`:数据库 Segment 标识符。
+- `tablespace`:孤立文件所在的表空间标识符。
+- `filename`:孤立数据文件的文件名。
+- `filepath`:孤立数据文件的文件系统路径,相对于 Coordinator 或 Segment 的数据目录。
+
+:::caution 注意
+将该视图作为识别孤立数据文件的众多数据点之一,请勿仅根据查询该视图的结果删除文件。
+:::
+
+### gp_check_missing_files
+
+`gp_check_missing_files` 视图扫描堆和追加优化的列式表,以查找缺失的数据文件。Apache Cloudberry 在此检查中仅考虑正常的数据文件(文件名中不包含 `.` 或 `_` 的文件)。`gp_check_missing_files` 收集来自 Apache Cloudberry Coordinator 和所有 Segment 的结果。
+
+该视图的列描述如下:
+
+- `gp_segment_id`:数据库 Segment 标识符。
+- `tablespace`:表所在表空间的标识符。
+- `relname`:缺失数据文件的表名。
+- `filename`:缺失数据文件的文件名。
+
+### gp_check_missing_files_ext
+
+`gp_check_missing_files_ext` 视图仅扫描追加优化的列式表,以查找缺失的扩展数据文件。Apache Cloudberry 在此检查中同时考虑正常数据文件和带有编号的扩展文件(文件名中包含 `.<N>` 的文件)。包含 `_` 的文件不在考虑范围内。`gp_check_missing_files_ext` 仅收集来自 Apache Cloudberry 数据库 Segment 的结果。
+
+该视图的列描述如下:
+
+- `gp_segment_id`:数据库 Segment 标识符。
+- `tablespace`:表所在表空间的标识符。
+- `relname`:缺失扩展数据文件的表名。
+- `filename`:缺失扩展数据文件的文件名。
+
+## 移动孤立数据文件
+
+`gp_move_orphaned_files()` 用户定义函数(UDF)将通过 [`gp_check_orphaned_files`](#gp_check_orphaned_files) 视图找到的孤立文件移动到你指定的文件系统位置。
+
+该函数的签名为: `gp_move_orphaned_files( <target_directory> TEXT )`。
+
+`<target_directory>` 必须在所有 Segment 主机上存在,且指定的目录必须可由 `gpadmin` 用户访问。如果你为 `<target_directory>` 指定相对路径,则该路径相对于 Coordinator 或 Segment 的数据目录。
+
+Apache Cloudberry 会将每个移动的数据文件重命名为一个反映文件在数据目录中原始位置的名称。文件名的格式取决于孤立文件所在的表空间:
+
+| 表空间         | 重命名的文件格式                                                                  |
+|----------------|-----------------------------------------------------------------------------------|
+| `default`      | `seg<num>_base_<database-oid>_<relfilenode>`                                      |
+| `global`       | `seg<num>_global_<relfilenode>`                                                   |
+| `user-defined` | `seg<num>_pg_tblspc_<tablespace-oid>_<gpdb-version>_<database-oid>_<relfilenode>` |
+
+例如,如果在默认表空间中名为 `12345` 的文件在主 Segment 2 中孤立,
+
+```sql
+SELECT * FROM gp_move_orphaned_files('/home/gpadmin/orphaned');
+```
+
+该命令将移动并重命名文件,如下所示:
+
+- 原始位置: `<data_directory>/base/13700/12345`
+- 新位置和文件名: `/home/gpadmin/orphaned/seg2_base_13700_12345`
+
+`gp_move_orphaned_files()` 会返回每个移动文件的原始和新文件系统位置,并指示移动操作的成功或失败。例如:
+
+```sql
+SELECT * FROM gp_toolkit.gp_move_orphaned_files('/home/gpadmin/orphaned');
+ gp_segment_id | move_success |           oldpath          |         newpath
+---------------+--------------+----------------------------+-----------------------------------
+            -1 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg-1_base_13715_99999
+             1 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg1_base_13715_99999
+             2 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg2_base_13715_99999
+(3 rows)
+```
+
+移动文件后,你可以选择删除它们或进行备份。
+
+## 检查不均匀的数据分布
+
+在 Apache Cloudberry 中,所有表都是分布式的,这意味着它们的数据被划分到系统中的所有 Segment 上。如果数据分布不均匀,查询处理性能可能会下降。以下视图可以帮助诊断表是否存在不均匀的数据分布:
+
+- [`gp_toolkit.gp_skew_coefficients`](#gp_skew_coefficients)
+- [`gp_toolkit.gp_skew_idle_fractions`](#gp_skew_idle_fractions)
+
+### gp_skew_coefficients
+
+该视图通过计算存储在每个 Segment 上的数据的变异系数 (CV) 来显示数据分布的偏斜情况。该视图对所有用户开放,但非超级用户只能查看他们有权限访问的表。
+
+视图中的列描述如下:
+
+- `skcoid`:表的对象 ID。
+- `skcnamespace`:定义表的命名空间。
+- `skcrelname`:表的名称。
+- `skccoeff`:变异系数 (CV) 的计算方法是标准偏差除以平均值。它考虑了数据系列的平均值及其变动性。值越低越好,值越高则表示数据偏斜程度越大。
+
+### gp_skew_idle_fractions
+
+该视图通过计算在表扫描过程中系统处于空闲状态的百分比来显示数据分布的偏斜情况,这也是处理数据偏斜的一个指标。该视图对所有用户开放,但非超级用户只能查看他们有权限访问的表。
+
+视图中的列描述如下:
+
+- `sifoid`:表的对象 ID。
+- `sifnamespace`:定义表的命名空间。
+- `sifrelname`:表的名称。
+- `siffraction`:在表扫描过程中系统处于空闲状态的百分比,这是不均匀数据分布或查询处理偏斜的一个指标。例如,`0.1` 表示 10% 的偏斜,`0.5` 表示 50% 的偏斜,依此类推。偏斜超过 10% 的表应评估其分布策略。
+
+## 维护分区
+
+如果你的数据库使用了分区,则需要定期执行某些任务以帮助维护这些分区。Apache Cloudberry 提供了一个视图和多个用户定义的函数来协助完成这些任务。
+
+### gp_partitions
+
+`gp_partitions` 视图显示数据库中的所有叶子分区。
+
+该视图与旧版的 `pg_partitions` 视图保持向后兼容(该视图在 Apache Cloudberry 的早期主要版本中可用)。视图的各列描述如下:
+
+| 列                         | 类型     | 描述                                               |
+|----------------------------|----------|----------------------------------------------------|
+| `schemaname`               | name     | 分区表所在 Schema 的名称。                         |
+| `tablename`                | name     | 顶层父表的名称。                                   |
+| `partitionschemaname`      | name     | 分区表的 Schema。                                  |
+| `partitiontablename`       | name     | 分区表的关系名称(如果直接访问分区时使用的表名)。 |
+| `parentpartitiontablename` | regclass | 该分区上一级父表的关系名称。                       |
+| `partitiontype`            | text     | 分区类型(范围或列表)。                           |
+| `partitionlevel`           | integer  | 此分区在层级中的级别。                             |
+| `partitionrank`            | integer  | 对于范围分区,与同级其他分区相比的排名。           |
+| `partitionlistvalues`      | text     | 对于列表分区,与该分区相关的列表值。               |
+| `partitionrangestart`      | text     | 对于范围分区,此分区的起始值。                     |
+| `partitionrangeend`        | text     | 对于范围分区,此分区的结束值。                     |
+| `partitionisdefault`       | boolean  | 如果这是默认分区,则为 T,否则为 F。               |
+| `partitionboundary`        | text     | 此分区的完整分区规范。                             |
+| `parenttablespace`         | name     | 该分区上一级父表的表空间。                         |
+| `partitiontablespace`      | name     | 此分区的表空间。                                   |
+
+### 用户定义的分区维护函数
+
+下表总结了 Apache Cloudberry 可帮助你维护分区的函数:
+
+| 函数                                      | 返回类型 | 描述                                                                      |
+|-------------------------------------------|----------|---------------------------------------------------------------------------|
+| `pg_partition_rank(rp regclass)`          | integer  | 对于范围分区,返回与同级其他分区的排名。对于其他类型的分区,返回 `NULL`。 |
+| `pg_partition_range_from(rp regclass)`    | text     | 返回范围分区的下界。                                                      |
+| `pg_partition_range_to(rp regclass)`      | text     | 返回范围分区的上界。                                                      |
+| `pg_partition_isdefault(rp regclass)`     | boolean  | 判断给定分区是否为默认分区。                                              |
+| `pg_partition_lowest_child(rp regclass)`  | regclass | 找到给定分区的最低排名子分区。                                            |
+| `pg_partition_highest_child(rp regclass)` | regclass | 找到给定分区的最高排名子分区。                                            |
diff --git a/sidebars.ts b/sidebars.ts
index 2d433fcef..d8539f543 100644
--- a/sidebars.ts
+++ b/sidebars.ts
@@ -473,7 +473,8 @@ const sidebars: SidebarsConfig = {
               'sys-catalogs/sys-tables/pg-type-encoding',
               'sys-catalogs/sys-tables/pg-user-mapping',
             ]
-          }
+          },
+          'sys-catalogs/gp_toolkit'
     ]
        },
      ]
diff --git a/versioned_docs/version-2.x/performance/index.md b/versioned_docs/version-2.x/performance/index.md
index eca146ad2..394abc861 100644
--- a/versioned_docs/version-2.x/performance/index.md
+++ b/versioned_docs/version-2.x/performance/index.md
@@ -4,15 +4,37 @@ title: Query Performance Overview
 
 # Query Performance in Apache Cloudberry
 
-Apache Cloudberry dynamically eliminates irrelevant partitions in a table and optimally allocates memory for different operators in a query.These enhancements scan less data for a query, accelerate query processing, and support more concurrency.
+Apache Cloudberry improves query performance through dynamic partition elimination and adaptive memory allocation. These mechanisms help reduce the amount of data scanned, speed up query execution, and enhance overall concurrency.
 
-- Dynamic partition elimination
+:::tip
+Apache Cloudberry uses the GPORCA optimizer by default, which extends the native Postgres planner with more advanced optimization capabilities.
+:::
+
+## Dynamic partition elimination
+
+Apache Cloudberry supports dynamic partition elimination (DPE), a feature that prunes partitions at query execution time based on runtime values. This reduces the data scanned and improves query efficiency.
+
+DPE is supported for the following join types:
+
+- `Hash Inner Join`
+- `Hash Left Join`
+- `Hash Right Join` (since v2.0.0)
+
+DPE is enabled when the following conditions are met:
+
+- The partitioned table is on the outer side of the join.
+- The join condition is an equality predicate on the partition key.
+- Statistics are collected on the partitioned tables. For example:
+
+    ```sql
+    ANALYZE <root partition>;
+    ```
 
-    In Apache Cloudberry, values available only when a query runs are used to dynamically prune partitions, which improves query processing speed. Enable or deactivate dynamic partition elimination by setting the server configuration parameter `gp_dynamic_partition_pruning` to `ON` or `OFF`; it is `ON` by default.
+The `gp_dynamic_partition_pruning` parameter controls whether DPE is enabled. It is ``ON`` by default but only applies to the Postgres optimizer. You can verify if DPE is in effect by checking the ``EXPLAIN`` plan for the presence of a `Partition Selector` node.
 
-- Memory optimizations
+## Memory optimizations
 
-    Apache Cloudberry allocates memory optimally for different operators in a query and frees and re-allocates memory during the stages of processing a query.
+Apache Cloudberry dynamically allocates memory based on the characteristics of query operators and proactively releases or reallocates memory during different query phases. This leads to more efficient memory usage and faster query execution.
 
 :::info
 Apache Cloudberry uses GPORCA by default. GPORCA extends the planning and optimization capabilities of the Postgres optimizer.
diff --git a/versioned_docs/version-2.x/performance/manage-resources-using-resource-groups.md b/versioned_docs/version-2.x/performance/manage-resources-using-resource-groups.md
index a76744bf1..77a584f68 100644
--- a/versioned_docs/version-2.x/performance/manage-resources-using-resource-groups.md
+++ b/versioned_docs/version-2.x/performance/manage-resources-using-resource-groups.md
@@ -26,14 +26,14 @@ You can also use resource groups to manage the CPU and memory resources of exter
 
 When you create a resource group, you provide a set of limits that determine the amount of CPU and memory resources available to the group. The following table lists the available limits for resource groups:
 
-| Limit Type        | Description                                                                                                                                          | Value Range                             | Default                                                                  |
+| Limit type        | Description                                                                                                                                          | Value range                             | Default                                                                  |
 |-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|--------------------------------------------------------------------------|
 | `CONCURRENCY`     | The maximum number of concurrent transactions, including active and idle transactions, that are permitted in the resource group.                     | [0, max_connections]               | 20                                                                       |
 | `CPU_MAX_PERCENT` | The maximum percentage of CPU resources the group can use.                                                                                           | [1, 100]                             | -1 (not set)                                                             |
 | `CPU_WEIGHT`      | The scheduling priority of the resource group.                                                                                                       | [1, 500]                             | 100                                                                      |
 | `CPUSET`          | The specific CPU logical core (or logical thread in hyperthreading) reserved for this resource group.                                                | It depends on system core configuration | -1                                                                       |
 | `IO_LIMIT`        | The limit for the maximum read/write disk I/O throughput, and maximum read/write I/O operations per second. Set the value on a per-tablespace basis. | [2, 4294967295 or max]             | -1                                                                       |
-| `MEMORY_LIMIT`    | The memory limit value specified for the resource group.                                                                                             | Integer (MB)                            | -1 (not set, use `statement_mem` as the memory limit for a single query) |
+| `MEMORY_QUOTA`    | The memory limit value specified for the resource group.                                                                                             | Integer (MB)                            | -1 (not set, use `statement_mem` as the memory limit for a single query) |
 | `MIN_COST`        | The minimum cost of a query plan to be included in the resource group.                                                                               | Integer                                 | 0                                                                        |
 
 :::note
@@ -134,15 +134,15 @@ When you enable resource groups, memory usage is managed at the Apache Cloudberr
 
 The amount of memory allocated to a query is determined by the following parameters:
 
-The parameter `MEMORY_LIMIT` of a resource group sets the maximum amount of memory reserved for this resource group on a segment. This determines the total amount of memory that all worker processes for a query can consume on the segment host during query execution. The amount of memory allotted to a query is the group memory limit divided by the group concurrency limit: `MEMORY_LIMIT` / `CONCURRENCY`.
+The parameter `MEMORY_QUOTA` of a resource group sets the maximum amount of memory reserved for this resource group on a segment. This determines the total amount of memory that all worker processes for a query can consume on the segment host during query execution. The amount of memory allotted to a query is the group memory limit divided by the group concurrency limit: `MEMORY_QUOTA` / `CONCURRENCY`.
 
 If a query requires a large amount of memory, you might use the server configuration parameter `gp_resgroup_memory_query_fixed_mem` to set a fixed memory amount for the query at the session level. This parameter overrides and can surpass the allocated memory of the resource group.
 
-Apache Cloudberry allocates memory for an incoming query using the `gp_resgroup_memory_query_fixed_mem` value, if set, to bypass the resource group settings. Otherwise, it uses `MEMORY_LIMIT` / `CONCURRENCY` as the memory allocated for the query. If `MEMORY_LIMIT` is not set, the value for the query memory allocation defaults to `statement_mem`.
+Apache Cloudberry allocates memory for an incoming query using the `gp_resgroup_memory_query_fixed_mem` value, if set, to bypass the resource group settings. Otherwise, it uses `MEMORY_QUOTA` / `CONCURRENCY` as the memory allocated for the query. If `MEMORY_QUOTA` is not set, the value for the query memory allocation defaults to `statement_mem`.
 
 For all queries, if there is not enough memory in the system, they spill to disk. When the limit `gp_workfile_limit_files_per_query` is reached, Apache Cloudberry generates an out of memory (OOM) error.
 
-For example, consider a resource group named `adhoc` with `MEMORY_LIMIT` set to 1.5 GB and `CONCURRENCY` set to `3`. By default, each statement submitted to the group is allocated 500 MB of memory. Now consider the following series of events:
+For example, consider a resource group named `adhoc` with `MEMORY_QUOTA` set to 1.5 GB and `CONCURRENCY` set to `3`. By default, each statement submitted to the group is allocated 500 MB of memory. Now consider the following series of events:
 
 1. User `ADHOC_1` submits query `Q1`, overriding `gp_resgroup_memory_query_fixed_mem` to 800MB. The `Q1` statement is admitted into the system.
 
@@ -158,10 +158,10 @@ For example, consider a resource group named `adhoc` with `MEMORY_LIMIT` set to
 
 There are some special usage considerations regarding memory limits:
 
-- If you set the configuration parameters `gp_resource_group_bypass` or `gp_resource_group_bypass_catalog_query` to bypass the resource group limits, the memory limit for the query takes the value of `statement_mem`.
-- When (`MEMORY_LIMIT` / `CONCURRENCY`) \< `statement_mem`, Apache Cloudberry uses `statement_mem` as the fixed amount of memory allocated by query.
-- The maximum value of `statement_mem` is capped at `max_statement_mem`.
-- Queries whose plan cost is less than the limit `MIN_COST` use a memory limit of `statement_mem`.
+- If the configuration parameters `gp_resource_group_bypass` or `gp_resource_group_bypass_catalog_query` are enabled to bypass resource group limits, the query's memory allocation will be determined by the value of `statement_mem`.
+- When (`MEMORY_QUOTA` / `CONCURRENCY`) is less than `statement_mem`, the system uses `statement_mem` as the fixed memory allocation for the query.
+- The maximum value of `statement_mem` is limited by `max_statement_mem`.
+- If a query's planned cost is lower than the configured `MIN_COST`, it will also be assigned memory based on `statement_mem`.
 
 ### Disk I/O limits
 
@@ -198,7 +198,8 @@ You do not need to change your version of cgroup, you can simply skip to `optimi
 However, if you prefer to switch from cgroup v1 to v2, run the following commands as root:
 
 :::note
-If you are using an older version of CentOS, such as Centos 7.x or earlier, you will only be able to use the default `cgroup v1` control groups; if you are using Centos 8.x, you can follow the steps below to switch the control group from v1 to v2.
+- If you are using an older version of CentOS, such as Centos 7.x or earlier, you will only be able to use the default `cgroup v1` control groups; if you are using Centos 8.x, you can follow the steps below to switch the control group from v1 to v2.
+- Starting from v2.0.0, for `cpu.pressure`, even when `gp_resource_manager` is set to `group-v2`, Apache Cloudberry no longer checks the permissions or existence of the `/proc/pressure/cpu` interface. Therefore, the `group-v2` mode can still function properly as long as the kernel version is compatible, even if PSI (Pressure Stall Information) is not enabled.
 :::
 
 - Red Hat 8/Rocky 8/Oracle 8 systems:
@@ -408,12 +409,12 @@ SELECT * FROM gp_toolkit.gp_resgroup_config;
 
 When you create a resource group for a role, you provide a name and a CPU resource allocation mode (core or percentage). You can optionally provide a concurrent transaction limit, a memory limit, a CPU soft priority, disk I/O limits, and a minimum cost. Use the `CREATE RESOURCE GROUP` command to create a new resource group.
 
-When you create a resource group for a role, you must provide a `CPU_MAX_PERCENT` or `CPUSET` limit value. These limits identify the percentage of Apache Cloudberry CPU resources to allocate to this resource group. You might specify a `MEMORY_LIMIT` to reserve a fixed amount of memory for the resource group.
+When you create a resource group for a role, you must provide a `CPU_MAX_PERCENT` or `CPUSET` limit value. These limits identify the percentage of Apache Cloudberry CPU resources to allocate to this resource group. You might specify a `MEMORY_QUOTA` to reserve a fixed amount of memory for the resource group.
 
 For example, to create a resource group named *rgroup1* with a CPU limit of 20, a memory limit of 25, a CPU soft priority of 500, a minimum cost of 50, and disk I/O limits for the `pg_default` tablespace:
 
 ```sql
-CREATE RESOURCE GROUP rgroup1 WITH (CONCURRENCY=20, CPU_MAX_PERCENT=20, MEMORY_LIMIT=250, CPU_WEIGHT=500, MIN_COST=50, 
+CREATE RESOURCE GROUP rgroup1 WITH (CONCURRENCY=20, CPU_MAX_PERCENT=20, MEMORY_QUOTA=250, CPU_WEIGHT=500, MIN_COST=50, 
 IO_LIMIT='pg_default: wbps=1000, rbps=1000, wiops=100, riops=100');
 ```
 
@@ -427,7 +428,7 @@ The `ALTER RESOURCE GROUP` command updates the limits of a resource group. To ch
 
 ```sql
 ALTER RESOURCE GROUP rg_role_light SET CONCURRENCY 7;
-ALTER RESOURCE GROUP exec SET MEMORY_LIMIT 30;
+ALTER RESOURCE GROUP exec SET MEMORY_QUOTA 30;
 ALTER RESOURCE GROUP rgroup1 SET CPUSET '1;2,4';
 ALTER RESOURCE GROUP sales SET IO_LIMIT 'tablespace1:wbps=2000,wiops=2000;tablespace2:rbps=2024,riops=2024'; 
 ```
@@ -476,7 +477,7 @@ Monitoring the status of your resource groups and queries might involve the foll
 
 ### View resource group limits
 
-The `gp_resgroup_config` `gp_toolkit` system view displays the current limits for a resource group. To view the limits of all resource groups:
+The `gp_toolkit.gp_resgroup_config` system view displays the current limits for a resource group. To view the limits of all resource groups:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_config;
@@ -484,7 +485,7 @@ SELECT * FROM gp_toolkit.gp_resgroup_config;
 
 ### View resource group query status
 
-The `gp_resgroup_status` `gp_toolkit` system view enables you to view the status and activity of a resource group. The view displays the number of running and queued transactions. To view this information:
+The `gp_toolkit.gp_resgroup_status` system view enables you to view the status and activity of a resource group. The view displays the number of running and queued transactions. To view this information:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_status;
@@ -492,7 +493,7 @@ SELECT * FROM gp_toolkit.gp_resgroup_status;
 
 ### View resource group memory usage per host
 
-The `gp_resgroup_status_per_host` `gp_toolkit` system view enables you to view the real-time memory usage of a resource group on a per-host basis. To view this information:
+The `gp_toolkit.gp_resgroup_status_per_host` system view enables you to view the real-time memory usage of a resource group on a per-host basis. To view this information:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_status_per_host;
@@ -509,7 +510,7 @@ WHERE pg_roles.rolresgroup=pg_resgroup.oid;
 
 ### View resource group disk I/O usage per host
 
-The `gp_resgroup_iostats_per_host` `gp_toolkit` system view enables you to view the real-time disk I/O usage of a resource group on a per-host basis. To view this information:
+The `gp_toolkit.gp_resgroup_iostats_per_host` system view enables you to view the real-time disk I/O usage of a resource group on a per-host basis. To view this information:
 
 ```sql
 SELECT * FROM gp_toolkit.gp_resgroup_iostats_per_host;
@@ -620,7 +621,7 @@ Apache Cloudberry automatically adjusts transaction and group memory to the new
 
 **My query cannot run due to insufficient memory, resulting in memory leak Out of Memory (OOM).**
 
-First, ensure that the resource group is allocating enough memory required by the query by tuning resource group parameters such as `CONCURRENCY` and `MEMORY_LIMIT`. Analyze the type of query, whether there will be a lot of intermediate results using memory. If it does exist, you can set a reasonable `gp_resgroup_memory_query_fixed_mem` to allocate more memory at the session level for this specific query.
+First, ensure that the resource group is allocating enough memory required by the query by tuning resource group parameters such as `CONCURRENCY` and `MEMORY_QUOTA`. Analyze the type of query, whether there will be a lot of intermediate results using memory. If it does exist, you can set a reasonable `gp_resgroup_memory_query_fixed_mem` to allocate more memory at the session level for this specific query.
 
 **After a memory leak OOM the system has a high concurrent load**.
 
diff --git a/versioned_docs/version-2.x/performance/update-stats-using-analyze.md b/versioned_docs/version-2.x/performance/update-stats-using-analyze.md
index 3f15a12d5..dff83f0ab 100644
--- a/versioned_docs/version-2.x/performance/update-stats-using-analyze.md
+++ b/versioned_docs/version-2.x/performance/update-stats-using-analyze.md
@@ -50,6 +50,12 @@ Run `ANALYZE`:
 
 `ANALYZE` requires only a read lock on the table, so it might be run in parallel with other database activity. But for performance reasons, it is not recommended to run `ANALYZE` while performing loads, `INSERT`, `UPDATE`, `DELETE`, and `CREATE INDEX` operations.
 
+:::info
+Apache Cloudberry improves the behavior of `ANALYZE` on partitioned tables. When you explicitly run statistics collection on a leaf partition (for example, `ANALYZE sales_1_prt_p2023`), the system no longer updates statistics for the root or other partitions. Only when `ANALYZE` is run on the root table (for example, `ANALYZE sales`), will statistics for the entire table, including all child partitions, be refreshed.
+
+This change gives you finer control over statistics maintenance and avoids unnecessary updates. In practice, it's recommended to selectively analyze specific partitions or the entire table based on data change patterns.
+:::
+
 ## Configure automatic statistics collection
 
 The `gp_autostats_mode` configuration parameter, together with the `gp_autostats_on_change_threshold` parameter, determines when an automatic analyze operation is triggered. When automatic statistics collection is triggered, the planner adds an `ANALYZE` step to the query.
diff --git a/versioned_docs/version-2.x/sys-catalogs/gp_toolkit.md b/versioned_docs/version-2.x/sys-catalogs/gp_toolkit.md
new file mode 100644
index 000000000..a4498c6c7
--- /dev/null
+++ b/versioned_docs/version-2.x/sys-catalogs/gp_toolkit.md
@@ -0,0 +1,1014 @@
+---
+title: gp_toolkit
+---
+
+# The gp_toolkit Administrative Schema
+
+Apache Cloudberry 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:
+
+```sql
+=> ALTER ROLE myrole SET search_path TO myschema,gp_toolkit;
+```
+
+This document describes the most useful views and user-defined functions (UDFs) 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).
+
+:::caution
+Do not change database objects in the gp_toolkit schema. Do not create database objects in the schema. Changes to objects in the schema might affect the accuracy of administrative information returned by schema objects. Any changes made in the gp_toolkit schema are lost when the database is backed up and then restored with the `gpbackup` and `gprestore` utilities.
+:::
+
+These are the categories for views in the `gp_toolkit` schema.
+
+- [Check for tables that need routine maintenance](#check-for-tables-that-need-routine-maintenance)
+- [Check for locks](#check-for-locks)
+- [Check append-optimized tables](#check-append-optimized-tables)
+- [View server log files](#view-server-log-files)
+- [Check server configuration files](#check-server-configuration-files)
+- [Check for failed segments](#check-for-failed-segments)
+- [Check resource group activity and status](#check-resource-group-activity-and-status)
+- [Check resource queue activity and status](#check-resource-queue-activity-and-status)
+- [Check query disk spill space usage](#check-query-disk-spill-space-usage)
+- [View users and groups (roles)](#view-users-and-groups-roles)
+- [Check database object sizes and disk space](#check-database-object-sizes-and-disk-space)
+- [Check for missing and orphaned data files](#check-for-missing-and-orphaned-data-files)
+- [Move orphaned data files](#move-orphaned-data-files)
+- [Check for uneven data distribution](#check-for-uneven-data-distribution)
+- [Maintain partitions](#maintain-partitions)
+
+## About the extension
+
+`gp_toolkit` is implemented as an extension in Apache Cloudberry v2.0.0. Because this extension is registered in the `template1` database, it is both registered an immediately available to use in every Apache Cloudberry database that you create.
+
+## Upgrade the extension
+
+The `gp_toolkit` extension is installed when you install or upgrade Apache Cloudberry. A previous version of the extension will continue to work in existing databases after you upgrade Apache Cloudberry. To upgrade to the most recent version of the extension, you must:
+
+```sql
+ALTER EXTENSION gp_toolkit UPDATE TO '1.4';
+```
+
+in **every** database in which you use the extension.
+
+## Check for tables that need routine maintenance
+
+The following views can help identify tables that need routine table maintenance (`VACUUM` and/or `ANALYZE`).
+
+- [`gp_bloat_diag`](#gp_bloat_diag)
+- [`gp_stats_missing`](#gp_stats_missing)
+
+The `VACUUM` or `VACUUM FULL` command reclaims disk space occupied by deleted or obsolete rows. Because of the MVCC transaction concurrency model used in Apache Cloudberry, data rows that are deleted or updated still occupy physical space on disk even though they are not visible to any new transactions. Expired rows increase table size on disk and eventually slow down scans of the table.
+
+The `ANALYZE` command collects column-level statistics needed by the query optimizer. Apache Cloudberry uses a cost-based query optimizer that relies on database statistics. Accurate statistics allow the query optimizer to better estimate selectivity and the number of rows retrieved by a query operation in order to choose the most efficient query plan.
+
+### gp_bloat_diag
+
+This view shows regular heap-storage tables that have bloat (the actual number of pages on disk exceeds the expected number of pages given the table statistics). Tables that are bloated require a `VACUUM` or a `VACUUM FULL` in order to reclaim disk space occupied by deleted or obsolete rows. This view is accessible to all users, however non-superusers will only be able to see the tables that they have permission to access.
+
+Note
+
+For diagnostic functions that return append-optimized table information, see [Check append-optimized tables](#check-append-optimized-tables).
+
+The columns of this view are described as follows:
+
+- `bdirelid`: Table object id.
+- `bdinspname`: Schema name.
+- `bdirelname`: Table name.
+- `bdirelpages`: Actual number of pages on disk.
+- `bdiexppages`: Expected number of pages given the table data.
+- `bdidiag`: Bloat diagnostic message.
+
+### gp_stats_missing
+
+This view shows tables that do not have statistics and therefore may require an `ANALYZE` be run on the table.
+
+The columns of this view are described as follows:
+
+- `smischema`: Schema name.
+- `smitable`: Table name.
+- `smisize`: Does this table have statistics? False if the table does not have row count and row sizing statistics recorded in the system catalog, which may indicate that the table needs to be analyzed. This will also be false if the table does not contain any rows. For example, the parent tables of partitioned tables are always empty and will always return a false result.
+- `smicols`: Number of columns in the table.
+- `smirecs`: The total number of columns in the table that have statistics recorded.
+
+## Check for locks
+
+When a transaction accesses a relation (such as a table), it acquires a lock. Depending on the type of lock acquired, subsequent transactions may have to wait before they can access the same relation. For more information on the types of locks, see the [Transaction](..). Apache Cloudberry resource queues (used for resource management) also use locks to control the admission of queries into the system.
+
+The `gp_locks_*` family of views can help diagnose queries and sessions that are waiting to access an object due to a lock.
+
+- [`gp_locks_on_relation`](#gp_locks_on_relation)
+- [`gp_locks_on_resqueue`](#gp_locks_on_resqueue)
+
+### gp_locks_on_relation
+
+This view shows any locks currently being held on a relation, and the associated session information about the query associated with the lock. For more information on the types of locks, see the [Transaction](..). This view is accessible to all users, however non-superusers will only be able to see the locks for relations that they have permission to access.
+
+The columns of this view are described as follows:
+
+- `lorlocktype`: Type of the lockable object: `relation`, `extend`, `page`, `tuple`, `transactionid`, `object`, `userlock`, `resource queue`, or `advisory`.
+- `lordatabase`: Object ID of the database in which the object exists, zero if the object is a shared object.
+- `lorrelname`: The name of the relation.
+- `lorrelation`: The object ID of the relation.
+- `lortransaction`: The transaction ID that is affected by the lock.
+- `lorpid`: Process ID of the server process holding or awaiting this lock. `NULL` if the lock is held by a prepared transaction.
+- `lormode`: Name of the lock mode held or desired by this process.
+- `lorgranted`: Displays whether the lock is granted (`true`) or not granted (`false`).
+- `lorcurrentquery`: The current query in the session.
+
+### gp_locks_on_resqueue
+
+:::note
+The `gp_locks_on_resqueue` view is valid only when resource queue-based resource management is active.
+:::
+
+This view shows any locks currently being held on a resource queue, and the associated session information about the query associated with the lock. This view is accessible to all users, however non-superusers will only be able to see the locks associated with their own sessions.
+
+The columns of this view are described as follows:
+
+- `lorusename`: Name of the user running the session.
+- `lorrsqname`: The resource queue name.
+- `lorlocktype`: Type of the lockable object: `resource queue`.
+- `lorobjid`: The ID of the locked transaction.
+- `lortransaction`: The ID of the transaction that is affected by the lock.
+- `lorpid`: The process ID of the transaction that is affected by the lock.
+- `lormode`: The name of the lock mode held or desired by this process.
+- `lorgranted`: Displays whether the lock is granted (`true`) or not granted (`false`).
+- `lorwaiteventtype`: The type of waiting event (for example, I/O, lock, network).
+- `lorwaitevent`: The name or description of the waiting event (for example, the I/O operation or lock object of a file).
+
+## Check append-optimized tables
+
+The `gp_toolkit` schema includes a set of diagnostic functions you can use to investigate the state of append-optimized tables.
+
+When an append-optimized table (or column-oriented append-optimized table) is created, another table is implicitly created, containing metadata about the current state of the table. The metadata includes information such as the number of records in each of the table's segments.
+
+Append-optimized tables may have non-visible rows—rows that have been updated or deleted, but remain in storage until the table is compacted using `VACUUM`. The hidden rows are tracked using an auxiliary visibility map table, or visimap.
+
+The following functions let you access the metadata for append-optimized and column-oriented tables and view non-visible rows.
+
+For most of the functions, the input argument is `regclass`, either the table `name` or the `oid` of a table.
+
+### __gp_aovisimap_compaction_info(oid)
+
+This function displays compaction information for an append-optimized table. The information is for the on-disk data files on database segments that store the table data. You can use the information to determine the data files that will be compacted by a `VACUUM` operation on an append-optimized table.
+
+:::note
+Until a `VACUUM` operation deletes the row from the data file, deleted or updated data rows occupy physical space on disk even though they are hidden to new transactions. The configuration parameter `gp_appendonly_compaction` controls the functionality of the `VACUUM` command.
+:::
+
+This table describes the `__gp_aovisimap_compaction_info` function output table. The columns of this table are described as follows:
+
+- `content`: Database segment ID.
+- `datafile`: ID of the data file on the segment.
+- `compaction_possible`: The value is either `t` or `f`. The value `t` indicates that the data in data file be compacted when a VACUUM operation is performed. The server configuration parameter `gp_appendonly_compaction_threshold` affects this value.
+- `hidden_tupcount`: In the data file, the number of hidden (deleted or updated) rows.
+- `total_tupcount`: In the data file, the total number of rows.
+- `percent_hidden`: In the data file, the ratio (as a percentage) of hidden (deleted or updated) rows to total rows.
+
+### __gp_aoseg(regclass)
+
+This function returns metadata information contained in the append-optimized table's on-disk segment file.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `segment_id`: The ID of the data segment in the cluster.
+- `segno`: The file segment number.
+- `eof`: The effective end of file for this file segment.
+- `tupcount`: The total number of tuples in the segment, including invisible tuples.
+- `varblockcount`: The total number of varblocks in the file segment.
+- `eof_uncompressed`: The end of file if the file segment were uncompressed.
+- `modcount`: The number of data modification operations.
+- `formatversion`: The version of the AO file storage format, which indicates the format version of the file.
+- `state`: The state of the file segment. Indicates if the segment is active or ready to be dropped after compaction.
+
+### __gp_aoseg_history(regclass)
+
+This function returns metadata information contained in the append-optimized table's on-disk segment file. It displays all different versions (heap tuples) of the aoseg meta information. The data is complex, but users with a deep understanding of the system may find it useful for debugging.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `segment_id`: The ID of the data segment in the cluster.
+- `segno`: The number of the segment in the segment file.
+- `tupcount`: The number of tuples, including hidden tuples.
+- `eof`: The effective end of file for the segment.
+- `eof_uncompressed`: The end of file for the segment if data were uncompressed.
+- `modcount`: A count of data modifications.
+- `formatversion`: The version of the AO file storage format, which indicates the format version of the file.
+- `state`: The status of the segment.
+
+### __gp_aocsseg(regclass)
+
+This function returns metadata information contained in a column-oriented append-optimized table's on-disk segment file, excluding non-visible rows. Each row describes a segment for a column in the table.
+
+The input argument is the name or the oid of a column-oriented append-optimized table. The columns of the output are described as follows:
+
+- `segment_id`: The ID of the data segment in the cluster.
+- `segno`: The segment number.
+- `column_num`: The column number.
+- `physical_segno`: The number of the segment in the segment file.
+- `tupcount`: The number of rows in the segment, excluding hidden tuples.
+- `eof`: The effective end of file for the segment.
+- `eof_uncompressed`: The end of file for the segment if the data were uncompressed.
+- `modcount`: A count of data modification operations for the segment.
+- `formatversion`: The version of the AO file storage format, which indicates the format version of the file.
+- `state`: The status of the segment.
+
+### __gp_aocsseg_history(regclass)
+
+This function returns metadata information contained in a column-oriented append-optimized table's on-disk segment file. Each row describes a segment for a column in the table. The data is complex, but users with a deep understanding of the system may find it useful for debugging.
+
+The input argument is the name or the oid of a column-oriented append-optimized table. The columns of the output are described as follows:
+
+- `segment_id`: The ID of the data segment in the cluster.
+- `segno`: The segment number in the segment file.
+- `column_num`: The column number.
+- `physical_segno`: The segment containing data for the column.
+- `tupcount`: The total number of tuples in the segment.
+- `eof`: The effective end of file for the segment.
+- `eof_uncompressed`: The end of file for the segment if the data were uncompressed.
+- `modcount`: A count of the data modification operations.
+- `formatversion`: The version of the AO file storage format, which indicates the format version of the file.
+- `state`: The state of the segment.
+
+### __gp_aovisimap(regclass)
+
+This function returns the tuple ID, the segment file, and the row number of each non-visible tuple according to the visibility map.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `tid`: The tuple id.
+- `segno`: The number of the segment file.
+- `row_num`: The row number of a row that has been deleted or updated.
+
+### __gp_aovisimap_hidden_info(regclass)
+
+This function returns the numbers of hidden and visible tuples in the segment files for an append-optimized table.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `segno`: The number of the segment file.
+- `hidden_tupcount`: The number of hidden tuples in the segment file.
+- `total_tupcount`: The total number of tuples in the segment file.
+
+### __gp_aovisimap_entry(regclass)
+
+This function returns information about each visibility map entry for the table.
+
+The input argument is the name or the oid of an append-optimized table. The columns of the output are described as follows:
+
+- `segno`: Segment number of the visibility map entry.
+- `first_row_num`: The first row number of the entry.
+- `hidden_tupcount`: The number of hidden tuples in the entry.
+- `bitmap`: A text representation of the visibility bitmap.
+
+### __gp_aoblkdir(regclass)
+
+For a given AO/AOCO table that had or has an index, this function returns a row for each block directory entry recorded in the block directory relation; it flattens the `minipage` column of block directory relations and returns a row for each `minipage` entry.
+
+The input argument is the name or the oid of an append-optimized table.
+
+You must execute this function in utility mode against every segment, or with `gp_dist_random()` as shown here:
+
+```sql
+SELECT (gp_toolkit.__gp_aoblkdir('<table_name>')).*
+    FROM gp_dist_random('gp_id');
+```
+
+The columns of the output are described as follows:
+
+- `tupleid`: The tuple id of the block directory row containing this block directory entry.
+- `segno`: The physical segment file number.
+- `columngroup_no`: The `attnum` of the column described by this `minipage` entry (always `0` for row-oriented tables).
+- `entry_no`: The entry serial number inside this `minipage` containing this block directory entry.
+- `first_row_no`: The first row number of the rows covered by this block directory entry.
+- `file_offset`: The starting file offset of the rows covered by this block directory entry.
+- `row_count`: The count of rows covered by this block directory entry.
+
+### get_column_size(oid)
+
+For a given AOCO table, this function returns the column size and compression ratio for all columns in the table.
+
+The input argument is the object identifier of a column-oriented append-optimized table. The columns of the output are described as follows:
+
+- `segment`: The segment id.
+- `attnum`: The attribute number of the column.
+- `size`: The size of the column in bytes.
+- `size_uncompressed`: The size of the column in bytes if the column was not compressed.
+- `compression_ratio`: The compression ratio.
+
+### gp_column_size
+
+This view gathers the column size and compression ratio for column-oriented append-optimized tables from all segments. The columns of the view are described as follows:
+
+- `gp_segment_id`: Segment ID.
+- `relid`: The object identifier (OID) of the table.
+- `schema`: The schema to which the table belongs.
+- `relname`: The table name.
+- `attnum`: The attribute number of the column.
+- `attname`: The column name.
+- `size`: The size of the column in bytes.
+- `size_uncompressed`: The size of the column in bytes if the column was not compressed.
+- `compression_ratio`: The compression ratio.
+
+### gp_column_size_summary
+
+This view shows a summary of the `gp_column_size` view. It aggregates the column size and compression ratio for each column in each column-oriented append-optimized table from all segments. The columns of the view are described as follows:
+
+- `relid`: The object identifier (OID) of the table.
+- `schema`: The schema to which the table belongs.
+- `relname`: The table name.
+- `attnum`: The attribute number of the column.
+- `attname`: The column name.
+- `size`: The size of the column in bytes.
+- `size_uncompressed`: The size of the column in bytes if the column were uncompressed.
+- `compression_ratio`: The compression ratio.
+
+## View server log files
+
+Each component of a Apache Cloudberry system (coordinator, standby coordinator, primary segments, and mirror segments) keeps its own server log files. The `gp_log_*` family of views allows you to issue SQL queries against the server log files to find particular entries of interest. The use of these views require superuser permissions.
+
+- [`gp_log_command_timings`](#gp_log_command_timings)
+- [`gp_log_database`](#gp_log_database)
+- [`gp_log_coordinator_concise`](#gp_log_coordinator_concise)
+- [`gp_log_system`](#gp_log_system)
+
+### gp_log_command_timings
+
+This view uses an external table to read the log files on the coordinator and report the run time of SQL commands in a database session. The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `logsession`: The session identifier (prefixed with "con").
+- `logcmdcount`: The command number within a session (prefixed with "cmd").
+- `logdatabase`: The name of the database.
+- `loguser`: The name of the database user.
+- `logpid`: The process id (prefixed with "p").
+- `logtimemin`: The time of the first log message for this command.
+- `logtimemax`: The time of the last log message for this command.
+- `logduration`: Statement duration from start to end time.
+
+### gp_log_database
+
+This view uses an external table to read the server log files of the entire Apache Cloudberry system (coordinator, segments, and mirrors) and lists log entries associated with the current database. Associated log entries can be identified by the session id (logsession) and command id (logcmdcount). The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `logtime`: The timestamp of the log message.
+- `loguser`: The name of the database user.
+- `logdatabase`: The name of the database.
+- `logpid`: The associated process id (prefixed with "p").
+- `logthread`: The associated thread count (prefixed with "th").
+- `loghost`: The segment or coordinator host name.
+- `logport`: The segment or coordinator port.
+- `logsessiontime`: Time session connection was opened.
+- `logtransaction`: Global transaction id.
+- `logsession`: The session identifier (prefixed with "con").
+- `logcmdcount`: The command number within a session (prefixed with "cmd").
+- `logsegment`: The segment content identifier (prefixed with "seg" for primary or "mir" for mirror. The coordinator always has a content id of -1).
+- `logslice`: The slice id (portion of the query plan being run).
+- `logdistxact`: Distributed transaction id.
+- `loglocalxact`: Local transaction id.
+- `logsubxact`: Subtransaction id.
+- `logseverity`: LOG, ERROR, FATAL, PANIC, DEBUG1 or DEBUG2.
+- `logstate`: SQL state code associated with the log message.
+- `logmessage`: Log or error message text.
+- `logdetail`: Detail message text associated with an error message.
+- `loghint`: Hint message text associated with an error message.
+- `logquery`: The internally-generated query text.
+- `logquerypos`: The cursor index into the internally-generated query text.
+- `logcontext`: The context in which this message gets generated.
+- `logdebug`: Query string with full detail for debugging.
+- `logcursorpos`: The cursor index into the query string.
+- `logfunction`: The function in which this message is generated.
+- `logfile`: The log file in which this message is generated.
+- `logline`: The line in the log file in which this message is generated.
+- `logstack`: Full text of the stack trace associated with this message.
+
+### gp_log_coordinator_concise
+
+This view uses an external table to read a subset of the log fields from the coordinator log file. The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `logtime`: The timestamp of the log message.
+- `logdatabase`: The name of the database.
+- `logsession`: The session identifier (prefixed with "con").
+- `logcmdcount`: The command number within a session (prefixed with "cmd").
+- `logseverity`: The log severity level.
+- `logmessage`: Log or error message text.
+
+### gp_log_system
+
+This view uses an external table to read the server log files of the entire Apache Cloudberry system (coordinator, segments, and mirrors) and lists all log entries. Associated log entries can be identified by the session id (logsession) and command id (logcmdcount). The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `logtime`: The timestamp of the log message.
+- `loguser`: The name of the database user.
+- `logdatabase`: The name of the database.
+- `logpid`: The associated process id (prefixed with "p").
+- `logthread`: The associated thread count (prefixed with "th").
+- `loghost`: The segment or coordinator host name.
+- `logport`: The segment or coordinator port.
+- `logsessiontime`: Time session connection was opened.
+- `logtransaction`: Global transaction id.
+- `logsession`: The session identifier (prefixed with "con").
+- `logcmdcount`: The command number within a session (prefixed with "cmd").
+- `logsegment`: The segment content identifier (prefixed with "seg" for primary or "mir" for mirror. The coordinator always has a content id of -1).
+- `logslice`: The slice id (portion of the query plan being run).
+- `logdistxact`: Distributed transaction id.
+- `loglocalxact`: Local transaction id.
+- `logsubxact`: Subtransaction id.
+- `logseverity`: LOG, ERROR, FATAL, PANIC, DEBUG1 or DEBUG2.
+- `logstate`: SQL state code associated with the log message.
+- `logmessage`: Log or error message text.
+- `logdetail`: Detail message text associated with an error message.
+- `loghint`: Hint message text associated with an error message.
+- `logquery`: The internally-generated query text.
+- `logquerypos`: The cursor index into the internally-generated query text.
+- `logcontext`: The context in which this message gets generated.
+- `logdebug`: Query string with full detail for debugging.
+- `logcursorpos`: The cursor index into the query string.
+- `logfunction`: The function in which this message is generated.
+- `logfile`: The log file in which this message is generated.
+- `logline`: The line in the log file in which this message is generated.
+- `logstack`: Full text of the stack trace associated with this message.
+
+## Check server configuration files
+
+Each component of a Apache Cloudberry system (coordinator, standby coordinator, primary segments, and mirror segments) has its own server configuration file (`postgresql.conf`). The following `gp_toolkit` objects can be used to check parameter settings across all primary `postgresql.conf` files in the system:
+
+- [`gp_param_setting('parameter_name')`](#gp_param_settingparameter_name)
+- [`gp_param_settings_seg_value_diffs`](#gp_param_settings_seg_value_diffs)
+
+### gp_param_setting('parameter_name')
+
+This function takes the name of a server configuration parameter and returns the `postgresql.conf` value for the coordinator and each active segment. This function is accessible to all users. The columns of the view are described as follows:
+
+- `paramsegment`: The segment content id (only active segments are shown). The coordinator content id is always -1.
+- `paramname`: The name of the parameter.
+- `paramvalue`: The value of the parameter.
+
+Example:
+
+```sql
+SELECT * FROM gp_toolkit.gp_param_setting('max_connections');
+```
+
+### gp_param_settings_seg_value_diffs
+
+Server configuration parameters that are classified as *local* parameters (meaning each segment gets the parameter value from its own `postgresql.conf` file), should be set identically on all segments. This view shows local parameter settings that are inconsistent. Parameters that are supposed to have different values (such as `port`) are not included. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `psdname`: The name of the parameter.
+- `psdvalue`: The value of the parameter.
+- `psdcount`: The number of segments that have this value.
+
+## Check for failed segments
+
+The [`gp_pgdatabase_invalid`](#gp_pgdatabase_invalid) view can be used to check for down segments.
+
+### gp_pgdatabase_invalid
+
+This view shows information about segments that are marked as down in the system catalog. This view is accessible to all users. The columns of the view are described as follows:
+
+- `pgdbidbid`: The segment dbid. Every segment has a unique dbid.
+- `pgdbiisprimary`: Is the segment currently acting as the primary (active) segment? (t or f).
+- `pgdbicontent`: The content id of this segment. A primary and mirror will have the same content id.
+- `pgdbivalid`: Is this segment up and valid? (t or f).
+- `pgdbidefinedprimary`: Was this segment assigned the role of primary at system initialization time? (t or f).
+
+## Check resource group activity and status
+
+Note
+
+The resource group activity and status views described in this section are valid only when resource group-based resource management is active.
+
+Resource groups manage transactions to avoid exhausting system CPU and memory resources. Every database user is assigned a resource group. Apache Cloudberry evaluates every transaction submitted by a user against the limits configured for the user's resource group before running the transaction.
+
+You can use the `gp_resgroup_config` view to check the configuration of each resource group. You can use the `gp_resgroup_status*` views to display the current transaction status and resource usage of each resource group.
+
+- [`gp_resgroup_config`](#gp_resgroup_config)
+- [`gp_resgroup_role`](#gp_resgroup_role)
+- [`gp_resgroup_status`](#gp_resgroup_status)
+- [`gp_resgroup_status_per_host`](#gp_resgroup_status_per_host)
+- [`gp_resgroup_status_per_segment`](#gp_resgroup_status_per_segment)
+
+### gp_resgroup_config
+
+The `gp_resgroup_config` view allows administrators to see the current CPU, memory, and concurrency limits for a resource group.
+
+This view is accessible to all users. The columns of the view are described as follows:
+
+- `groupid`: The ID of the resource group.
+- `groupname`: The name of the resource group.
+- `concurrency`: The concurrency (`CONCURRENCY`) value specified for the resource group.
+- `cpu_max_percent`: The CPU limit (`CPU_MAX_PERCENT`) value specified for the resource group, or `-1`.
+- `cpu_weight`: The scheduling priority of the resource group (`CPU_WEIGHT`).
+- `cpuset`: The CPU cores reserved for the resource group (CPUSET), or -1.
+- `memory_quota`: The memory limit value specified for the resource group.
+- `min_cost`: The minimum cost of a query plan to be included in the resource group (`MIN_COST`).
+- `io_limit`: The maximum read/write sequential disk I/O throughput, and the maximum read/write I/O operations per second for the queries assigned to a specific tablespace (shown as the tablespace oid) and resource group (`IO_LIMIT`).
+
+### gp_resgroup_role
+
+The `gp_resgroup_role` view allows administrators to see the resource group assigned to every role.
+
+This view is accessible to all users. The columns of the view are described as follows:
+
+- `rrrolname`: The name of the role.
+- `rrrsgname`: The name of the resource group.
+
+### gp_resgroup_status
+
+The `gp_resgroup_status` view allows administrators to see status and activity for a resource group. It shows how many queries are waiting to run and how many queries are currently active in the system for each resource group. The view also displays current memory and CPU usage for the resource group.
+
+:::note
+Resource groups use the Linux control groups (cgroups) configured on the host systems. The cgroups are used to manage host system resources. When resource groups use cgroups that are as part of a nested set of cgroups, resource group limits are relative to the parent cgroup allotment. For information about nested cgroups and Apache Cloudberry resource group limits, see the *Use Resource Groups* document.
+:::
+
+This view is accessible to all users. The columns of the view are described as follows:
+
+- `groupid`: The ID of the resource group.
+- `groupname`: The name of the resource group.
+- `num_running`: The number of transactions currently running in the resource group.
+- `num_queueing`: The number of currently queued transactions for the resource group.
+- `num_queued`: The total number of queued transactions for the resource group since the Apache Cloudberry cluster was last started, excluding the num_queueing.
+- `num_executed`: The total number of transactions run in the resource group since the Apache Cloudberry cluster was last started, excluding the num_running.
+- `total_queue_duration`: The total time any transaction was queued since the Apache Cloudberry cluster was last started.
+
+Sample output for the `gp_resgroup_status` view:
+
+```sql
+select * from gp_toolkit.gp_resgroup_status;
+
+groupid | groupname | num_running | num_queueing | num_queued | num_executed | total_queue_duration 
+---------+-----------+-------------+--------------+------------+--------------+----------------------
+(0 rows)
+```
+
+### gp_resgroup_status_per_host
+
+The `gp_resgroup_status_per_host` view displays the real-time CPU and memory usage (MBs) for each resource group on a per-host basis. The view also displays available and granted group fixed and shared memory for each resource group on a host.
+
+The columns of the view are described as follows:
+
+- `groupid`: The ID of the resource group.
+- `groupname`: The name of the resource group.
+- `hostname`: The hostname of the segment host.
+- `cpu_usage`: The real-time CPU core usage by the resource group on a host. The value is the sum of the percentages (as a float value) of the CPU cores that are used by the resource group on the host.
+- `memory_usage`: The real-time memory usage of the resource group on each database segment's host, in MB.
+
+Sample output for the `gp_resgroup_status_per_host` view:
+
+```sql
+select * from gp_toolkit.gp_resgroup_status_per_host;
+
+groupid | groupname | hostname | cpu_usage | memory_usage 
+---------+-----------+----------+-----------+--------------
+(0 rows)
+```
+
+### gp_resgroup_status_per_segment
+
+The `gp_toolkit.gp_resgroup_status_per_segment` view shows memory usage by resource group on each segment. The statistics are reported by the vmem tracker and measured in MB. This view helps database administrators monitor memory consumption of resource groups across segments.
+
+Note
+
+This view is available only when resource group-based resource management is enabled.
+
+Column descriptions:
+
+- `groupid` (type: `oid`): Unique identifier of the resource group, corresponding to `pg_resgroup.oid`.
+- `groupname` (type: `name`): Name of the resource group, corresponding to `pg_resgroup.rsgname`.
+- `segment_id` (type: `smallint`): Content ID of the corresponding segment instance, taken from `gp_segment_configuration.content`.
+- `vmem_usage` (type: `smallint`): Real-time memory usage (in MB) of the resource group on the corresponding segment.
+
+## Check resource queue activity and status
+
+:::note
+The resource queue activity and status views described in this section are valid only when resource queue-based resource management is active.
+:::
+
+The purpose of resource queues is to limit the number of active queries in the system at any given time in order to avoid exhausting system resources such as memory, CPU, and disk I/O. All database users are assigned to a resource queue, and every statement submitted by a user is first evaluated against the resource queue limits before it can run. The `gp_resq_*` family of views can be used to check the status of statements currently submitted to the system through their respective resou [...]
+
+- [`gp_resq_activity`](#gp_resq_activity)
+- [`gp_resq_activity_by_queue`](#gp_resq_activity_by_queue)
+- [`gp_resq_priority_statement`](#gp_resq_priority_statement)
+- [`gp_resq_role`](#gp_resq_role)
+- [`gp_resqueue_status`](#gp_resqueue_status)
+
+### gp_resq_activity
+
+For the resource queues that have active workload, this view shows one row for each active statement submitted through a resource queue. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `resqprocpid`: Process ID assigned to this statement (on the coordinator).
+- `resqrole`: User name.
+- `resqoid`: Resource queue object id.
+- `resqname`: Resource queue name.
+- `resqstart`: Time statement was issued to the system.
+- `resqstatus`: Status of statement: running, waiting or cancelled.
+
+### gp_resq_activity_by_queue
+
+For the resource queues that have active workload, this view shows a summary of queue activity. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `resqoid`: Resource queue object id.
+- `resqname`: Resource queue name.
+- `resqlast`: Time of the last statement issued to the queue.
+- `resqstatus`: Status of last statement: running, waiting or cancelled.
+- `resqtotal`: Total statements in this queue.
+
+### gp_resq_priority_statement
+
+This view shows the resource queue priority, session ID, and other information for all statements currently running in the Apache Cloudberry system. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `rqpdatname`: The database name that the session is connected to.
+- `rqpusename`: The user who issued the statement.
+- `rqpsession`: The session ID.
+- `rqpcommand`: The number of the statement within this session (the command id and session id uniquely identify a statement).
+- `rqppriority`: The resource queue priority for this statement (`MAX`, `HIGH`, `MEDIUM`, `LOW`).
+- `rqpweight`: An integer value associated with the priority of this statement.
+- `rqpquery`: The query text of the statement.
+
+### gp_resq_role
+
+This view shows the resource queues associated with a role. This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `rrrolname`: Role (user) name.
+- `rrrsqname`: The resource queue name assigned to this role. If a role has not been explicitly assigned to a resource queue, it will be in the default resource queue (*pg_default*).
+
+### gp_resqueue_status
+
+This view allows administrators to see status and activity for a resource queue. It shows how many queries are waiting to run and how many queries are currently active in the system from a particular resource queue.
+
+The columns of the view are described as follows:
+
+- `queueid`: The ID of the resource queue.
+- `rsqname`: The name of the resource queue.
+- `rsqcountlimit`: The active query threshold of the resource queue. A value of -1 means no limit.
+- `rsqcountvalue`: The number of active query slots currently being used in the resource queue.
+- `rsqcostlimit`: The query cost threshold of the resource queue. A value of -1 means no limit.
+- `rsqcostvalue`: The total cost of all statements currently in the resource queue.
+- `rsqmemorylimit`: The memory limit for the resource queue.
+- `rsqmemoryvalue`: The total memory used by all statements currently in the resource queue.
+- `rsqwaiters`: The number of statements currently waiting in the resource queue.
+- `rsqholders`: The number of statements currently running on the system from this resource queue.
+
+## Check query disk spill space usage
+
+The *gp_workfile\_* views show information about all the queries that are currently using disk spill space. Apache Cloudberry creates work files on disk if it does not have sufficient memory to run the query in memory. This information can be used for troubleshooting and tuning queries. The information in the views can also be used to specify the values for the Apache Cloudberry configuration parameters `gp_workfile_limit_per_query` and `gp_workfile_limit_per_segment`.
+
+- [`gp_workfile_entries`](#gp_workfile_entries)
+- [`gp_workfile_usage_per_query`](#gp_workfile_usage_per_query)
+- [`gp_workfile_usage_per_segment`](#gp_workfile_usage_per_segment)
+
+### gp_workfile_entries
+
+This view contains one row for each operator using disk space for workfiles on a segment at the current time. The view is accessible to all users, however non-superusers only to see information for the databases that they have permission to access.
+
+The columns of the view are described as follows:
+
+| Column        | Type    | Description                                                            |
+|---------------|---------|------------------------------------------------------------------------|
+| `datname`     | name    | Database name.                                                         |
+| `pid`         | integer | Process ID of the server process.                                      |
+| `sess_id`     | integer | Session ID.                                                            |
+| `command_cnt` | integer | Command ID of the query.                                               |
+| `usename`     | name    | Role name.                                                             |
+| `query`       | text    | Current query that the process is running.                             |
+| `segid`       | integer | Segment ID.                                                            |
+| `slice`       | integer | The query plan slice. The portion of the query plan that is being run. |
+| `optype`      | text    | The query operator type that created the work file.                    |
+| `size`        | bigint  | The size of the work file in bytes.                                    |
+| `numfiles`    | integer | The number of files created.                                           |
+| `prefix`      | text    | Prefix used when naming a related set of workfiles.                    |
+
+### gp_workfile_usage_per_query
+
+This view contains one row for each query using disk space for workfiles on a segment at the current time. The view is accessible to all users, however non-superusers only to see information for the databases that they have permission to access.
+
+The columns of the view are described as follows:
+
+| Column        | Type    | Description                                |
+|---------------|---------|--------------------------------------------|
+| `datname`     | name    | Database name.                             |
+| `pid`         | integer | Process ID of the server process.          |
+| `sess_id`     | integer | Session ID.                                |
+| `command_cnt` | integer | Command ID of the query.                   |
+| `usename`     | name    | Role name.                                 |
+| `query`       | text    | Current query that the process is running. |
+| `segid`       | integer | Segment ID.                                |
+| `size`        | numeric | The size of the work file in bytes.        |
+| `numfiles`    | bigint  | The number of files created.               |
+
+### gp_workfile_usage_per_segment
+
+This view contains one row for each segment. Each row displays the total amount of disk space used for workfiles on the segment at the current time. The view is accessible to all users, however non-superusers only to see information for the databases that they have permission to access.
+
+The columns of the view are described as follows:
+
+| Column     | Type     | Description                                    |
+|------------|----------|------------------------------------------------|
+| `segid`    | smallint | Segment ID.                                    |
+| `size`     | numeric  | The total size of the work files on a segment. |
+| `numfiles` | bigint   | The number of files created.                   |
+
+## View users and groups (roles)
+
+It is frequently convenient to group users (roles) together to ease management of object privileges: that way, privileges can be granted to, or revoked from, a group as a whole. In Apache Cloudberry, this is done by creating a role that represents the group, and then granting membership in the group role to individual user roles.
+
+The `references/sys-catalog/gp-toolkit-schema:gp_roles_assigned` view can be used to see all of the roles in the system, and their assigned members (if the role is also a group role).
+
+### gp_roles_assigned
+
+This view shows all of the roles in the system, and their assigned members (if the role is also a group role). This view is accessible to all users.
+
+The columns of the view are described as follows:
+
+- `raroleid`: The role object ID. If this role has members (users), it is considered a *group* role.
+- `rarolename`: The role (user or group) name.
+- `ramemberid`: The role object ID of the role that is a member of this role.
+- `ramembername`: Name of the role that is a member of this role.
+
+## Check database object sizes and disk space
+
+The `gp_size_*` family of views can be used to determine the disk space usage for a distributed Apache Cloudberry database, schema, table, or index. The following views calculate the total size of an object across all primary segments (mirrors are not included in the size calculations).
+
+- [`gp_size_of_all_table_indexes`](#gp_size_of_all_table_indexes)
+- [`gp_size_of_database`](#gp_size_of_database)
+- [`gp_size_of_index`](#gp_size_of_index)
+- [`gp_size_of_schema_disk`](#gp_size_of_schema_disk)
+- [`gp_size_of_table_and_indexes_disk`](#gp_size_of_table_and_indexes_disk)
+- [`gp_size_of_table_and_indexes_licensing`](#gp_size_of_table_and_indexes_licensing)
+- [`gp_size_of_table_disk`](#gp_size_of_table_disk)
+- [`gp_size_of_table_uncompressed`](#gp_size_of_table_uncompressed)
+- [`gp_disk_free`](#gp_disk_free)
+
+The table and index sizing views list the relation by object ID (not by name). To check the size of a table or index by name, you must look up the relation name (`relname`) in the `pg_class` table. For example:
+
+```sql
+SELECT relname as name, sotdsize as size, sotdtoastsize as 
+toast, sotdadditionalsize as other 
+FROM gp_size_of_table_disk as sotd, pg_class 
+WHERE sotd.sotdoid=pg_class.oid ORDER BY relname;
+```
+
+### gp_size_of_all_table_indexes
+
+This view shows the total size of all indexes for a table. This view is accessible to all users, however non-superusers will only be able to see relations that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `soatioid`: The object ID of the table.
+- `soatisize`: The total size of all table indexes in bytes.
+- `soatischemaname`: The schema name.
+- `soatitablename`: The table name.
+
+### gp_size_of_database
+
+This view shows the total size of a database. This view is accessible to all users, however non-superusers will only be able to see databases that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `sodddatname`: The name of the database.
+- `sodddatsize`: The size of the database in bytes.
+
+### gp_size_of_index
+
+This view shows the total size of an index. This view is accessible to all users, however non-superusers will only be able to see relations that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `soioid`: The object ID of the index.
+- `soitableoid`: The object ID of the table to which the index belongs.
+- `soisize`: The size of the index in bytes.
+- `soiindexschemaname`: The name of the index schema.
+- `soiindexname`: The name of the index.
+- `soitableschemaname`: The name of the table schema.
+- `soitablename`: The name of the table.
+
+### gp_size_of_schema_disk
+
+This view shows schema sizes for the public schema and the user-created schemas in the current database. This view is accessible to all users, however non-superusers will be able to see only the schemas that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `sosdnsp`: The name of the schema.
+- `sosdschematablesize`: The total size of tables in the schema in bytes.
+- `sosdschemaidxsize`: The total size of indexes in the schema in bytes.
+
+### gp_size_of_table_and_indexes_disk
+
+This view shows the size on disk of tables and their indexes. This view is accessible to all users, however non-superusers will only be able to see relations that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `sotaidoid`: The object ID of the parent table.
+- `sotaidtablesize`: The disk size of the table.
+- `sotaididxsize`: The total size of all indexes on the table.
+- `sotaidschemaname`: The name of the schema.
+- `sotaidtablename`: The name of the table.
+
+### gp_size_of_table_and_indexes_licensing
+
+This view shows the total size of tables and their indexes for licensing purposes. The use of this view requires superuser permissions.
+
+The columns of the view are described as follows:
+
+- `sotailoid`: The object ID of the table.
+- `sotailtablesizedisk`: The total disk size of the table.
+- `sotailtablesizeuncompressed`: If the table is a compressed append-optimized table, shows the uncompressed table size in bytes.
+- `sotailindexessize`: The total size of all indexes in the table.
+- `sotailschemaname`: The schema name.
+- `sotailtablename`: The table name.
+
+### gp_size_of_table_disk
+
+This view shows the size of a table on disk. This view is accessible to all users, however non-superusers will only be able to see tables that they have permission to access. The columns of the view are described as follows:
+
+- `sotdoid`: The object ID of the table.
+- `sotdsize`: The size of the table in bytes. The size is only the main table size. The size does not include auxiliary objects such as oversized (toast) attributes, or additional storage objects for AO tables.
+- `sotdtoastsize`: The size of the TOAST table (oversized attribute storage), if there is one.
+- `sotdadditionalsize`: Reflects the segment and block directory table sizes for append-optimized (AO) tables.
+- `sotdschemaname`: The schema name.
+- `sotdtablename`: The table name.
+
+### gp_size_of_table_uncompressed
+
+This view shows the uncompressed table size for append-optimized (AO) tables. Otherwise, the table size on disk is shown. The use of this view requires superuser permissions. The columns of the view are described as follows:
+
+- `sotuoid`: The object ID of the table.
+- `sotusize`: The uncompressed size of the table in bytes if it is a compressed AO table. Otherwise, the table size on disk.
+- `sotuschemaname`: The schema name.
+- `sotutablename`: The table name.
+
+### gp_disk_free
+
+This external table runs the `df` (disk free) command on the active segment hosts and reports back the results. Inactive mirrors are not included in the calculation. The use of this external table requires superuser permissions. The columns of the view are described as follows:
+
+- `dfsegment`: The content id of the segment (only active segments are shown).
+- `dfhostname`: The hostname of the segment host.
+- `dfdevice`: The device name.
+- `dfspace`: Free disk space in the segment file system in kilobytes.
+
+## Check for missing and orphaned data files
+
+Apache Cloudberry considers a relation data file that is present in the catalog, but not on disk, to be missing. Conversely, when Apache Cloudberry encounters an unexpected data file on disk that is not referenced in any relation, it considers that file to be orphaned.
+
+Apache Cloudberry provides the following views to help identify if missing or orphaned files exist in the current database:
+
+- [`gp_move_orphaned_files()`](#gp_move_orphaned_files)
+- [`gp_check_orphaned_files`](#gp_check_orphaned_files)
+- [`gp_check_missing_files`](#gp_check_missing_files)
+
+Consider it a best practice to check for these conditions prior to expanding the cluster or before offline maintenance.
+
+By default, the views identified in this section are available to `PUBLIC`.
+
+### gp_check_orphaned_files
+
+The `gp_check_orphaned_files` view scans the default and user-defined tablespaces for orphaned data files. Apache Cloudberry considers normal data files, files with an underscore (`_`) in the name, and extended numbered files (files that contain a `.<N>` in the name) in this check. `gp_check_orphaned_files` gathers results from the Apache Cloudberry coordinator and all segments.
+
+The columns of the view are described as follows:
+
+- `gp_segment_id`: The database segment identifier.
+- `tablespace`: The identifier of the tablespace in which the orphaned file resides.
+- `filename`: The file name of the orphaned data file.
+- `filepath`: The file system path of the orphaned data file, relative to the data directory of the coordinator or segment.
+
+Caution
+
+Use this view as one of many data points to identify orphaned data files. Do not delete files based solely on results from querying this view.
+
+### gp_check_missing_files
+
+The `gp_check_missing_files` view scans heap and append-optimized, column-oriented tables for missing data files. Apache Cloudberry considers only normal data files (files that do not contain a `.` or an `_` in the name) in this check. `gp_check_missing_files` gathers results from the Apache Cloudberry coordinator and all segments.
+
+The columns of the view are described as follows:
+
+- `gp_segment_id`: The database segment identifier.
+- `tablespace`: The identifier of the tablespace in which the table resides.
+- `relname`: The name of the table that has a missing data file(s).
+- `filename`: The file name of the missing data file.
+
+### gp_check_missing_files_ext
+
+The `gp_check_missing_files_ext` view scans only append-optimized, column-oriented tables for missing extended data files. Apache Cloudberry considers both normal data files and extended numbered files (files that contain a `.<N>` in the name) in this check. Files that contain an `_` in the name are not considered. `gp_check_missing_files_ext` gathers results from the Apache Cloudberry database segments only.
+
+The columns of the view are described as follows:
+
+- `gp_segment_id`: The database segment identifier.
+- `tablespace`: The identifier of the tablespace in which the table resides.
+- `relname`: The name of the table that has a missing extended data file(s).
+- `filename`: The file name of the missing extended data file.
+
+## Move orphaned data files
+
+The `gp_move_orphaned_files()` user-defined function (UDF) moves orphaned files found by the [`gp_check_orphaned_files`](#gp_check_orphaned_files) view into a file system location that you specify.
+
+The function signature is: `gp_move_orphaned_files( <target_directory> TEXT )`.
+
+`<target_directory>` must exist on all segment hosts before you move the files, and the specified directory must be accessible by the `gpadmin` user. If you specify a relative path for `<target_directory>`, it is considered relative to the data directory of the coordinator or segment.
+
+Apache Cloudberry renames each moved data file to one that reflects the original location of the file in the data directory. The file name format differs depending on the tablespace in which the orphaned file resides:
+
+| Tablespace     | Renamed file format                                                               |
+|----------------|-----------------------------------------------------------------------------------|
+| `default`      | `seg<num>_base_<database-oid>_<relfilenode>`                                      |
+| `global`       | `seg<num>_global_<relfilenode>`                                                   |
+| `user-defined` | `seg<num>_pg_tblspc_<tablespace-oid>_<gpdb-version>_<database-oid>_<relfilenode>` |
+
+For example, if a file named `12345` in the default tablespace is orphaned on primary segment 2,
+
+```sql
+SELECT * FROM gp_move_orphaned_files('/home/gpadmin/orphaned');
+```
+
+moves and renames the file as follows:
+
+- original location: `<data_directory>/base/13700/12345`
+- new location and file name: `/home/gpadmin/orphaned/seg2_base_13700_12345`
+
+`gp_move_orphaned_files()` returns both the original and the new file system locations for each file that it moves, and also provides an indication of the success or failure of the move operation. For example:
+
+```sql
+SELECT * FROM gp_toolkit.gp_move_orphaned_files('/home/gpadmin/orphaned');
+ gp_segment_id | move_success |           oldpath          |         newpath
+---------------+--------------+----------------------------+-----------------------------------
+            -1 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg-1_base_13715_99999
+             1 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg1_base_13715_99999
+             2 | t            | /<data_dir>/base/13715/99999 | /home/gpadmin/orphaned/seg2_base_13715_99999
+(3 rows)
+```
+
+Once you move the files, you may choose to remove them or to back them up.
+
+## Check for uneven data distribution
+
+All tables in Apache Cloudberry are distributed, meaning their data is divided across all of the segments in the system. If the data is not distributed evenly, then query processing performance may decrease. The following views can help diagnose if a table has uneven data distribution:
+
+- [`gp_toolkit.gp_skew_coefficients`](#gp_skew_coefficients)
+- [`gp_toolkit.gp_skew_idle_fractions`](#gp_skew_idle_fractions)
+
+### gp_skew_coefficients
+
+This view shows data distribution skew by calculating the coefficient of variation (CV) for the data stored on each segment. This view is accessible to all users, however non-superusers will only be able to see tables that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `skcoid`: The object id of the table.
+- `skcnamespace`: The namespace where the table is defined.
+- `skcrelname`: The table name.
+- `skccoeff`: The coefficient of variation (CV) is calculated as the standard deviation divided by the average. It takes into account both the average and variability around the average of a data series. The lower the value, the better. Higher values indicate greater data skew.
+
+### gp_skew_idle_fractions
+
+This view shows data distribution skew by calculating the percentage of the system that is idle during a table scan, which is an indicator of processing data skew. This view is accessible to all users, however non-superusers will only be able to see tables that they have permission to access.
+
+The columns of the view are described as follows:
+
+- `sifoid`: The object id of the table.
+- `sifnamespace`: The namespace where the table is defined.
+- `sifrelname`: The table name.
+- `siffraction`: The percentage of the system that is idle during a table scan, which is an indicator of uneven data distribution or query processing skew. For example, a value of `0.1` indicates 10% skew, a value of `0.5` indicates 50% skew, and so on. Tables that have more than 10% skew should have their distribution policies evaluated.
+
+## Maintain partitions
+
+If your database employs partitions you will need to perform certain tasks regularly to help maintain those partitions. Apache Cloudberry includes a view and a number of user-defined functions to help with these tasks.
+
+### The gp_partitions view
+
+The `gp_partitions` view shows all leaf partitions in a database.
+
+This view provides backwards compatibility with the legacy `pg_partitions` view (available in earlier major versions of Apache Cloudberry). The columns of the view are described as follows:
+
+| Column                     | Type     | Description                                                                                                     |
+|----------------------------|----------|-----------------------------------------------------------------------------------------------------------------|
+| `schemaname`               | name     | The name of the schema the partitioned table is in.                                                             |
+| `tablename`                | name     | The name of the top-level parent table.                                                                         |
+| `partitionschemaname`      | name     | The schema of the partition table.                                                                              |
+| `partitiontablename`       | name     | The relation name of the partitioned table (this is the table name to use if accessing the partition directly). |
+| `parentpartitiontablename` | regclass | The relation name of the parent table one level up from this partition.                                         |
+| `partitiontype`            | text     | The type of partition (range or list).                                                                          |
+| `partitionlevel`           | integer  | The level of this partition in the hierarchy.                                                                   |
+| `partitionrank`            | integer  | For range partitions, the rank of the partition compared to other partitions of the same level.                 |
+| `partitionlistvalues`      | text     | For list partitions, the list value(s) associated with this partition.                                          |
+| `partitionrangestart`      | text     | For range partitions, the start value of this partition.                                                        |
+| `partitionrangeend`        | text     | For range partitions, the end value of this partition.                                                          |
+| `partitionisdefault`       | boolean  | T if this is a default partition, otherwise F.                                                                  |
+| `partitionboundary`        | text     | The entire partition specification for this partition.                                                          |
+| `parenttablespace`         | name     | The tablespace of the parent table one level up from this partition.                                            |
+| `partitiontablespace`      | name     | The tablespace of this partition.                                                                               |
+
+### User-defined functions for partition maintenance
+
+The following table summarizes the functions Apache Cloudberry provides to help you maintain partitions:
+
+| Function                                  | Return type | Description                                                                                                                                           |
+|-------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `pg_partition_rank(rp regclass)`          | integer     | For range partitions, returns the rank of the partition compared to other partitions of the same level. For other partition types, it returns `NULL`. |
+| `pg_partition_range_from(rp regclass)`    | text        | Returns the lower bound of a range partition.                                                                                                         |
+| `pg_partition_range_to(rp regclass)`      | text        | Returns the upper bound of a range partition.                                                                                                         |
+| `pg_partition_isdefault(rp regclass)`     | boolean     | Evaluates whether a given partition is a default partition.                                                                                           |
+| `pg_partition_lowest_child(rp regclass)`  | regclass    | Finds the lowest ranked child of given partition.                                                                                                     |
+| `pg_partition_highest_child(rp regclass)` | regclass    | Finds the highest ranked child of given partition.                                                                                                    |
diff --git a/versioned_sidebars/version-2.x-sidebars.json b/versioned_sidebars/version-2.x-sidebars.json
index db36834ee..925d84c8a 100644
--- a/versioned_sidebars/version-2.x-sidebars.json
+++ b/versioned_sidebars/version-2.x-sidebars.json
@@ -431,10 +431,14 @@
           ]
         },
 
-        {
-          "type": "category",
-          "label": "System Catalogs",
-          "items": [
+       {
+        "type": "category",
+        "label": "System Catalogs",
+        "items": [
+          {
+            "type": "category",
+            "label": "System Tables",
+            "items": [
               "sys-catalogs/sys-tables/gp-configuration-history",
               "sys-catalogs/sys-tables/gp-distribution-policy",
               "sys-catalogs/sys-tables/gp-fastsequence",
@@ -480,9 +484,12 @@
               "sys-catalogs/sys-tables/pg-type",
               "sys-catalogs/sys-tables/pg-type-encoding",
               "sys-catalogs/sys-tables/pg-user-mapping"
-          ]
-        }
-      ]
+            ]
+          },
+          "sys-catalogs/gp_toolkit"
+    ]
+       }
+     ]
     },
     {
       "type": "category",


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org