This page describes Calíope 1.8, the version I am building right now. 1.7 is on the App Store for the Mac, iPad, iPhone, Apple Watch, Apple TV and Apple Vision Pro. The changelog says which version each feature landed in.

Adds an “Open in Calíope” button to every topic. It only works with the app installed.

Process List

View active processes

List the server's active sessions.

Where it is: Workspace › Tools › Processes

Open Processes from the workspace navigation bar. The table shows all processes with columns: ID, User, Host, Database, Command, Time, State, and SQL.

The list refreshes on its own from the moment it opens, every as many seconds as Interval says, and the footer counts down to the next refresh. ⏸ pauses it, ▶ resumes it, and ↻ rereads it right away. Use the user filter to show only processes belonging to a specific user. In the table, click or tap a column header to sort by it. On iPhone each process is stacked on three lines, without columns.

The Processes / Locks picker in the toolbar switches to the view of who is blocking whom, with the server's deadlock history: the topic “Live locks and deadlock history” covers it.

SQL Server

With SQL Server the menu has no Kill Query and the bar does not offer to Terminate the running ones: there KILL closes the whole session, not just its query, so only the session can be ended. Without VIEW SERVER STATE the list can't be read in full: a banner above says so with the server's text, and only your own session shows below it.

ClickHouse

With ClickHouse each row is a running query, not a connection: the identifier is its query_id, and it brings the two columns Memory and Rows read of each query. Below the list, only if there is any, comes the section of unfinished mutations: for each queued UPDATE or DELETE, the table, its identifier, the command, the parts still to go and, if it fails, the reason; a queued change can fail without anyone seeing it, and here you see it. Its ⓧ button, Cancel mutation, asks for confirmation and sends KILL MUTATION; what was already rewritten stays. Without SELECT ON system.processes the list can't be read, and without SELECT ON system.mutations neither can the mutation queue: a banner says so, with the server's text, instead of leaving them empty.

Oracle

With Oracle each row is a user session from V$SESSION, and the identifier is SID,SERIAL#: the SID alone repeats when one session closes and another opens. State shows the wait in progress and, if there is one, which session is blocking it; SQL is the statement running or, for an idle session, the last one it sent. If V$SQL doesn’t hold a session’s statement —it happens to the waiting ALTER when the database has the supplemental logging that LogMiner or GoldenGate need—, it comes from the session’s open cursors (V$OPEN_CURSOR), cut to 60 characters; if it isn’t there either, the row says the server doesn’t publish it. Calíope’s own connection that reads the list carries the laptop icon. Seeing the list needs permission on V$SESSION (SELECT_CATALOG_ROLE): without it, a banner above the list says it couldn’t be read and quotes the server’s reason instead of showing it empty, and on the Dashboard Connections by user says the same. The Memory column is the PGA in use by each session's process (V$PROCESS.PGA_USED_MEM). There is no rows-read column: Oracle does not count them per session.

MySQLMariaDBAuroraTiDB

With the MySQL family the Calíope connection that reads the list carries the laptop icon and no bulk operation touches it. Where the server publishes them, the Memory and Rows read columns appear: MySQL fills them when each statement ends (with the sys schema installed), MariaDB while it runs, and TiDB only the memory. Without the PROCESS privilege the server only shows your account's sessions, without an error: a banner above says so, and the footer counts them as the ones visible to your account, not as the total. If the cost columns don't show because the account can't read sys, another banner says so with the server's text.

Keywords: processes, threads, processlist, SHOW PROCESSLIST, active

Kill a process

Terminate a specific server thread.

Where it is: Process list › context menu › Kill Connection / Kill Query

Open the context menu on a process in the list — right-click on macOS, press and hold on iPad — and select Kill Connection (terminates the entire connection) or Kill Query (cancels only the active query). Both actions show a confirmation before executing.

If the server refuses — usually because the thread belongs to another user and your account lacks the privilege — a bar under the list says so: “Thread #… was not terminated:” followed by the server's reason. It is announced, and it closes with its ✕. A thread that does die says nothing: it simply leaves the list.

SQL Server

