Is it safe?
Yes. The data itself is not altered. The job optimizes how the data is stored. MySQL also recommends using the TABLE OPTIMIZE command on a regular basis.

Will it queue?
No, it will do all tables at once. If you are running a very large website or your webserver times out early, make sure you run the automated job via CLI (Command Line Interface), e.g.: ./concrete/bin/concrete5 c5:job optimize_database_tables

The task got stuck / doesn't finish
Click the button "Reset All Jobs" on the Automated Jobs page. Then restart the job.

Where can I read more about the technicallities?
See for example https://dev.mysql.com/doc/refman/8.0/en/optimize-table.html