Regulatory credit risk reporting was optimized by developing a centralized CASE-Condition database defining key metrics like balances and interest rates across all consumer credit products. This helped establish consistent definitions enterprise-wide. The database was used to audit and optimize legacy SQL code retrieving the metrics from origination and portfolio tables for each product monthly. The optimized SQL reduced runtime and storage usage by up to 80%. Common metrics were also collected in a new reporting system with specific CASE conditions and aliases.