UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Introduction
  • GQL vs Other Languages
    • Overview
    • Node and Edge Patterns
    • Path Patterns
    • Quantified Paths
    • Questioned Paths
    • Shortest Paths
    • Cheapest Paths
    • K-Hop Traversal
    • Graph Patterns
    • Overview
    • Open Graphs
    • Closed Graphs
    • Graph Types
    • Constraints
    • Projections
    • Storage Maintenance
    • Node and Edge IDs
    • INSERT
    • INSERT OVERWRITE
    • UPSERT
    • MERGE
    • SET
    • REMOVE
    • DELETE
    • FOREACH
    • LOAD CSV
    • Query Composition
    • Result Table and Visualization
    • MATCH
    • OPTIONAL MATCH
    • FILTER
    • LET
    • FOR
    • ORDER BY
    • LIMIT
    • SKIP
    • CALL
    • RETURN
    • Composite Query
    • NEXT
    • All Functions
    • Element Functions
    • Path Functions
    • Aggregate Functions
    • Mathematical Functions
    • Trigonometric Functions
    • String Functions
    • List Functions
    • Datetime Functions
    • Spatial Functions
    • Null Functions
    • Utility Functions
    • Type Conversion Functions
    • Table Functions
  • Operators
  • Predicates
    • Overview
    • CASE
    • LET Value Expression
    • Value Query Expression
    • Count Query Expression
    • List Expressions
    • Current Values
    • Index
    • Full-text Index
    • Vector Index
  • Transactions
  • Triggers
  • Query Management
  • Execution Plan
    • Variables
    • Values and Types
    • Comments
    • Reserved Words
    • Naming Conventions
    • Syntactic Notation
  • GQL Conformance
  1. Docs
  2. /
  3. ISO GQL

Query Management

Overview

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.

Real-time Queries

Showing Queries

Lists all currently running queries across all connections. This command is never blocked by concurrency limits.

GQL
SHOW QUERIES

-- Equivalent
TOP QUERIES

-- Shorthand
TOP

Returns a table with the following columns:

FieldDescription
query_idThe unique identifier of the query (e.g., q1, q2).
query_textThe query text, truncated to 100 characters.
start_timeThe time the query started executing.
duration_msHow long the query has been running, in milliseconds.
statusCurrent state of the query: running or canceling.

Killing Queries

Cancels a running query by its ID. The query transitions to canceling status and stops at the next cancellation checkpoint.

GQL
KILL QUERY 'q1'

Use SHOW QUERIES to find the query_id of the query you want to cancel.

Background Tasks

Tasks are created only by the operations listed below; there is no way to submit an arbitrary query as a background task.

OperationTask typeWhen it becomes a task
CALL algo.*.write()algorithmAlways. Write-mode algorithms compute and write back in the background.
CREATE GRAPH … AS COPY OF …copy_graphAlways. The target graph stays in COPYING status until the copy finishes.
COMPACT GRAPH … ASYNCcompact_graphOnly with the ASYNC keyword. Without it, compaction runs synchronously and blocks the session.

Showing Tasks

List all tasks:

GQL
SHOW TASKS
FieldDescription
task_idUnique task identifier (e.g., task_550e8400-...).
typeTask type: algorithm, copy_graph, or compact_graph.
queryThe query or command that created the task.
statusCurrent status: pending, running, completed, failed, or cancelled.
started_atWhen the task started executing.
progressCompletion percentage (0–100).

Show a specific task:

GQL
SHOW TASK 'task_550e8400-e29b-41d4-a716-446655440000'

Stopping a Task

Cancel a running task:

GQL
STOP 'task_550e8400-e29b-41d4-a716-446655440000'

Deleting a Task

Remove a task from the registry and delete its result files:

GQL
DELETE TASK 'task_550e8400-e29b-41d4-a716-446655440000'

Query Defaults

SettingDefaultDescription
Query timeout30 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 slots16Maximum concurrent read queries (e.g., MATCH, aggregations).
Write concurrency slots4Maximum 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.