Optimize shuffle query by adding an indexed hash