I am planning to build some wide tables in snowflake. The underlying data is highly normalized, so there is a lot of joining involved.
To illustratate the point, consider TRANSACTIONS (1b records), PRODUCTS (10k records) and PRODUCT_CATEGORY (50 records)
I would look to build:
# Creating a view in snowflake
SELECT t.*, p.productName, pc.productCategoryName
FROM TRANSACTIONS t
JOIN PPRODUCTS p ON p.product_id = t.product_id
JOIN PRODUCT_CATEGORY pc ON pc.product_category_id = p.product_category_id
My question is whether I should keep product_category_id or product_id in the view? In theory it should be quicker to query based on the (integer) Id rather than on the (string) productName or productCategoryName.
That said, I may be overthinking this. I'm new to snowflake so not 100% sure how much of this is important.