optimized fix_timeline with raw sql