After deleting millions of rows from a log table, the file on disk stays just as big. Before you rebuild the table, check how much there is to win.
SHOW TABLE STATUS LIKE 'orders'\G
Look at Data_free. It is the allocated space, in bytes, that is not used by rows. A large value next to a modest Data_length means the table file is mostly empty pages. Then a rebuild gives that space back:
OPTIMIZE TABLE orders;
For InnoDB the reply says Table does not support optimize, doing recreate + analyze instead. That note looks like an error but is normal: it rebuilds the table into a fresh file and updates the index statistics.
Some things to know before you run it. With innodb_file_per_table off, the space goes back into the shared tablespace, not to the filesystem. The rebuild needs free disk space about the size of the table, because it writes a full new copy first. It also takes time and a lot of I/O on a big table, so do it in a quiet hour. And if the table will grow back to the same size next month, shrinking it only gives you work; I’d only bother after a one-time cleanup.
Further reading: OPTIMIZE TABLE, SHOW TABLE STATUS