With SQL Server the menu has only Kill Connection: KILL ends the whole session and rolls back its open transaction, and the client that was running the query gets the server's answer that the session is in the kill state. Calíope’s own connections —the one reading the list, marked this session, and the others in its pool, marked Calíope connection— are never offered for ending: cutting them would cut what the app is doing through them.

ClickHouse

With ClickHouse the menu only has Kill Query: each row is a query, there is no separate connection to close, and the query leaves the list when it ends.

Oracle

With Oracle, Kill Connection is ALTER SYSTEM KILL SESSION … IMMEDIATE: the session ends at once, its open transaction is rolled back and its client loses the connection (sqlplus reports ORA-03113). Kill Query is ALTER SYSTEM CANCEL SQL: the statement gets ORA-01013 and the session stays open. Both need the ALTER SYSTEM privilege: without it they are dimmed, and a bar below the list says so. Calíope’s own connection that reads the list is not offered for ending. If the session can't be cut at once —it is waiting in a long call— the server answers ORA-00031 and marks it to end as soon as it returns: it counts as ended, not as refused.

Apple Vision Pro: the context menu opens by looking at the row and pinching and holding.

With an environment tag that confirms writes, the terminate confirmation carries its name in the title and doesn’t ask twice; with a read-only one, the terminate buttons and menu don’t appear.

Keywords: kill, terminate, cancel, kill process, thread, Kill Connection, Kill Query

Kill idle or busy threads in bulk

Bulk-cancel threads that have been in a given state for more than N seconds.

Where it is: Process list › Idle > / Active > · Terminate

Next to Idle > and Active > in the toolbar, type a number of seconds and press that field's Terminate button. Idle closes every connection that has been waiting longer than that; Active cancels every query that has been running longer, and leaves its connection open. Before acting, Calíope says how many threads it found and asks you to confirm.

Afterwards the same bar under the list sums it up: how many of those found were terminated and, if the server refused any, how many and the reason for the first one — for example “3 of 5 terminated; 2 rejected: …”.

MySQLMariaDBAurora

The server's own threads — replication and the event scheduler — are never included.

PostgreSQL

The server's own processes — the checkpointer, the WAL writer, the autovacuum launcher — appear in the list but are never included.

SQL Server

With SQL Server there is only Idle >: KILL closes the whole session, so a running query cannot be cancelled on its own. The server's own sessions are not even listed, and Calíope’s own connections are never included.

ClickHouse

With ClickHouse there is only Active >, which cancels with KILL QUERY every query that has run for longer: there are no idle connections to close. On the Dashboard, Connections by user says nothing is running when there are no queries.

Oracle

With Oracle both are there: Idle > closes sessions with ALTER SYSTEM KILL SESSION and Active > cancels statements with ALTER SYSTEM CANCEL SQL, leaving the session open. Calíope’s own connection that reads the list is never included, and without the ALTER SYSTEM privilege both Terminate buttons are dimmed.

Keywords: idle, busy, bulk, kill bulk, sleep, threshold

Live locks and deadlock history

Who is blocking whom right now, ending the blocking session, and the deadlocks the server remembers.

Where it is: Workspace › Tools › Processes

In Processes, the picker in the toolbar switches between Processes and Locks (on iPhone it sits in the scrolling bar). When sessions are waiting for a lock, Locks carries their number in parentheses even while you are on the list: waits are read on every refresh, at the same interval.

Who is blocking whom
At the top is the session holding the lock, with the padlock, its user and host, its statement and how many sessions wait behind it. Below it, indented, each waiting session: how long it has waited, the kind of lock, the table or object, and the statement it is trying to run. A session that waits and also blocks others has its own below it, and if two sessions wait for each other the tree shows the cycle until the server breaks it. A wait over 30 s carries a mark and says so in words. Waits for which the server doesn't say who holds the lock go apart, under Not known who holds it.

There are two kinds of lock:

  • Row — one transaction wrote a row, or reserved it with FOR UPDATE, and another wants the same one.
  • Metadata — the structure of the table. This is the everyday case: an ALTER TABLE stuck behind an open transaction, which in turn leaves everything that arrives after it waiting behind it.

