Help Center > > Developer Guide> System Catalogs and System Views> System Views> PGXC_SQL_COUNT


Updated at: Jul 15, 2020 GMT+08:00

PGXC_SQL_COUNT displays the node-level and user-level statistical results for the SQL statements of SELECT, INSERT, UPDATE, DELETE, and MERGE INTO and DDL, DML, and DCL statements in real time, identifies query types with heavy load, and measures the capability of a cluster or a node to perform a specific type of query. For example, you can calculate QPS and collect statistics on the response time based on the quantities of the several types of SQL statements at certain time points. For example, if the SELECT count of USER1 at T1 is X1, and that at T2 is X2, the QPS of SELECT for USER1 is (X2X1)\(T2T1). In this way, the system can draw cluster-user-level QPS curve graphs and determine cluster throughput, tracing changes in the service load of each user. If there are drastic changes, the system can locate the specific statement type (such as SELECT, INSERT, UPDATE, DELETE, and MERGE INTO). You can also observe QPS curves to determine the time points when problems occur and then locate the problems using other tools. The curves provide a basis for optimizing cluster performance and locating problems.

Columns in the PGXC_SQL_COUNT view are the same as those in the GS_SQL_COUNT view. For details, see Table 1.

If a MERGE INTO statement can be pushed down and a DN receives it, the statement will be counted on the DN and the value of the mergeinto_count column will increment by 1. If the pushdown is not allowed, the DN will receive an UPDATE or INSERT statement. In this case, the update_count or insert_count column will increment by 1.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?

Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel