Optionally raise an exception if the graph is going to perform a full scan