UltipaDocs
Try Playground
  • Introduction
  • Terminologies
    • Reserved Words
    • Data Types
    • Alias
    • Operators
    • Expression
    • Filter
    • Prefix
    • Node and Edge Templates
    • Homologous and Heterologous Data
    • Clause Execution Times
    • Graphset
    • Schema
    • Property
    • Insert
    • Overwrite
    • Upsert
    • Update
    • Delete
    • Find Nodes
    • Find Edges
      • AB
      • Autonet
      • Spread
      • Path Template
      • K-Hop
      • K-Hop Template
    • Find Subgraphs
    • GROUP BY
    • ORDER BY
    • SKIP
    • LIMIT
    • WHERE
    • RETURN
    • WITH
    • UNCOLLECT
    • UNION
    • UNION ALL
    • CALL
    • BATCH
      • Schema Checker
      • Equal
      • Not Equal
      • Less Than
      • Greater Than
      • Less Than or Equal
      • Greater Than or Equal
      • Between
      • Between or Equal
      • Beong to
      • Not Belong To
      • CONTAINS | String
      • CONTAINS | Full-Text
      • Regular Match
      • IS NULL
      • IS NOT NULL
      • And
      • Or
      • Not
      • Exclusive OR
      • DISTINCT
      • toString()
      • toInteger()
      • toFloat()
      • toDouble()
      • toDecimal()
      • toSet()
      • castToRaw()
      • now()
      • dateAdd()
      • dateDiff()
      • year()
      • month()
      • day()
      • dayOfWeek()
      • dateFormat()
      • point()
      • distance()
      • pointInPolygon()
      • lower()
      • upper()
      • reverse()
      • startsWith()
      • endsWith()
      • JSON_decode()
      • JSON_merge()
      • trim()
      • ltrim()
      • rtrim()
      • left()
      • right()
      • substring()
      • replace()
      • split()
      • intersection()
      • difference()
      • listUnion()
      • size()
      • head()
      • reduce()
      • listContains()
      • append()
      • pi()
      • pow()
      • sqrt()
      • abs()
      • floor()
      • ceil()
      • round()
      • sin()
      • cos()
      • tan()
      • cot()
      • asin()
      • acos()
      • atan()
      • length()
      • pnodes()
      • pedges()
      • count()
      • sum()
      • max()
      • min()
      • avg()
      • stddev()
      • collect()
      • dedup()
      • CASE
      • table()
      • coalesce()
      • ifnull()
    • Acceleration
    • Index
    • Full-text
    • LTE
    • Real-time Process
    • Backend Task
    • Analytics Node
    • Server Statistics
    • Server Backup
    • Privilege
    • Policy
    • User
  • Trigger
  1. Docs
  2. /
  3. UQL
  4. /
  5. Index | Full-text | LTE

Index

Index is the short form of property index. An index has the same name and schema with the property it references.

Show Index

Returned table name: _nodeIndex, _edgeIndex
Returned table header: name | properties | schema | status | size (Name, properties, schema, status [creating|done] and byte length of index)

Syntax:

Syntax
// To show all indexes in the current graphset (node indexes and edges indexes in separate tables)
show().index() 

// To show all node indexes in the current graphset
show().node_index()

// To show all edge indexes in the current graphset
show().edge_index()
NOTE

You may need to compact the graph in order to see the right size of the index.

Create Index

System properties UID, FROM and TO and custom properties of decimal type do not support index.

Syntax:

Syntax
// To create index for a certain property of a certain node schema in the current graphset
create().node_index(@<schema>.<property>)

// To create index for a certain property of all node schemas (if has) in the current graphset
create().node_index(@*.<property>)

// To create index for a certain property of a certain edge schema in the current graphset
create().edge_index(@<schema>.<property>)

// To create index for a certain property of all edge schemas (if has) in the current graphset
create().edge_index(@*.<property>)

// To create index for multiple node/edge properties using the four methods above
create()
  .node_index(@<schema>.<property>)
  .node_index(@*.<property>)
  .edge_index(@<schema>.<property>)
  .edge_index(@*.<property>)
  ...

Example: Create index for @card property balance

UQL
create().node_index(@card.balance)

Example: Create index for @transaction property amount

UQL
create().edge_index(@transaction.amount)

Drop Index

Deleting a property will also delete its index.

Syntax:

Syntax
// To delete index for a certain property of a certain node schema from the current graphset
drop().node_index(@<schema>.<property>)

// To delete index for a certain property of all node schemas (if has) from the current graphset
drop().node_index(@*, <property>)

// To delete index for a certain property of a certain edge schema from the current graphset
drop().edge_index(@<schema>.<property>)

// To delete index for a certain property of all edge schemas (if has) from the current graphset
drop().edge_index(@*, <property>)

// To delete index for multiple node/edge properties using the four methods above
drop()
  .node_index(@<schema>.<property>)
  .node_index(@*, <property>)
  .edge_index(@<schema>.<property>)
  .edge_index(@*, <property>)
  ...

Example: Delete the index for @card property balance

UQL
drop().node_index(@card.balance)

Example: Delete the index for @transaction property amount

UQL
drop().edge_index(@transaction.amount)