greedy join speed optimalization