TeksOptima: see where your Snowflake and Databricks money goes, and what to change
TeksOptima guide: analyse the Snowflake and Databricks connectors on your Tekspaz account, read the answers, and apply savings safely.
TeksOptima shows where your Snowflake and Databricks money goes and what you can change to spend less. It reads usage history only, never your tables, and never changes anything in your account: you run every change yourself, and every change comes with the SQL to undo it.
You use the Snowflake and Databricks connectors already on your Tekspaz account, so you connect once.
Start in five minutes
- Open teksoptima.tekspaz.ai and sign in with your Tekspaz account. With nothing connected yet you land on Connectors.
- Press Add connector and choose how to connect (see below). Connectors you already added on tekspaz.ai are listed here too: you connect once, and every product shares them.
- Press Analyse costs on a connector. Only someone who manages the connector can do this.
- Your first numbers arrive in one to three minutes. Press Open. After that, TeksOptima reads the connector again every morning, and signing in takes you straight into your cost pages.
If a read fails because the connector can’t see usage history yet, the card shows the exact SQL to run (below), then press Read now in the ⋯ menu.
Two ways to connect
Run a script in your account (easiest). No key to make. For Snowflake you run one script as ACCOUNTADMIN; for Databricks you schedule one notebook. It sends the usage history, and no credential leaves your account.
Connect with credentials. A key pair for Snowflake, or a service principal for Databricks. They are saved encrypted on your Tekspaz account, which is why every product can use them, and TeksOptima reads them again each morning. Test only checks the credentials, and whether usage history can be read, without saving anything.
We recommend a read-only user made for TeksOptima rather than a pipeline user. The form shows the SQL to create one: a role that can read usage history, one X-Small warehouse that suspends after a minute, and a service user for it. A pipeline user also works if it can read usage history, but it can do more than TeksOptima needs.
The connector’s warehouse must be able to start itself: with auto-resume off, a read fails and the card says the warehouse isn’t available.
Let the connector read usage history
Snowflake. Run once, as ACCOUNTADMIN, for the role on your connector:
USE ROLE ACCOUNTADMIN;
GRANT IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE TO ROLE <the connector's role>;
GRANT MONITOR USAGE ON ACCOUNT TO ROLE <the connector's role>;
Databricks. Run as a metastore admin, for the connector’s service principal (its application id), then give it Can use on the connector’s SQL warehouse:
GRANT USE CATALOG ON CATALOG system TO `<application-id>`;
GRANT USE SCHEMA, SELECT ON SCHEMA system.billing TO `<application-id>`;
GRANT USE SCHEMA, SELECT ON SCHEMA system.compute TO `<application-id>`;
GRANT USE SCHEMA, SELECT ON SCHEMA system.lakeflow TO `<application-id>`;
GRANT USE SCHEMA, SELECT ON SCHEMA system.query TO `<application-id>`;
GRANT USE SCHEMA, SELECT ON SCHEMA system.serving TO `<application-id>`;
Your workspace must use Unity Catalog, and the compute, lakeflow, query and serving system schemas must be enabled.
What you can find out
Your first stop after Open is Home (Databricks: Overview). It starts with a short note on whether spend is up or down this week against last, the day it jumped most, and where the month is heading.
Explore lists each question below and opens the screen that answers it.
| Question | Where | Platform |
|---|---|---|
| Why did our bill go up? | Home (Snowflake), Overview (Databricks) | Both |
| What is too big, or never goes to sleep? | Warehouse Health, Compute | Both |
| What can we change safely this week? | Savings | Both |
| Which team or project spends what? | Cost by Tag | Snowflake |
| What does AI cost us? | AI & Cortex Cost, Model Serving | Both |
| Which scheduled jobs waste money? | Jobs | Databricks |
| Tell me when spend jumps | Intelligence | Both |
Panels marked Preview use models still being checked against real accounts: read their numbers as estimates.
Apply a saving
- Open Savings and pick a change. Start with High confidence.
- Read what it changes and why, then copy the SQL to apply it and keep the SQL to undo it.
- Run it yourself in Snowflake or Databricks. Sizes come down one step at a time, so nothing drops off a cliff.
- The next reads show whether the saving was real. Only confirmed savings are counted.
To fill in Cost by Tag, tag your queries with the team and the project (for example a QUERY_TAG set in dbt, Airflow or your BI tool).
What TeksOptima reads, and what it never does
- It reads usage history: what ran, on which warehouse or cluster, for how long, and what it cost. On Snowflake that is the
SNOWFLAKE.ACCOUNT_USAGEviews. On Databricks it is thesystemcatalog. - It never reads your tables, their rows, query results or query text.
- It uses the connector’s credentials, stored encrypted on tekspaz.ai, only for each read. It doesn’t keep them.
- Stop analysing here (the ⋯ menu on a connector) removes what was read and stops the daily read, in TeksOptima only.
- Remove connector (same menu) removes the connector from your whole Tekspaz account, so TeksInfra and the other products lose it too. It asks first. You can do the same from any product’s Connectors page.
More about the script and notebook options
If your security team won’t share a credential, Add connector → Run a script in your account is for you:
- Snowflake script: run once as ACCOUNTADMIN. It creates a daily task inside your account that sends the usage history to TeksOptima. No credential leaves your account.
- Snowflake OAuth: TeksOptima signs in to your account on your behalf.
- Databricks notebook: a notebook you schedule sends the usage history, with user names hashed before they leave.
Connections made this way show under Connected here before on the Connectors page and open like any other.
When something looks wrong
| You see | What to do |
|---|---|
| Your connectors don’t show | Check you’re signed in with the same Tekspaz account (and organisation) where you added them. |
| “The connector’s Snowflake warehouse isn’t available” | Turn on auto-resume for it (ALTER WAREHOUSE <name> SET AUTO_RESUME = TRUE), or give the connector a warehouse that exists, then Read now. |
| No Analyse costs button | You can use the connector but not manage it. Ask whoever added it on tekspaz.ai. |
| “Can’t read Snowflake’s usage history” | Run the Snowflake grant above for the connector’s role, then Read now. |
| “Can’t read Databricks’ system tables” | Run the Databricks grants above for the service principal, then Read now. |
| Numbers look a day behind | Snowflake’s usage history can lag by a few hours. |
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:
