Skip to content

Instantly share code, notes, and snippets.

View clrcrl's full-sized avatar

Claire Carroll clrcrl

View GitHub Profile
@jthandy
jthandy / vacuum-analyze-sinter.md
Created August 13, 2018 19:51
Running vacuum and analyze on Redshift via Sinter

Running vacuum and analyze in Sinter

dbt and Sinter have the ability to run regular Redshift maintenance jobs. It's great to set these up early on in a project so that things stay clean as the project grows, and implementing these jobs in Sinter allows the same easy transparency and notifications as with your other dbt jobs.

This document will go through the specific steps necessary to configure vacuum and analyze jobs in the current version of dbt and Sinter. In the future, there will likely be a more idiomatically consistent way to express this logic using native dbt operations. Currently, this does work even if it is not elegant.

Step 1: Create the macros

macros/redshift_maintenance.sql