Given tables Products(product_id, department, category, subcategory) where department > category > subcategory form a hierarchy, and ClickLog(user_id, product_id, event_ts) that records user clicks, write SQL to compute the number of unique customers who visited (clicked any product in) a specified department over a given time range. Ensure correct mapping from product_id to its department and avoid double-counting users who clicked multiple products/categories within the same department. Explain your indexing/partitioning strategy for large-scale data and how you would extend the query to return results for all departments.