Walter_C
Databricks Employee
Databricks Employee

Yes, it is recommended to run cleanup operations such as VACUUM, OPTIMIZE, and ANALYZE TABLE in a separate notebook and workflow. This helps in isolating the cleanup tasks from the main data processing tasks, reducing the overall runtime of your primary notebooks. Running these operations in a separate workflow also allows you to schedule them during off-peak hours, minimizing the impact on your main data processing workflows.

You do not need to run these commands every time you write to a table. Instead, you can schedule these operations to run periodically based on your data update frequency and workload requirements.