Skip to content


DROP SPACE deletes the specified graph space and everything in it.


DROP SPACE can only delete the specified logic graph space while retain all the data on the hard disk by modifying the value of auto_remove_invalid_space to false in the Storage service configuration file. For more information, see Storage configuration.


After you execute DROP SPACE, even if the snapshot contains data of the graph space, the data of the graph space cannot be recovered.


Only the God role can use the DROP SPACE statement. For more information, see AUTHENTICATION.


DROP SPACE [IF EXISTS] <graph_space_name>;

You can use the IF EXISTS keywords when dropping spaces. These keywords automatically detect if the related graph space exists. If it exists, it will be deleted. Otherwise, no graph space will be deleted.

Legacy version compatibility

In NebulaGraph versions earlier than 3.1.0, the DROP SPACE statement does not remove all the files and directories from the disk by default.


BE CAUTIOUS about running the DROP SPACE statement.


Q: Why is my disk space not freed after executing the 'DROP SPACE' statement and deleting a graph space?

A: For NebulaGraph version earlier than 3.1.0, DROP SPACE can only delete the specified logic graph space and does not delete the files and directories on the disk. To delete the files and directories on the disk, manually delete the corresponding file path. The file path is located in <nebula_graph_install_path>/data/storage/nebula/<space_id>. The <space_id> can be viewed via DESCRIBE SPACE {space_name}.

Last update: January 30, 2024