Built-in named procedures¶
Built-in named procedures are predefined by NebulaGraph Database Developer Edition. Some are provided through official plugins and become available only after the corresponding plugin is loaded. The available procedures can vary by deployment environment.
View built-in procedures¶
Run the following statement to view the named procedures available in the current environment:
SHOW PROCEDURES
The result includes the built-in named procedures in the catalog and the user-defined procedures (UDPs) in the current schema. The schema and owner fields are empty for built-in named procedures.
Procedure categories¶
Built-in named procedures mainly cover the following categories. The procedure names in the table are representative examples, not a complete list.
| Category | Representative procedures | Purpose |
|---|---|---|
| Catalog and metadata | show_schemas, show_graphs, show_graph_types, show_procedures, show_functions, show_plugins, show_indexes |
Inspect metadata for schemas, graphs, graph types, procedures, functions, plugins, and indexes. |
| Cluster and storage | show_services, show_partitions, show_leaders, show_peers, show_stats |
Inspect services, partitions, replicas, leaders, and statistics. |
| Queries, sessions, and privileges | show_queries, show_sessions, show_current_session, show_users, show_roles |
Inspect running queries, sessions, users, and roles. |
| Jobs and administrative operations | compact, flush, stats, stop_job, balance_leader, balance_data, drain_leader |
Submit or stop jobs and perform administrative operations such as balancing. |
| Procedures provided by official plugins | algo.bfs, algo.dijkstra, algo.pagerank, algo.subgraph |
Run graph algorithms. The plugin that provides a procedure must be loaded before the procedure can be used. |
Use the output of SHOW PROCEDURES as the source of truth. You can also use a regular expression to narrow the results by name. For example, the following statement shows procedures whose names start with show:
SHOW PROCEDURE "show.*"
For the command syntax and descriptions of all returned fields, see SHOW PROCEDURE / PROCEDURES.
View inputs and output fields¶
Run SHOW PROCEDURE <procedure_name> to inspect a specific procedure. For example:
SHOW PROCEDURE show_graphs
In the result, parameters lists the names and data types of accepted procedure inputs, and return_fields lists the names and data types of the procedure output fields. The parameters field does not indicate whether an argument is required. Refer to the detailed documentation for the procedure to distinguish required and optional arguments.
Call a built-in procedure¶
Built-in named procedures and UDPs use the same CALL syntax. For example:
CALL show_graphs() RETURN *
For general usage such as selecting columns, filtering, passing results, aggregation, and pagination, see CALL named procedures.
Relationship to administrative commands¶
To provide concise syntax for common administrative operations, some built-in named procedures also have corresponding commands such as SHOW, DESCRIBE, KILL, and BALANCE. These commands are not a separate procedure type. For the mappings in the following table, the system parses the command as an implicit call to the corresponding built-in procedure. Both forms invoke the same underlying procedure.
The two forms are provided to balance conciseness and composability:
| Form | Characteristics | When to use it |
|---|---|---|
SHOW, KILL, or another command |
Concise syntax for a common administrative operation. It runs as a standalone top-level command and directly returns the default result or performs the operation. | View the complete default result or perform a single administrative operation. |
Explicit CALL |
A general, composable form. It ends with RETURN or FINISH and can use YIELD, FILTER, aggregation, ordering, pagination, variables from preceding statements, or a subsequent CALL. |
Select or rename return columns, filter and process results, use dynamic arguments, or compose multiple operations in a query. |
The following table lists only common built-in procedures that have corresponding SHOW, KILL, or other commands. It is not a complete list of built-in procedures, and not every built-in procedure has a corresponding command.
Note
The calls in the table are examples corresponding to the commands on the right, not complete procedure signatures. An example omits arguments when it lists all objects or performs an operation that does not require a target. A name, ID, or another argument is required when querying or operating on a specific object. Empty parentheses (()) mean that the example does not pass an argument, but the procedure might still support optional arguments. For example, show_graphs accepts an optional argument that filters results by graph type. Placeholders such as <job_id> and <graph_name> must be replaced with actual values. Run SHOW PROCEDURE <procedure_name> to inspect the accepted input names and data types. Refer to the detailed documentation for the procedure to determine whether each argument is required.
| Built-in procedure call example | Corresponding SHOW, KILL, or other command |
Purpose |
|---|---|---|
CALL show_graphs() RETURN * |
SHOW GRAPHS |
Lists graphs and temporary graphs. |
CALL show_graph_types() RETURN * |
SHOW GRAPH TYPES |
Lists graph types. |
CALL show_services() RETURN * |
SHOW SERVICES |
Lists services. |
CALL show_peers() RETURN * |
SHOW PEERS |
Lists partition replicas. |
CALL show_queries() RETURN * |
SHOW QUERIES |
Lists running or canceling queries. |
CALL show_sessions() RETURN * |
SHOW SESSIONS |
Lists active sessions. |
CALL show_job(<job_id>) RETURN * |
SHOW JOB <job_id> |
Shows the specified job. |
CALL stats("<graph_name>") RETURN job_id |
SUBMIT JOB STATS <graph_name> |
Submits a job that generates statistics for the specified graph. |
CALL version() RETURN version |
SHOW VERSION |
Shows version information. |
CALL kill_query("<query_id>") RETURN query_id |
KILL QUERY "<query_id>" |
Terminates the specified query. |
CALL kill_session(<session_id>) RETURN session_id |
KILL SESSION <session_id> |
Terminates the specified session. |
CALL cancel_balance_data() FINISH |
CANCEL BALANCE DATA |
Cancels a data balancing job. |
Detailed documentation¶
algo.subgraph: Extracts a subgraph from a persistent graph using multi-source BFS. This procedure is provided by thealgoplugin, which must be loaded before use.