optimizations in graphdb implementation