Hi @Databricks_Work , Vacuum and Analzye are two separate commands that are used for optimizing the queries but they perform two different operations.
Vacuum is used to clear the stale data files in your delta table. Vacuum should be run after a optimize operation. We recommend to schedule a batch job to run optimize and vacuum. Generally, the preferred schedule is to run the job weekly but can be changed based on the use case.
Analyze command is used to collect stats on the delta table. This helps in query planning like choosing the type of operation. This command is usually run on adhoc basis but can also be put as part of the daily job run.