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
    • Graphs with Edge ID
    • Graph Types
    • Constraints
    • Projections
    • Storage Maintenance
    • Unique Identifiers
    • INSERT
    • INSERT OVERWRITE
    • UPSERT
    • MERGE
    • SET
    • REMOVE
    • DELETE
    • FOREACH
    • 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
    • Database Functions
  • Operators
  • Predicates
    • CASE
    • LET Value Expression
    • Value Query Expression
    • List Expressions
    • Index
    • Full-text Index
    • Vector Index
  • Transactions
  • Triggers
  • Query Management
  • Execution Plan
  • Backup and Restore
    • Variables
    • Values and Types
    • Comments
    • Reserved Words
    • Naming Conventions
    • Syntactic Notation
  • GQL Conformance
  1. Docs
  2. /
  3. ISO GQL
  4. /
  5. Graph Management

Storage Maintenance

This page covers administrative statements that operate on the underlying storage and optimizer state of a graph: recomputing statistics, forcing a flush to durable storage, and triggering a manual compaction of the storage layer.

ANALYZE

ANALYZE recomputes label and property statistics that the cost-based optimizer uses to estimate row counts and choose plans. Run it after large bulk imports or significant data churn so the planner picks up the new distribution.

GQL
ANALYZE

Limit ANALYZE to a specific node label or edge type:

GQL
ANALYZE (:Person)
ANALYZE EDGE [:Knows]

Nodes use parentheses (like a node pattern); edges use the EDGE keyword followed by brackets (like an edge pattern).

COMPACT GRAPH

COMPACT triggers a manual compaction of the storage, consolidating data files and reclaiming space from deleted records. Routine compaction runs automatically in the background; the explicit form is useful before a backup, after a large DELETE batch, or when investigating disk usage.

GQL
-- Compact the current graph
COMPACT

-- Compact a named graph
COMPACT GRAPH myGraph

-- Short form
COMPACT myGraph

Compaction runs in the background; the statement returns when the work has been scheduled.