graph query now performs better at large sizes