[
  {
    "type": "raw_sql",
    "description": "Add index on customers.dateAdded for retention cohort aggregation. Without it, the cohort job runs full table scans of customers for each of 12 cohort months per store.",
    "database": "{{store}}",
    "check_query": "SELECT COUNT(*) as cnt FROM information_schema.STATISTICS WHERE table_schema = DATABASE() AND table_name = 'customers' AND index_name = 'idx_dateAdded'",
    "check_value": "0",
    "sql": "ALTER TABLE customers ADD INDEX idx_dateAdded (dateAdded)"
  }
]
