Search code examples
memgraphdb

How to obtain database info and statistics using mgconsole?


When I use Memgraph Lab I can see the database statistics at the top of the window. How can I obtain info such as Memgrph version, number of nodes, relationships, etc. when I'm using mgconsole?


Solution

  • To get the information on Memgraph version that is being used use the SHOW VERSION; query.

    To get the information about the storage of the current instance use SHOW STORAGE INFO;. This query will give you the following info:

    • vertex_count - Number of vertices stored
    • edge_count - Number of edges stored
    • average_degree - Average number of relationships of a single node
    • memory_usage - Amount of RAM used reported by the OS (in bytes)
    • disk_usage - Amount of disk space used by the data directory (in bytes)
    • memory_allocated - Amount of bytes allocated by the instance
    • allocation_limit - Current allocation limit in bytes set for this instance