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
    • Graph Patterns
    • Overview
    • Open Graph
    • Closed Graph
    • Constraints
    • Unique Identifiers
    • INSERT
    • INSERT OVERWRITE
    • SET
    • REMOVE
    • DELETE
    • 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
    • AI & Vector Functions
    • Database Functions
  • Operators
  • Predicates
    • CASE
    • LET Value Expression
    • Value Query Expression
    • List Comprehension
    • Index
    • Full-text Index
    • Vector Index
  • Transactions
  • Triggers
  • Query Management
  • Backup and Restore
    • Variables
    • Values and Types
    • Comments
    • Reserved Words
    • Syntactic Notation
  • GQL Conformance
  1. Docs
  2. /
  3. ISO GQL

Query Management

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. The system tracks all running queries and provides commands to list and cancel them.

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.

Explaining Queries

Shows the execution plan for a query without running it. Returns a QUERY PLAN column with the estimated cost, rows, and operations.

GQL
EXPLAIN MATCH (n)-[]->(m) RETURN n, m

Result:

QUERY PLAN
Execution Plan:
  Estimated Cost: 7
  Estimated Rows: 7

Operations:
  1. MATCH (1 patterns) [cost: 1000]
  2. RETURN (2 items) [cost: 100]

Output format can be specified with EXPLAIN (FORMAT <format>):

GQL
-- Tree format with hierarchical visualization
EXPLAIN (FORMAT TREE) MATCH (n)-[]->(m) RETURN n, m

-- JSON format with structured plan data
EXPLAIN (FORMAT JSON) MATCH (n)-[]->(m) RETURN n, m

EXPLAIN ANALYZE executes the query and returns actual execution metrics alongside the plan:

GQL
EXPLAIN ANALYZE MATCH (n)-[]->(m) RETURN n, m

EXPLAIN OPTIMIZER shows which optimizer rules were applied to the query:

GQL
EXPLAIN OPTIMIZER MATCH (n)-[]->(m) RETURN n, m

Background Tasks

Certain operations run as background tasks, such as algorithm execution. Tasks are tracked by the server and can be monitored, stopped, or deleted.

Showing Tasks

List all tasks:

GQL
SHOW TASKS
FieldDescription
task_idUnique task identifier (e.g., task_550e8400-...).
typeTask type: algorithm, import, or export.
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.