Skip to main content

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.

  1. Click a field name to display a condition input popup.

  2. Set the operator and value, then click the Apply button to add the condition to the top filter.

  3. 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 query field, only sessions executing SQL that includes that keyword are queried. When multiple conditions are applied, AND logic is used.

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_activity view. 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

ColumnDescriptionSupported Environment
timeTime when session information was collectedCommon
instanceDB instance nameCommon
pidBackend process IDPostgreSQL
datnameName of the connected databasePostgreSQL
usenameConnected user namePostgreSQL
client_addrClient IP addressPostgreSQL
client_hostnameClient host namePostgreSQL
client_portClient port numberPostgreSQL
application_nameClient application namePostgreSQL

Execution Information

ColumnDescriptionSupported Environment
stateCurrent session status (active, idle, idle in transaction, etc.)PostgreSQL
runtimeExecution time of the current query (seconds)PostgreSQL
xact_runtimeExecution time of the current transaction (seconds)PostgreSQL
wait_eventName of the currently waiting eventPostgreSQL
wait_event_typeType of the wait event (Lock, LWLock, IO, IPC, etc.)PostgreSQL 9.6 or later
state_changeTime when the status last changedPostgreSQL
querySQL statement being executedPostgreSQL
query_paramBind parameter values of the SQLCommon
query_hashSQL hash valueCommon

Time Information

ColumnDescriptionSupported Environment
xact_startStart time of the current transactionPostgreSQL
query_startStart time of the current queryPostgreSQL
backend_startStart time of the backend processPostgreSQL

Backend Information

ColumnDescriptionSupported Environment
backend_typeBackend process type (client backend, autovacuum worker, etc.)PostgreSQL 10 or later
backend_xidCurrent transaction ID of the backendPostgreSQL 9.4 or later
backend_xminxmin horizon of the backendPostgreSQL 9.4 or later
query_idQuery IDPostgreSQL 14 or later

Resource Usage

ColumnDescriptionSupported Environment
cpuusageCPU usageXOS
cputimeCPU usage timeXOS
rssResident Set Size (physical memory usage)XOS
pssProportional Set Size (proportional memory usage)XOS
vsizeVirtual memory sizeXOS
ioreadI/O read amountXOS
iowriteI/O write amountXOS

Data Interpretation Guide

Key Checkpoints

ColumnMeaningInterpretation
stateCurrent session statusactive: Executing SQL, idle in transaction: Idle within a transaction → May cause lock issues if maintained for a long time
runtimeExecution time of the current queryHigher values indicate long-running queries → Tuning target
xact_runtimeExecution time of the current transactionHigher values indicate long-held transactions → Possible cause of lock contention or vacuum delays
wait_eventCurrently waiting eventLock type: Lock contention occurring, IO type: Disk I/O bottleneck
cpuusageCPU usageHigh 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 state as idle in transaction and long xact_runtime: Transaction is open but idle → Causes lock waits for other sessions and vacuum delays

  • Multiple sessions with wait_event of Lock type: Lock contention on a specific table or row → Review transaction patterns

  • Sessions with wait_event_type as 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

  1. Check the interval where the session count spikes in the session trend chart

  2. Check state and wait_event in the session list for that time period

  3. Analyze whether the same query repeats or if requests are concentrated from a specific client_addr

  4. Use filters to classify sessions by state or wait_event_type

Scenario 2. Tracking Long-Running Sessions

  1. Add a runtime filter in the field panel to query long-running sessions

  2. Check the query of that session to identify which SQL has been running for a long time

  3. Check the wait_event to determine if the query is executing or waiting for a lock

  4. If necessary, check the execution plan (Plan) of that SQL

Scenario 3. Checking idle in transaction Sessions

  1. Add "idle in transaction" condition to the state filter in the field panel

  2. Check sessions with long xact_runtime to understand how long the transaction has been open

  3. Identify the source application using the session's application_name and client_addr

  4. Note that long-held transactions can cause lock waits for other sessions and vacuum delays

Scenario 4. Analyzing Lock Contention Causes

  1. Check the interval with a high proportion of red (lock wait) in the session trend chart

  2. Add "Lock" condition to the wait_event_type filter in the field panel

  3. Check the query and datname of waiting sessions to identify the contention target

  4. Check if sessions with long xact_runtime are holding locks

Additional Features

Using Filters

  1. Click the filter add button or click a field name in the field panel.

  2. Select a filter key.

    • String: = (contains), != (does not contain)

    • Number: == (equals), >= (greater than or equal to), <= (less than or equal to)

  3. Enter a value and apply.

  4. 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.