Search code examples
memgraphdb

How does parameter --query-vertex-count-to-expand-existing=10 influence query execution in Memgraph?


There is one configuration parameter in the Memgraph instance that I got as part of a project. This parameter is --query-vertex-count-to-expand-existing=10. What would be the exact purpose of this configuration parameter?


Solution

  • This is a flag to Memgraph's planner. Sometimes basic expansion can be expensive if a node degree is high because the execution has to visit all the neighbor nodes and then filter. By using the index, the execution engine knows exactly which viable nodes to expand.

    The documentation has the following explanation:

    Maximum count of indexed vertices which provoke indexed lookup and then expand to existing, instead of a regular expand. Default is 10, to turn off use -1.

    This means if the index size exceeds the flag value, that index won't be considered, and regular expansion will be used. In general, that's quite an advanced option to accelerate the execution speed.