CONNECTIONS System Table Description
Description
A pseudo table, generated to present information about all current connections to the NuoDB database. Only users with the SYSTEM.DBA privilege can view all connections for all users. Users that have not been granted the SYSTEM.DBA privilege will only see the connections for their user.
Client applications should never contain code that accesses SYSTEM pseudo tables as they are subject to, and furthermore likely to, change from release to release.
|
Fields
| Field Name | Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
SQLSTRING |
string |
The SQL statement being executed. If the connection is currently active, but no statement is executing, the |
||||||||
COUNT |
integer |
A number |
||||||||
RUNTIME |
bigint |
The duration of the statement execution specified in microseconds. |
||||||||
USER |
string |
The SQL user for the database connection. |
||||||||
SCHEMA |
string |
The current SQL schema for the database connection. |
||||||||
NUMPARAM |
integer |
The number of SQL parameters specified in the query. This is |
||||||||
PARAMS |
string |
Parameter string — A string representing the parameters specified in the query. The string representing each parameter is of the format:
Where:
Each parameter string is separated by a space. For example:
|
||||||||
CONNID |
bigint |
A connection identifier which is unique across all connections in the database. |
||||||||
OPEN |
integer |
The number of open statements created using this connection. |
||||||||
MEMUSAGE |
bigint |
An estimate of the current memory usage by this connection. |
||||||||
HANDLE |
integer |
An identifier, unique only to the specific connection, that represents the executing statement. |
||||||||
OPENRESULTS |
integer |
The number of open result sets for this connection. |
||||||||
NODEID |
bigint |
The identifier for the Transaction Engine (TE) to which the client is connected.
|
||||||||
STARTID |
bigint |
The identifier for the Transaction Engine (TE) to which the client is connected. See Start ID. |
||||||||
EXECID |
numeric |
A unique identifier generated for this SQL statement, specifically for use with the |
||||||||
TRANSID |
bigint |
The identifier for the transaction being run on the connection. This value can be used to query |
||||||||
TRANSRUNTIME |
bigint |
The duration of the current open transaction on the connection, specified in microseconds. |
||||||||
AUTOCOMMITFLAGS |
integer |
A bitwise mapping of the following values
|
||||||||
ISOLATIONLEVEL |
integer |
Specifies the transaction isolation level for the connection:
|
||||||||
CLIENTHOST |
string |
Specifies the IP address for the connecting client. The TE will supply this with information from the socket it uses for communicating with the client. |
||||||||
CLIENTPROCESSID |
string |
Specifies the process ID (pid) for the connecting client.
This may be set automatically by the C++, .NET, and Python drivers.
Otherwise, this must be given as the client connection property |
||||||||
CLIENTINFO |
string |
Specifies the client information for the connecting client. This must be given as the client connection property |
||||||||
ROLLBACKMODE |
string |
Either |
||||||||
EXECUTIONSTACK |
string |
The execution stack column details all nested calls in the procedure currently running. The current executing statement, at the top of the stack, is shown at the top of this column. |
||||||||
CREATED |
timestamp |
The date and time when this connection was established with NUODB. |
||||||||
LASTEXECUTED |
timestamp |
The date and time when this connection last executed SQL. |
||||||||
SQLENGINE |
string |
The SQL Engine and the optimizer used by the connection. |
||||||||
COORDINATORCONNID |
bigint |
If the connection belongs to a distributed query worker, this field represents the
connection identifier for the coordinator of the query.
The value is |
||||||||
COORDINATORNODEID |
integer |
If the connection belongs to a distributed query worker, this field represents the
identifier for the Transaction Engine (TE) where the query’s coordinator is running.
The value is
|
||||||||
COORDINATORSTARTID |
integer |
If the connection belongs to a distributed query worker, this field represents the
identifier for the Transaction Engine (TE) where the query’s coordinator is running.
The value is |
||||||||
COORDINATORHANDLE |
integer |
If the connection belongs to a distributed query worker, this field represents the
handle of the executing statement for the query’s coordinator.
The value is It is formatted as a JSON object, and the metrics contained in the JSON object are described by the |
Example
The following example shows two rows in SYSTEM.CONNECTIONS.
The second row represents the SELECT SQLSTRING,COUNT,RUNTIME,USER,SCHEMA,ISOLATIONLEVEL FROM system.connections query itself.
The first row represents a SQL statement executing on another client with two parameters in the query.
Use SET OUTPUT VERTICAL to display the columns in SYSTEM.CONNECTIONS vertically.
In the row for the first query, we see this is the first statement run on this connection, the query has been running 2016795 microseconds, the SQL user is DBA and the current schema is USER, the transaction isolation level is SERIALIZABLE.
SET OUTPUT VERTICAL;
SELECT SQLSTRING,COUNT,RUNTIME,USER,SCHEMA,ISOLATIONLEVEL FROM system.connections;
==================================== Row #1 ====================================
SQLSTRING: select * from hugetable where lastname like ? and id > ?;
COUNT: 1
RUNTIME: 2016795
USER: DBA
SCHEMA: USER
ISOLATIONLEVEL: 8
==================================== Row #2 ====================================
SQLSTRING: var x = 0; while (x < 10) execute immediate 'insert into employees.titles values (?), (?), (?);' using values 1, 2, x; x = x + 1; end_while;
COUNT: 2
RUNTIME: 9214554
USER: DBA
SCHEMA: USER
ISOLATIONLEVEL: 8
==================================== Row #3 ====================================
SQLSTRING: SELECT SQLSTRING,COUNT,RUNTIME,USER,SCHEMA,ISOLATIONLEVEL FROM system.connections;
COUNT: 4
RUNTIME: 159
USER: DBA
SCHEMA: USER
ISOLATIONLEVEL: 8