Schema and maintenance procedures
On this page
Schema / token procedures
| Procedure | YIELD | Description |
|---|---|---|
db.labels() | label | All known node labels |
db.relationshipTypes() | relationshipType | All known relationship types |
db.propertyKeys() | propertyKey | All known property keys |
db.indexes() | name, type, entityType, labelsOrTypes, properties | Legacy Browser catalogue: single-property hash (reported as RANGE), full-text, vector and point declarations; use SHOW INDEXES plus specialised SHOW statements for complete coverage |
db.constraints() | name, description | Single-property uniqueness constraints; use SHOW CONSTRAINTS for every constraint kind |
db.awaitIndexes([timeout]) | (void) | No-op that yields nothing. GDB builds indexes synchronously, so they are online the moment CREATE INDEX/CREATE CONSTRAINT returns — there is never anything to await. Exists so an apoc.export.cypher.all script (which emits CALL db.awaitIndexes(300) after its schema block) restores unchanged. |
db.awaitIndex(name[, timeout]) | (void) | Single-index variant of the above; likewise a no-op. |
CALL db.indexes() YIELD name, type, labelsOrTypes, properties
RETURN name, type, labelsOrTypes, properties;
CALL db.propertyKeys() YIELD propertyKey RETURN propertyKey ORDER BY propertyKey;
Note: GDB lists known tokens; a label/type/key token persists after the last element carrying it is deleted. These lists do not indicate whether a token is currently in use.
String-interner maintenance
| Procedure | Description |
|---|---|
gdb.compactStrings() | Vacuum: free interned property-string values no record references any more. Returns how many were reclaimed. |
gdb.stringStats() | Report how many distinct property strings are currently interned. |
CALL gdb.compactStrings();
CALL gdb.stringStats();
Interning is on by default and already reclaims eagerly on overwrite/delete and at checkpoint; these procedures are an on-demand vacuum / introspection. See Operations.
Schema visualization
CALL db.schema.visualization() YIELD nodes, relationships
RETURN nodes, relationships;
This returns a virtual schema graph for Browser and Explorer, rather than the
database's data nodes. See database administration
for dbms.*, backups for standalone maintenance calls,
and the procedure directory for other namespaces.
Related articles
Indexes and constraints · Procedure directory · Transactions and concurrency