CURRENT_SESSION

Returns information about the current active session.

Returns information about the current active session. Use this table to find out the current session's sessionID and get the duration of the previously-run query.

Column Name Data Type Description
NODE_NAME VARCHAR Name of the node for which information is listed
USER_NAME VARCHAR Name used to log into the database, NULL if the session is internal
CLIENT_HOSTNAME VARCHAR Host name and port of the TCP socket from which the client connection was made, NULL if the session is internal
TYPE INTEGER

Identifies the session type, one of the following integer values:

1 Client 8 Shutdown
2 DBD 9 License audit
3 Merge out 10 Timer service
4 Move out 11 Connection
5 Rebalance cluster 12 VSpread
6 Recovery 13 Sub-session
7 Refresh 14 Repartition table
CLIENT_PID INTEGER Process identifier of the client process that issued this connection. This process might be on a different machine than the server.
LOGIN_TIMESTAMP TIMESTAMP When the user logged into the database or the internal session was created. This column can help identify open sessions that are idle.
SESSION_ID VARCHAR Identifier required to close or interrupt a session. This identifier is unique within the cluster at any point in time, but can be reused when the session closes.
CLIENT_LABEL VARCHAR User-specified label for the client connection that can be set when using ODBC. See Label in Data source name (DSN) connection properties.
TRANSACTION_START TIMESTAMP When the current transaction started, NULL if no transaction is running
TRANSACTION_ID VARCHAR Hexadecimal identifier of the current transaction, NULL if no transaction is in progress
TRANSACTION_DESCRIPTION VARCHAR Description of the current transaction
STATEMENT_START TIMESTAMP When the current statement started execution, NULL if no statement is running
STATEMENT_ID VARCHAR Unique numeric ID for the currently-running statement, NULL if no statement is being processed. Combined, TRANSACTION_ID and STATEMENT_ID uniquely identify a statement within a session.
LAST_STATEMENT_DURATION_US INTEGER Duration in microseconds of the last completed statement
CURRENT_STATEMENT VARCHAR The currently-running statement, if any. NULL indicates that no statement is currently being processed.
LAST_STATEMENT VARCHAR NULL if the user has just logged in, otherwise the currently running statement or most recently completed statement.
EXECUTION_ENGINE_PROFILING_CONFIGURATION VARCHAR See Profiling Settings below.
QUERY_PROFILING_CONFIGURATION VARCHAR See Profiling Settings below.
SESSION_PROFILING_CONFIGURATION VARCHAR See Profiling Settings below.
CLIENT_TYPE VARCHAR

Type of client from which the connection was made, one of the following:

  • ADO.NET Driver

  • ODBC Driver

  • JDBC Driver

  • vsql

CLIENT_VERSION VARCHAR Client version
CLIENT_OS VARCHAR Client operating system
CLIENT_OS_USER_NAME VARCHAR Identifies the user that logged into the database, also set for unsuccessful login attempts.
REQUESTED_PROTOCOL VARCHAR Communication protocol version that the ODBC client driver sends to Vertica server, used to support backward compatibility with earlier server versions.
EFFECTIVE_PROTOCOL VARCHAR Minimum protocol version supported by client and driver.

Profiling settings

The following columns show settings for different profiling categories:

  • EXECUTION_ENGINE_PROFILING_CONFIGURATION

  • QUERY_PROFILING_CONFIGURATION

  • SESSION_PROFILING_CONFIGURATION

These are set to one of the following:

Empty No profiling is set
Session On for current session
Global On by default for all sessions
Session, Global On by default for all sessions, including current session.

For information about controlling profiling settings, see Enabling profiling.