Joining using a sorted index: zig-zag join algorithm