TeksOptima: connect Snowflake (push or OAuth) and Databricks, read the savings
Complete guide to cloud data platform cost optimization: connect Snowflake via push script or OAuth, connect Databricks, read warehouse health metrics, and capture 30–60% credit savings.
TeksOptima is Tekspaz’s continuous cloud cost and performance optimization engine for enterprise data platforms. It targets Snowflake and Databricks, routinely uncovering 30% to 60% in compute credit savings without impacting query performance or analyst workloads.
TeksOptima operates with native zero-credential tenancy: it reads only query history and warehouse telemetry metadata. Your actual table data never leaves your account.
1. How TeksOptima achieves 30–60% savings
Most data platform spend is lost to compute that stays awake when idle, oversized warehouses running small queries, and inefficient scans. TeksOptima attacks these via three levers:
- Idle Time & Schedules (17% avg savings): Eliminating 0-auto-suspend warehouses, dynamically right-sizing quiet-hour compute, and preventing idle clusters from burning credits.
- Warehouse Right-Sizing (16% avg savings): Matching warehouse sizes (X-Small through 4X-Large) and cluster scaling policies to actual workload patterns.
- Scan & Query Routing Efficiency (12% avg savings): Routing ad-hoc analyst queries to optimal warehouses using a hybrid rules engine and predictive ML model.
2. Connecting Snowflake
You can connect your Snowflake account using either the Push script (recommended for security-restricted environments) or Direct OAuth.
Method A: Push Script (Recommended)
The push method runs a small read-only extraction SQL script inside your Snowflake account, generating a token that you paste into Tekspaz. No external network inbound access into Snowflake is required.
- In Tekspaz, navigate to Settings › Connections › TeksOptima (
/settings). - Copy the initialization SQL script provided:
-- Create read-only role and user for FinOps telemetry USE ROLE ACCOUNTADMIN; CREATE ROLE IF NOT EXISTS TEKSOPTIMA_READER; GRANT IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE TO ROLE TEKSOPTIMA_READER; GRANT MONITOR USAGE ON ACCOUNT TO ROLE TEKSOPTIMA_READER; -- Generate a scoped read token (starts with tksr_...) CALL SNOWFLAKE.ML.GENERATE_TELEMETRY_TOKEN('TEKSOPTIMA_READER', 30); - Run the script in your Snowflake Snowsight worksheet.
- Copy the generated read token (starts with
tksr_...). - Paste the token into the TeksOptima read token input in Tekspaz Settings and click Connect TeksOptima.
Tekspaz validates the token against TeksOptima’s contract and securely links your workspace.
sequenceDiagram
autonumber
actor Admin as Snowflake Admin
participant Snow as Snowflake (Your Tenancy)
participant Teks as Tekspaz Platform
Admin->>Snow: Run Read-Only Telemetry Script
Snow-->>Admin: Issue Token (tksr_...)
Admin->>Teks: Paste Token in Settings › Connections
Teks->>Teks: Validate Contract & Encrypt Token
Teks-->>Admin: Connected & Synced
Method B: Snowflake OAuth
If your organization prefers managed OAuth:
- In Settings › Connections, click Connect Snowflake with OAuth.
- Sign in to your Snowflake account with an account administrator or FinOps role.
- Review requested permissions:
IMPORTED PRIVILEGES ON DATABASE SNOWFLAKEandMONITOR ON WAREHOUSE. - Click Allow.
- Once redirected back, select which warehouses you wish to include in cost monitoring.
3. Connecting Databricks
Connecting Databricks enables cluster sizing optimization, photon engine right-sizing, and SQL warehouse idle suspend monitoring.
Setup Steps
- In Settings › Connections, select Databricks.
- Enter your Databricks Workspace URL (e.g.
https://dbc-abc12345-1234.cloud.databricks.com). - Generate a Personal Access Token (PAT) or Service Principal Token in your Databricks workspace:
- Navigate to User Settings › Developer › Access tokens.
- Generate a token with the comment
tekspaz-optima-monitor. - Grant read permission on the
system.billing.usageandsystem.compute.clusterssystem tables.
- Paste the token into Tekspaz and click Save Connection.
- Tekspaz checks connectivity and begins ingesting 30-day cluster metrics.
4. Reading the savings dashboard
Open your project’s TeksOptima tab (/projects/[id]/optima):
1. Warehouse Health & Heatmap
- 30-Day Load Heatmap: Visualizes hourly weekday and weekend utilization across every warehouse. Dark blue indicates high queueing; light gray indicates idle waste.
- Auto-Suspend Health: Flags any warehouse configured with
AUTO_SUSPEND = 0(always on) or excessive timeouts (> 10 minutes for interactive warehouses).
2. Spend Forecast & Anomaly Detection
- Displays your 7-day projected credit burn against historical 28-day averages.
- Flags anomaly spikes (> 3σ above the mean) with immediate drill-down to the offending queries.
3. Query Router ML Second Opinion
- Shows recommendations where queries can be routed to a smaller or alternative warehouse tier without latency penalty.
- Each recommendation carries both the deterministic SQL rule verdict and a machine learning confidence score. Suggestions with confidence under 70% are automatically withheld.
5. Applying and reversing recommendations
TeksOptima never alters your production infrastructure without verification:
- In the Savings tab (
/projects/[id]/optima/savings), inspect the list of recommended actions. - Click on a recommendation (e.g. Resize ANALYTICS_WH from Large to Medium during 20:00–06:00 UTC).
- Inspect the Generated SQL:
-- TeksOptima generated execution ALTER WAREHOUSE ANALYTICS_WH SET WAREHOUSE_SIZE = 'MEDIUM'; ALTER WAREHOUSE ANALYTICS_WH SET AUTO_SUSPEND = 120; - Inspect the Reversal Script:
-- Instant rollback script ALTER WAREHOUSE ANALYTICS_WH SET WAREHOUSE_SIZE = 'LARGE'; ALTER WAREHOUSE ANALYTICS_WH SET AUTO_SUSPEND = 600; - Click Apply Change. The update takes effect immediately, and TeksOptima begins tracking the real-time credit savings!
What to explore next
Ask the DocsAI Assistant
Instant answers grounded in our guides with direct links to sources.
We couldn't find an exact answer in the guides for this query. You can try searching full documentation text:
Have questions about this guide?
Our founding engineering team is ready to help you get started.
