rails lookup-by-index is slower than just tracking previous id