It might be as simple as not defining a primary index.
No, it's not. First, the shown query can't use indexes with LIKE '%ABC%'. Second, the second query is fast.
(B.T.W. there is a primary index on this table)
This is defenitly a transaction/sweep problem. When the database first starts it's cache is empty. When the first query with LIKE is done, it takes time to internally access all those transaction/snapshots. By the second query this is faster because it can be done from memory.
And it's already established that after a restore everything works as expected because the old transactions are removed.