Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex MPP Analytics for PostgreSQL
  • Getting started
    • All guides
      • Role and user management
      • Managing resource groups
      • User authentication rules
      • Using the command center
      • Managing client processes and user sessions
    • Connecting to an external file server (gpfdist)
    • Auxiliary utilities
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Getting a list of processes
  • Load management
  • Canceling a user session
  • Terminating a process
  • Closing a database connection
  • Terminating all user sessions
  1. Step-by-step guides
  2. Users and sessions
  3. Managing client processes and user sessions

Managing client processes and user sessions

Written by
Yandex Cloud
Updated at June 23, 2026
  • Getting a list of processes
  • Load management
  • Canceling a user session
    • Terminating a process
    • Closing a database connection
    • Terminating all user sessions

Yandex MPP Analytics for PostgreSQL launches a new internal process for each client connection. An administrator or any other user with the mdb_admin role can do the following:

  • Get a list of processes.
  • Manage load.
  • Cancel a user session.

Getting a list of processesGetting a list of processes

Requests for lists of processes are different for Greenplum® and Apache Cloudberry™. Greenplum® uses the waiting field, while Apache Cloudberry™, the wait_event_type and wait_event fields.

Learn more about available database management systems in Yandex MPP Analytics for PostgreSQL.

Greenplum®
Apache Cloudberry™

To get a list of processes, including user requests, call the mdb_toolkit.pg_stat_activity() function:

SELECT usename, pid, waiting, state, query, datname
FROM mdb_toolkit.pg_stat_activity();

Result:

 usename |  pid     | waiting | state  |         query          | datname
---------+----------+---------+--------+------------------------+---------
  sammy  |   31861  |    f    | idle   | SELECT * FROM testtbl; | testdb
  billy  |   31905  |    t    | active | SELECT * FROM topten;  | testdb

Where:

  • usename: Username.

  • pid: Process ID.

  • waiting: Process is awaiting a transaction:

    • t: Yes.
    • f: No.
  • state: Process state:

    • active: Running.
    • idle: Idle.
  • query: Query.

  • datname: Database name.

To get a list of processes, including user requests, call the mdb_toolkit.pg_stat_activity() function:

SELECT usename, pid, wait_event_type, wait_event, state, query, datname
FROM mdb_toolkit.pg_stat_activity();

Result:

 usename |    pid   | wait_event_type | wait_event | state  |             query              | datname
---------+----------+-----------------+------------+--------+--------------------------------+---------
  user1  |  1798921 |     Timeout     |  PgSleep   | active | SELECT pg_sleep(25);           |  mydb
  user2  |  1798938 |     Lock        |  advisory  | active | SELECT pg_advisory_lock(1234); |  mydb

Where:

  • usename: Username.

  • pid: Process ID.

  • wait_event_type: Event type awaited by the backend. If NULL, the backend is not awaiting any event.

  • wait_event: Event name awaited by the backend. If NULL, the backend is not awaiting any event.

  • state: Process state:

    • active: Running.
    • idle: Idle.
  • query: Query.

  • datname: Database name.

For more information about the pg_stat_activity view fields, see this Apache Cloudberry™ guide.

Load managementLoad management

  1. Run a query to the gp_toolkit.gp_resgroup_config file to get the resource group name and find out the current number of concurrent transactions:

    SELECT groupname, concurrency
    FROM gp_toolkit.gp_resgroup_config;
    
  2. Set the number of concurrent transactions for a resource group:

    ALTER RESOURCE GROUP <resource_group_name>
    SET concurrency <number_of_concurrent_transactions>;
    

Canceling a user sessionCanceling a user session

You can terminate a user session using one of the following methods:

  1. Terminate the process containing the session.
  2. Close the database connection.
  3. Terminate all user sessions.

Terminating a processTerminating a process

Call the mdb_toolkit.gp_cancel_backend() function:

SELECT *
FROM mdb_toolkit.gp_cancel_backend(<process_ID>);

You can get the process ID with the list of cluster processes.

Closing a database connectionClosing a database connection

Call the mdb_toolkit.gp_terminate_backend() function:

SELECT *
FROM mdb_toolkit.gp_terminate_backend(<process_ID>);

You can get the process ID with the list of cluster processes.

Terminating all user sessionsTerminating all user sessions

To terminate all user sessions in the cluster, call the mdb_toolkit.terminate_all_user_backends() function:

SELECT *
FROM mdb_toolkit.terminate_all_user_backends();

Greenplum® and Greenplum Database® are registered trademarks or trademarks of Broadcom Inc. in the United States and/or other countries.

Apache® and Apache Cloudberry™ are registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.

Was the article helpful?

Previous
Using the command center
Next
Overview
© 2026 Direct Cursus Technology L.L.C.