Most GQL queries are executed as real-time operations: results are returned to the client once execution is complete and are not stored on the server. A few long-running operations run as background tasks instead, returning a task_id immediately while the work continues on the server.
The system tracks both real-time queries and tasks, providing commands to list and cancel running queries and to monitor, stop, or delete tasks.
Lists all currently running queries across all connections. This command is never blocked by concurrency limits.
GQLSHOW QUERIES -- Equivalent TOP QUERIES -- Shorthand TOP
Returns a table with the following columns:
| Field | Description |
|---|---|
query_id | The unique identifier of the query (e.g., q1, q2). |
query_text | The query text, truncated to 100 characters. |
start_time | The time the query started executing. |
duration_ms | How long the query has been running, in milliseconds. |
status | Current state of the query: running or canceling. |
Cancels a running query by its ID. The query transitions to canceling status and stops at the next cancellation checkpoint.
GQLKILL QUERY 'q1'
Use SHOW QUERIES to find the query_id of the query you want to cancel.
Tasks are created only by the operations listed below; there is no way to submit an arbitrary query as a background task.
| Operation | Task type | When it becomes a task |
|---|---|---|
CALL algo.*.write() | algorithm | Always. Write-mode algorithms compute and write back in the background. |
CREATE GRAPH … AS COPY OF … | copy_graph | Always. The target graph stays in COPYING status until the copy finishes. |
COMPACT GRAPH … ASYNC | compact_graph | Only with the ASYNC keyword. Without it, compaction runs synchronously and blocks the session. |
List all tasks:
GQLSHOW TASKS
| Field | Description |
|---|---|
task_id | Unique task identifier (e.g., task_550e8400-...). |
type | Task type: algorithm, copy_graph, or compact_graph. |
query | The query or command that created the task. |
status | Current status: pending, running, completed, failed, or cancelled. |
started_at | When the task started executing. |
progress | Completion percentage (0–100). |
Show a specific task:
GQLSHOW TASK 'task_550e8400-e29b-41d4-a716-446655440000'
Cancel a running task:
GQLSTOP 'task_550e8400-e29b-41d4-a716-446655440000'
Remove a task from the registry and delete its result files:
GQLDELETE TASK 'task_550e8400-e29b-41d4-a716-446655440000'
| Setting | Default | Description |
|---|---|---|
| Query timeout | 30 seconds (driver) | The query timeout is set by the client driver (default 30 seconds). If the client sends no timeout, the server falls back to its -default-timeout flag (default 5 minutes). |
| Read concurrency slots | 16 | Maximum concurrent read queries (e.g., MATCH, aggregations). |
| Write concurrency slots | 4 | Maximum concurrent write queries (e.g., INSERT, DELETE, SET). |
When all slots are occupied, new queries block until a slot becomes available or the query context is cancelled. Management commands (SHOW QUERIES, KILL QUERY, EXPLAIN) bypass the concurrency limits and always respond immediately.