Question: Suppose there is an index on integer column `id`,

How do I efficiently find those records whose `id` matches `%789%`?

`id LIKE '%789%'` won't be able to use the index and will have performance issue.

Is there a trick to do the job efficiently?

Answer: 
How about using an animation whose completion block invokes the animation again, based on a flag? When you want to make the animation sequence stop, set the flag to false. The completion block will see that the repeat flag is false, and stop at the end of the last cycle.

After committing your animation, you should change the transform to its end value. If you're doing view animation, just set the transform to its final value. That way, once the animation is removed, it will stay at the end state.

If you're using layer transforms, you'll need to put the code that sets the transform to its final state in a CATransactionBegin/ with [CATransaction setDisableActions: YES], so that change is not implicitly animated.
Using the same property you were using to set the number of repeats, you can get the desired behaviour you're after. This will end the animation after the cycle finishes. 

```
animation.repeatCount = 0

```