Snowflake Cost Optimization

Paradime's Snowflake Cost Optimization is an advanced feature of our Radar product, designed to automatically reduce your Snowflake costs without compromising performance. By leveraging AI-driven analysis, this tool optimizes your Snowflake warehouses, providing significant savings with minimal effort.

Prerequisites

  • Active Snowflake account

  • Admin access to your Snowflake account

How to Set Up

  1. Set up Snowflake Cost Access - Complete all steps to give Paradime the necessary Snowflake access to optimize your Snowflake spend. This includes creating a new snowflake role and users, creating a paradime-specific data warehouse, creating an S3 integration, etc.

For a fast setup, update the placeholders and execute the code below:

Snowflake Cost Access Script
-- 1.### create user and role

use role useradmin;
create user if not exists paradime_cost_user
  password = '<you_generated_password_here>'
  default_role = paradime_cost_role
  default_warehouse = paradime_warehouse
  comment = 'Used by paradime.io for cost analytics';

create role if not exists paradime_cost_role comment = 'Used by paradime.io for cost analytics';
grant role paradime_cost_role to role sysadmin;
grant role paradime_cost_role to user paradime_cost_user;

-- 2.### create warehouse

use role sysadmin;
create warehouse if not exists paradime_warehouse
  warehouse_size=xsmall
  auto_suspend=60
  initially_suspended=true
  comment = 'Used by paradime.io for cost analytics';
  
grant monitor, operate, usage, modify
  on warehouse paradime_warehouse to role paradime_cost_role;
  
-- 3.### Create S3 integration

use role accountadmin;

create or replace storage integration PARADIME_S3_STORAGE_INTEGRATION
    type = external_stage
    storage_provider = 'S3'
    enabled = true
    STORAGE_AWS_ROLE_ARN = 'arn:aws:iam::817727247863:role/paradime-snowflake-role-<your_paradime_region>-<your_company_token>'  -- replace company token and region before running this command
    STORAGE_ALLOWED_LOCATIONS = ('s3://paradime-s3-<your_company_token>-<your_paradime_region>/snowflake/');  -- replace company token and region before running this command
    
grant usage on integration PARADIME_S3_STORAGE_INTEGRATION to role paradime_cost_role;

-- 4. ### create paradime db and schemas and grant access

use role accountadmin;

create or replace database PARADIME_COST_ANALYTICS;

create or replace schema PARADIME_COST_ANALYTICS.CORE;

grant usage on database  PARADIME_COST_ANALYTICS to role paradime_cost_role;

grant usage on schema  PARADIME_COST_ANALYTICS.CORE to role paradime_cost_role;


-- 5.### Create fileformat and grant privileges

use role accountadmin;

create or replace file format PARADIME_COST_ANALYTICS.CORE.PARADIME_JSON_FORMAT
    type = JSON
    NULL_IF = ();

grant all privileges on file format PARADIME_COST_ANALYTICS.CORE.PARADIME_JSON_FORMAT to paradime_cost_role;

-- 6.### grant access to Snowflake metadata

use role accountadmin;

grant imported privileges on database snowflake to role paradime_cost_role;

-- 7.### grant access to monitor warehouses

use role accountadmin;

grant monitor usage on account to role paradime_cost_role;

--- ### grant paradime the access to manage warehouses
use role accountadmin;

grant manage warehouses on account to role paradime_cost_role;


--- ### grant paradime the access to manage tasks
use role accountadmin; 

grant create TASK on schema  PARADIME_COST_ANALYTICS.CORE to role paradime_cost_role;

grant execute TASK on ACCOUNT TO ROLE paradime_cost_role;

--- ### check the rate_sheet_daily view contains data
use role accountadmin;

select * from snowflake.organization_usage.rate_sheet_daily;
  1. Configure dbt™️ Project - Set up your dbt™ project to allow Paradime to enrich your Snowflake queries with additional metadata. This involves creating a new macro and updating your dbt_project.yml file.

  2. Configure Cost Connection in Paradime - Connect your Snowflake account to Paradime using the credentials and information from the previous setup steps. This allows Paradime to access and optimize your Snowflake costs.

Snowflake cost optimizer will active one hour after setup.

Overview Tab

The Overview tab of the Snowflake Cost Optimizer serves as your central hub for analyzing (not controlling) warehouse spend. It offers a comprehensive snapshot of expenses related to both Snowflake and dbt™️ operations.

Key features

  • Comprehensive Snowflake usage and cost metrics

  • Detailed dbt™️ operation insights

  • Interactive elements for in-depth exploration

Optimizations tab

The Optimizations tab is where you can view and control the AI-driven cost-saving features of the Snowflake Cost Optimizer. This tab offers two powerful tools designed to maximize your Snowflake efficiency and minimize costs: Warehouse Autoscaler and Idle Time Optimizer.

Key Features

  • 24/7 usage analysis and automatic rightsizing

  • Adapts to time-of-day and utilization patterns

  • Conservative approach maintains query performance

  • Optimized for BI tools and reporting warehouses

How to Use

  1. Review potential savings and current savings

  2. Examine the savings chart for overall performance

  3. Scroll through warehouses to see specific optimization opportunities

  4. Enable or disable optimizations as needed

  5. Monitor "Current savings" to track actual savings over time

Best Practices:

  • Start with your most expensive warehouses

  • Regularly review optimization performance

  • Pay attention to warehouses with high potential but no current savings

  • Use different time ranges to analyze performance

Last updated