What is the purpose of sql-stats-compaction?
In 21.2, CockroachDB starts to persist Statement and Transaction statistics (aka SQL Stats). The purpose of the sql-stats-compaction job is to compact and delete older SQL Stats that are far into the past to relieve storage overhead.
How can I recreate that schedule if it is important?
You don’t have to. In 21.2, CockroachDB automatically checks for the existence of the sql-stats-compaction job at a low frequency (~ every 6 hours or so), and if it noticed that the schedule is missing, it will recreate it on its own.
Hope it helps!