If your account lacks a permission to read the waits or the history, the view says which one and on which version, instead of saying that nobody is waiting.

Ending the blocking session
The red ✕ on its row is Kill Connection, with the same confirmation as in the list. It ends the whole session and the server rolls back its open transaction: whatever it had written without committing is lost, and the waiting sessions carry on. It isn't offered for Calíope's own connections; it shows dimmed, with the reason, if your account lacks the privilege to end other users' sessions; and with a read-only environment tag it doesn't appear.

Deadlock history
Below the tree, each deadlock with its time and how many sessions took part. Tap it to expand it: each session, or transaction, with its statement and, if the server says, the object it held; the one the server rolled back is marked as the victim. Copy the report copies it as text. The history is read when the tool opens, and then on every refresh while Locks is showing.

MySQLMariaDBAurora

The server only remembers the last deadlock, in the InnoDB status (SHOW ENGINE INNODB STATUS, which needs the PROCESS privilege). Calíope records on this device each new one it sees while the Processes list or a lock-wait rule in SQL Alerts is watching: the hundred most recent from the last ninety days, per connection. They don't travel to your other devices, they are deleted with the connection and with “Delete My Data”, and Clear this device’s history empties them for that connection without touching the server.

Row waits come from performance_schema.data_lock_waits in MySQL and from information_schema.INNODB_LOCK_WAITS in MariaDB. Metadata waits, in MySQL, come from performance_schema.metadata_locks, with who holds them. In MariaDB they come from the process list (“Waiting for table metadata lock”), and knowing who holds the lock takes the metadata_lock_info plugin (INSTALL SONAME 'metadata_lock_info'): without it, the wait goes under Not known who holds it with that reason.

TiDB

The history is the one in INFORMATION_SCHEMA.DEADLOCKS on the node you are connected to, which keeps ten by default (pessimistic-txn.deadlock-history-capacity). TiDB records it by transaction: the session only shows while its transaction is still alive, and the statement is normalized, with ? in place of the values. Metadata waits come from mysql.tidb_mdl_view, which needs, besides PROCESS, SELECT on that view, mysql.tidb_ddl_job and mysql.tidb_mdl_info: without them, a strip above the tree says it couldn't be read, and only row waits show.

PostgreSQL

Waits come from pg_blocking_pids() and pg_locks: a wait for a row shows as Row, and an ALTER TABLE behind an open transaction as Metadata. Without pg_read_all_stats, the statement of a session from another account shows as <insufficient privilege>. There is no history: PostgreSQL writes deadlocks only to its log, which Calíope doesn't read, and the section says so.

SQL Server

Waits come from sys.dm_exec_requests and sys.dm_tran_locks; the history, from the system_health event session, which is running out of the box: the fifty most recent, read from memory and from the file, because the file takes up to two minutes to receive a new one. Both need VIEW SERVER STATE. Here a SELECT doesn't leave an ALTER TABLE stuck: what makes it wait (LCK_M_SCH_M) is a transaction that wrote to the table.

Oracle

Waits come from V$SESSION (BLOCKING_SESSION), and each session is named SID,SERIAL#. A DDL that waits shows as Metadata, because what is waiting is a DDL statement. The history is the ORA-00060 entries in the alert log (V$DIAG_ALERT_EXT, the fifty most recent), with the sessions and their statements read from the trace file: the victim is the session whose statement got the error, which is the one that was waiting first, not the one that closed the cycle. Oracle doesn't say the object. Without permission on the alert log, the section says so; without permission on the trace, or with the trace already deleted, each deadlock shows with its time and the name of its trace.

ClickHouse

ClickHouse has no row locks, so there is no Locks view and no history: what waits here are mutations, which show below the list.

To be alerted, the Lock wait rule in SQL Alerts fires when a session has been waiting longer than the threshold you set.

In the DBA Handbook, how locks form in each engine and how to avoid them: “Locks and deadlocks”, “Locks and deadlocks (PostgreSQL)”, “Locks and deadlocks (SQL Server)” and “Deadlocks (Oracle)”.

Keywords: lock, locks, deadlock, wait, lock wait, blocking, who blocks, metadata, stuck ALTER, victim, kill