Session History
This screen allows you to view session information collected during the query period in chronological order. You can analyze which sessions executed which SQL at specific times, and what the status and resource usage of each session was.
-
Data is provided based on active session snapshots collected at 5-second intervals.
-
The Session Trend chart allows you to visually track changes in session count over time.
-
Use the field panel and filters to query only sessions that meet specific conditions.
Querying Session History
Set query conditions in the top filter, filter sessions using the field panel, then check session changes and status over time through the session trend chart and list.
Basic Options
You can set time, target instance, and filters in the top filter area.
-
Time: Select the query time range; set to 10-minute intervals by default, and you can move with left/right arrows
-
Instance: Select the DB instance to query
-
Filter: Add conditions per field to filter data; AND logic is applied for multiple conditions
-
View Mode: Switch between table view and tree view
-
Download: Export in CSV format
Field Panel
You can easily add filter conditions from the field panel on the left side of the screen.
-
Click a field name to display a condition input popup.
-
Set the operator and value, then click the Apply button to add the condition to the top filter.
-
You can search for field names using the search bar at the top. When a filter condition is applied, only sessions that meet the conditions are displayed in the chart and table.
- For example, if you set a specific keyword as a contain condition in the
queryfield, only sessions executing SQL that includes that keyword are queried. When multiple conditions are applied, AND logic is used.
- For example, if you set a specific keyword as a contain condition in the
Session Trend Chart
Displays the number of active sessions and lock wait sessions during the query period as a bar chart. The X-axis is time and the Y-axis is the number of sessions. You can query up to 1 hour at a time.
-
Among all active sessions, lock wait sessions are displayed in red.
-
You can visually identify the total number of active sessions and the proportion of lock wait sessions at specific time periods.
-
Drag the chart area to drill down into that interval for detailed analysis.
-
Click a specific time on the chart to display only the active sessions for that time period in the table below.
Session List Table
Displays collected session information in chronological order. You can navigate pages using the pagination at the bottom, and you can set the number of items displayed per page.
Column Guide
The supported environment for each column indicates the conditions under which data for that column can be queried.
-
PostgreSQL: Collected from the
pg_stat_activityview. The columns available may differ depending on the PostgreSQL version. -
XOS: Can only be queried when the XOS agent is additionally installed.
-
Common: Always available regardless of the DB version or agent installation status.
Basic Information
| Column | Description | Supported Environment |
|---|---|---|
time | Time when session information was collected | Common |
instance | DB instance name | Common |
pid | Backend process ID | PostgreSQL |
datname | Name of the connected database | PostgreSQL |
usename | Connected user name | PostgreSQL |
client_addr | Client IP address | PostgreSQL |
client_hostname | Client host name | PostgreSQL |
client_port | Client port number | PostgreSQL |
application_name | Client application name | PostgreSQL |
Execution Information
| Column | Description | Supported Environment |
|---|---|---|
state | Current session status (active, idle, idle in transaction, etc.) | PostgreSQL |
runtime | Execution time of the current query (seconds) | PostgreSQL |
xact_runtime | Execution time of the current transaction (seconds) | PostgreSQL |
wait_event | Name of the currently waiting event | PostgreSQL |
wait_event_type | Type of the wait event (Lock, LWLock, IO, IPC, etc.) | PostgreSQL 9.6 or later |
state_change | Time when the status last changed | PostgreSQL |
query | SQL statement being executed | PostgreSQL |
query_param | Bind parameter values of the SQL | Common |
query_hash | SQL hash value | Common |
Time Information
| Column | Description | Supported Environment |
|---|---|---|
xact_start | Start time of the current transaction | PostgreSQL |
query_start | Start time of the current query | PostgreSQL |
backend_start | Start time of the backend process | PostgreSQL |
Backend Information
| Column | Description | Supported Environment |
|---|---|---|
backend_type | Backend process type (client backend, autovacuum worker, etc.) | PostgreSQL 10 or later |
backend_xid | Current transaction ID of the backend | PostgreSQL 9.4 or later |
backend_xmin | xmin horizon of the backend | PostgreSQL 9.4 or later |
query_id | Query ID | PostgreSQL 14 or later |
Resource Usage
| Column | Description | Supported Environment |
|---|---|---|
cpuusage | CPU usage | XOS |
cputime | CPU usage time | XOS |
rss | Resident Set Size (physical memory usage) | XOS |
pss | Proportional Set Size (proportional memory usage) | XOS |
vsize | Virtual memory size | XOS |
ioread | I/O read amount | XOS |
iowrite | I/O write amount | XOS |
Data Interpretation Guide
Key Checkpoints
| Column | Meaning | Interpretation |
|---|---|---|
state | Current session status | active: Executing SQL, idle in transaction: Idle within a transaction → May cause lock issues if maintained for a long time |
runtime | Execution time of the current query | Higher values indicate long-running queries → Tuning target |
xact_runtime | Execution time of the current transaction | Higher values indicate long-held transactions → Possible cause of lock contention or vacuum delays |
wait_event | Currently waiting event | Lock type: Lock contention occurring, IO type: Disk I/O bottleneck |
cpuusage | CPU usage | High values indicate CPU-intensive query → Query optimization needed |
Identifying Abnormal Sessions
-
Sessions with abnormally high
runtime: Long-running queries → Review execution plan, index tuning -
Sessions with
stateas idle in transaction and longxact_runtime: Transaction is open but idle → Causes lock waits for other sessions and vacuum delays -
Multiple sessions with
wait_eventof Lock type: Lock contention on a specific table or row → Review transaction patterns -
Sessions with
wait_event_typeas IO: Disk I/O bottleneck → Query optimization, review memory settings such as shared_buffers
Practical Use Scenarios
Scenario 1. Analyzing a Sudden Session Spike at a Specific Time
-
Check the interval where the session count spikes in the session trend chart
-
Check
stateandwait_eventin the session list for that time period -
Analyze whether the same
queryrepeats or if requests are concentrated from a specificclient_addr -
Use filters to classify sessions by
stateorwait_event_type
Scenario 2. Tracking Long-Running Sessions
-
Add a
runtimefilter in the field panel to query long-running sessions -
Check the
queryof that session to identify which SQL has been running for a long time -
Check the
wait_eventto determine if the query is executing or waiting for a lock -
If necessary, check the execution plan (Plan) of that SQL
Scenario 3. Checking idle in transaction Sessions
-
Add "idle in transaction" condition to the
statefilter in the field panel -
Check sessions with long
xact_runtimeto understand how long the transaction has been open -
Identify the source application using the session's
application_nameandclient_addr -
Note that long-held transactions can cause lock waits for other sessions and vacuum delays
Scenario 4. Analyzing Lock Contention Causes
-
Check the interval with a high proportion of red (lock wait) in the session trend chart
-
Add "Lock" condition to the
wait_event_typefilter in the field panel -
Check the
queryanddatnameof waiting sessions to identify the contention target -
Check if sessions with long
xact_runtimeare holding locks
Additional Features
Using Filters
-
Click the filter add button or click a field name in the field panel.
-
Select a filter key.
-
String:
=(contains),!=(does not contain) -
Number:
==(equals),>=(greater than or equal to),<=(less than or equal to)
-
-
Enter a value and apply.
-
Apply AND logic for multiple conditions.
Table Column Settings
You can add/remove columns to display and change the order by dragging through the column selection feature in the table header.