<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>Altimate AI Blog</title>
  <link>https://altimate.ai/blog</link>
  <atom:link href="https://altimate.ai/blog.rss.xml" rel="self" type="application/rss+xml" />
  <description>Insights on AI agents, agentic data engineering, Snowflake, Databricks, and analytics engineering.</description>
  <language>en-us</language>
  <ttl>60</ttl>
  <image>
    <url>https://altimate.ai/logo512.png</url>
    <title>Altimate AI Blog</title>
    <link>https://altimate.ai/blog</link>
  </image>
  <lastBuildDate>Sat, 07 Nov 2026 03:33:19 GMT</lastBuildDate>
  <item>
    <title>Faster Dashboard, Higher Snowflake Bill? Count Your Busy Hours Before Moving to an Interactive Warehouse</title>
    <link>https://altimate.ai/blog/snowflake-interactive-warehouses-cheaper-per-hour-not-always-cheaper</link>
    <guid isPermaLink="true">https://altimate.ai/blog/snowflake-interactive-warehouses-cheaper-per-hour-not-always-cheaper</guid>
    <pubDate>Wed, 21 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Yuktha Raman</dc:creator>
    <category>snowflake</category>
    <category>Snowflake Costs</category>
    <category>Cost Optimization</category>
    <description>Snowflake interactive warehouses bill 0.6 credits an hour at X-Small but cannot auto-suspend in under 24 hours. They save money only when the warehouse stays busy, about 14 hours a day against Gen1 and 11 against Gen2.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/snowflake-interactive-warehouses-cheaper-per-hour-not-always-cheaper/cover.jpg" alt="Faster Dashboard, Higher Snowflake Bill? Count Your Busy Hours Before Moving to an Interactive Warehouse" /></p>
<p>Your sales dashboard is slow every Monday morning. You read that a Snowflake interactive warehouse answers queries in under a second. It bills 0.6 credits an hour at X-Small, against 1 credit for a standard X-Small. You move the dashboard over. It gets faster, and the next month's bill goes up.</p>
<p>Nothing broke. The dashboard is busy from 9am to 6pm and quiet the rest of the day. On a standard warehouse, it ran about five hours a day and auto-suspended the rest, for roughly 5 credits a day. An interactive warehouse cannot auto-suspend in less than 24 hours, so it ran all 24 hours. That is 14.4 credits a day. A lower rate multiplied by more hours gives a larger total.</p>
<p>In short:</p>
<ul>
<li><strong>What it is.</strong> Interactive warehouses are a Snowflake compute type built for sub-second, high-concurrency serving traffic. They run on your existing tables, so no migration is required.</li>
<li><strong>When it is cheaper.</strong> Steady, all-day serving, such as embedded dashboards, customer-facing APIs, always-on alerting and AI agents.</li>
<li><strong>When it costs more.</strong> Bursty workloads. A standard warehouse suspends between bursts and stops billing, while an interactive warehouse stays on.</li>
<li><strong>The rule of thumb.</strong> If the warehouse is busy fewer than about 14 hours a day, the standard warehouse is cheaper. Against a Gen2 warehouse, the line is about 11 hours.</li>
<li><strong>The trade-offs.</strong> Queries are capped at 5 seconds, and slower ones rerun on a standard fallback warehouse that bills separately. Stored procedures don't run. Interactive tables can only be refreshed or overwritten, not updated incrementally.</li>
</ul>
<p>The feature is simple to turn on. Picking the workloads that should use it takes a look at their history. Every rate and behavior below comes from <a href="https://docs.snowflake.com/en/user-guide/interactive">Snowflake's interactive warehouse documentation</a> as of September 2026. Re-check any number against the <a href="https://www.snowflake.com/legal-files/CreditConsumptionTable.pdf">Service Consumption Table</a> before you plan to spend on it.</p>
<h2>What Is a Snowflake Interactive Warehouse?</h2>
<p>A Snowflake interactive warehouse is built for one kind of work: lots of small, fast queries against the same data. Think of a dashboard thousands of users refresh all day, where each query filters down to a few rows and needs an answer in under a second.</p>
<p>It runs on your existing tables, so you don't need a migration. Standard tables are the recommended default, and they match the speed of Snowflake interactive tables. Choose interactive tables only when you need the most consistent latency. Dynamic and Iceberg tables work too, though Iceberg is slower. Support for querying these table types <a href="https://docs.snowflake.com/en/release-notes/2026/other/2026-09-14-interactive-zero-copy-ga">became generally available in September 2026</a>. Older guides that say interactive warehouses read only interactive tables are out of date.</p>
<p>The speed comes from a local SSD cache. When you attach a table, Snowflake loads that table's data onto the warehouse's local disk ahead of time. Queries then don't have to read it from remote storage. Attaching is optional. A table you don't attach still works, but its data is read from remote storage the first time a query needs it.</p>
<h2>When Is a Snowflake Interactive Warehouse Cheaper?</h2>
<p>Three examples show where interactive warehouses pay off.</p>
<p><strong>The embedded analytics page.</strong> A SaaS product shows each customer a "your usage this month" dashboard. Customers in every time zone open it all day. Every query filters on one customer ID and a recent date range. Traffic never stops, so the warehouse never sits idle, and the lower rate applies to every hour it runs. This is the clearest win.</p>
<p><strong>The order-status API.</strong> An e-commerce site answers "where is my order" straight from Snowflake. Each call is a point lookup on one order ID, under a sub-second SLA, around the clock. Pair it with search optimization.</p>
<p><strong>The always-on agent.</strong> An alerting or AI agent fires small, selective queries every few seconds to check thresholds or answer questions. Its traffic is bursty minute to minute but steady across the day.</p>
<h3>When Is an Interactive Warehouse the Wrong Fit?</h3>
<ul>
<li><strong>Ad-hoc analysis.</strong> Analysts writing one-off queries pull different data each time. The cache keeps filling with data nobody asks for again, and the speed advantage disappears.</li>
<li><strong>ETL and batch jobs.</strong> They run for minutes, not seconds. They hit the 5-second cap every time and end up on the fallback warehouse anyway.</li>
<li><strong>Heavy queries.</strong> Large scans, big joins and expensive distinct counts hit the same 5-second wall.</li>
<li><strong>Business-hours workloads.</strong> Like the sales dashboard in the opening: if the warehouse sits idle much of the day, a standard warehouse that suspends between spikes costs less.</li>
</ul>
<p><img class="blog-fig-light" src="/blog/snowflake-interactive-warehouses-cheaper-per-hour-not-always-cheaper/fig-1.svg" alt="Two panels titled Fits only when all four are true. The fit panel lists sub-second SLA, high concurrency, selective repetitive queries, and a warehouse busy for most of the hours it runs. The wrong-fit panel lists ad-hoc analysis, where the cache fills with data nobody asks for again, ETL and batch jobs, which run for minutes and hit the 5-second cap, heavy queries such as large scans and big joins, and business-hours workloads, idle much of the day so a standard warehouse costs less."> </p>
<p><strong>An interactive warehouse fits when all four of these are true:</strong></p>
<ul>
<li>Sub-second SLA</li>
<li>High concurrency</li>
<li>Selective, repetitive queries</li>
<li>The warehouse would stay busy for most of the hours it runs</li>
</ul>
<p>If anything is missing, keep the workload on a standard warehouse.</p>
<h2>How Do You Calculate the Interactive Warehouse Break-Even Point?</h2>
<p>The discount only pays off if the warehouse stays busy. Auto-suspend can't go below 24 hours. You can suspend manually or on a schedule, but every resume bills at least an hour and starts with a cold cache.</p>
<p>Left on around the clock, an interactive X-Small costs a fixed 14.4 credits a day (0.6 an hour), busy or not. A Gen1 standard X-Small costs 1 credit an hour, only while active. So interactive wins once the standard warehouse would be busy more than about 14 hours a day, roughly a 60% duty cycle.</p>
<p>Snowflake recommends Gen2 for new warehouses. A Gen2 X-Small costs 1.35 credits an hour on AWS and GCP, and 1.25 on Azure. Against a <a href="https://docs.snowflake.com/en/user-guide/warehouses-gen2">Snowflake Gen2 warehouse</a>, break-even drops to about 11 hours.</p>
<table>
<thead>
<tr>
<th>Compared with</th>
<th>Rate at X-Small</th>
<th>Interactive wins above</th>
</tr>
</thead>
<tbody>
<tr>
<td>Gen1 standard warehouse</td>
<td>1 credit an hour, only while active</td>
<td>About 14 busy hours a day</td>
</tr>
<tr>
<td>Gen2 standard warehouse</td>
<td>1.35 credits an hour on AWS and GCP, 1.25 on Azure</td>
<td>About 11 busy hours a day</td>
</tr>
<tr>
<td>Interactive with an 11-hour scheduled window</td>
<td>6.6 credits a day</td>
<td>About 6.6 busy hours a day</td>
</tr>
</tbody>
</table>
<p><img class="blog-fig-light" src="/blog/snowflake-interactive-warehouses-cheaper-per-hour-not-always-cheaper/fig-2.svg" alt="Line chart titled Interactive wins only past about 14 busy hours, or 11 against Gen2. Daily credits at X-Small are plotted against busy hours a day. The interactive warehouse is flat at 14.4 credits a day. A Gen1 standard warehouse rises at 1 credit an hour and crosses it at about 14 hours. A Gen2 standard warehouse rises at 1.35 credits an hour and crosses it at about 11 hours. A note says Gen2 X-Small is 1.25 credits an hour on Azure."> </p>
<p>A scheduled overnight suspend shifts the math again. For the sales dashboard in the opening, an 11-hour window costs 6.6 credits a day. Interactive then only wins if the standard warehouse was active more than about 6.6 of those hours. At the dashboard's five active hours, it still doesn't.</p>
<h2>What Are the Limits of Snowflake Interactive Warehouses?</h2>
<p>Interactive warehouses have three limits that change how you use them.</p>
<ol>
<li><strong>A hard 5-second cap.</strong> Any query that runs longer is canceled. If you set a fallback warehouse, Snowflake reruns the query there, and users never see an error.</li>
<li><strong>No stored procedures.</strong> Anything that runs through a stored procedure call, including Snowflake's <code>->></code> pipe operator, stays on a standard warehouse.</li>
<li><strong>Interactive tables are refresh-only.</strong> If you opt into interactive tables, you can't update or delete individual rows. You refresh them on a schedule or overwrite them, and they do not support some features, such as streams and fail-safe. If you stick with standard tables, the way you load your data stays the same.</li>
</ol>
<p>Most of the unexpected cost comes from the fallback warehouse. Say 95% of a dashboard's queries finish in under a second, but its "export full year" button runs a query that takes 40 seconds. Each click first runs for 5 seconds on the interactive warehouse and hits the cap. Snowflake then runs the same query again on the fallback warehouse, so you pay for both runs. Users never see an error, so nobody notices the extra cost until the fallback warehouse shows up on the bill.</p>
<p><img class="blog-fig-light" src="/blog/snowflake-interactive-warehouses-cheaper-per-hour-not-always-cheaper/fig-3.svg" alt="Timeline titled A 40-second query bills twice: 5 seconds, then a full rerun. On the interactive warehouse the query runs 5 seconds, hits the 5-second cap and is canceled. On the fallback warehouse the same query reruns from the start for 40 seconds. You pay for both runs, and users never see an error."> </p>
<h2>How Do You Pilot an Interactive Warehouse Without Overspending?</h2>
<p>Take these five steps before you move a workload. Each one catches a mistake that would otherwise show up on next month's bill.</p>
<ol>
<li><strong>Split mixed warehouses first.</strong> If dashboards and nightly ETL share a warehouse, the ETL will break the 5-second cap. Move the dashboard traffic to its own warehouse and evaluate that.</li>
<li><strong>Size to the working set, not the table.</strong> In Snowflake's own example, a 120 TB table holds a year of data, but most queries hit the last 7 days. That is about 2.2 TB, which fits a LARGE. Older data stays queryable, but it is slower on the first read.</li>
<li><strong>Cluster on the columns you filter by.</strong> A clustering key that doesn't match your WHERE clauses wastes most of the cache benefit, and fixing it later means a rebuild.</li>
<li><strong>Set up the fallback before launch.</strong> Keep it running or on auto-resume. Make it at least as large as the interactive warehouse, since queries that run past 5 seconds usually need more compute.</li>
<li><strong>Watch two numbers.</strong> The first is the remote-read percentage in the query profile, the share of data pulled from remote storage instead of the cache. It should stay near zero once the cache is warm, and a climb means the working set has outgrown the cache. The second is the fallback's spend, which is where hidden cost builds up.</li>
</ol>
<p><a href="/blog/snowflake-cost-optimization-techniques">12 Snowflake cost optimization techniques</a> covers the levers for standard warehouses.</p>
<h2>How Altimate Can Help You Decide</h2>
<p>Every check in this post runs on data you already have: query history and warehouse metering. The work is pulling that data together for every warehouse, over enough history to trust, before you move anything.</p>
<p>Altimate already does this kind of analysis. Today, <a href="/product-highlights/snowflake-warehouse-auto-tune-right-sizing">Altimate Auto Tune</a> finds blocks of time when a Snowflake warehouse can run at a smaller size without slowing its queries. Interactive warehouses are the same question with a different cost curve, and the same approach applies.</p>
<p>For interactive warehouses, Altimate can help you:</p>
<ul>
<li><strong>Find the candidates</strong> across every warehouse, instead of evaluating them one at a time.</li>
<li><strong>Check the numbers that decide the move.</strong> Look at duty cycle and at query shape against the 5-second cap. Then check clustering fit and the working-set size, which sets how big the warehouse should be.</li>
<li><strong>Compare against the best version of standard.</strong> Sometimes the cheaper move is a right-sized Gen2 warehouse on a better schedule, and not interactive at all.</li>
</ul>
<p>Snowflake's AI coding assistant, Cortex Code, can assess a single query once you've picked it. The harder question is which workloads to look at first, and that needs account-wide history. For Snowflake's adaptive warehouses, see <a href="/blog/adaptive-compute-vs-auto-tune-optimizing-snowflake-warehouses">Adaptive Compute vs Auto Tune</a>.</p>
<p>The rate card shows a lower hourly rate, but only your workload's history shows whether an interactive warehouse costs less for you.</p>
<h2>Frequently Asked Questions</h2>
<h3>Is a Snowflake interactive warehouse always cheaper than a standard one?</h3>
<p>No. The hourly rate is lower, but an interactive warehouse can't auto-suspend in under 24 hours. It only wins if the warehouse is busy about 14 hours a day or more, or about 11 hours against Gen2.</p>
<h3>Do I need to move my data into interactive tables?</h3>
<p>No. Interactive warehouses query standard, dynamic and Iceberg tables directly. Interactive tables are optional, for when you need the most consistent latency.</p>
<h3>What happens when a query runs longer than 5 seconds?</h3>
<p>The interactive warehouse cancels it. If you set a fallback warehouse, Snowflake reruns the query there. You pay for both runs.</p>
<h3>How do I track what an interactive warehouse costs?</h3>
<p>Track it like any other warehouse. Its credits show up in the <a href="https://docs.snowflake.com/en/sql-reference/account-usage/warehouse_metering_history">WAREHOUSE_METERING_HISTORY</a> view, billed at the interactive rate. Give the interactive warehouse and its fallback the same cost tag, so the fallback's spend counts toward the same workload.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/snowflake-interactive-warehouses-cheaper-per-hour-not-always-cheaper/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>FinOps Asked Why the Databricks Bill Went Up? Find the Job in System Tables or in Altimate</title>
    <link>https://altimate.ai/blog/how-to-find-out-what-databricks-is-costing-you-with-system-tables</link>
    <guid isPermaLink="true">https://altimate.ai/blog/how-to-find-out-what-databricks-is-costing-you-with-system-tables</guid>
    <pubDate>Wed, 21 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Sudhanshu Prajapati</dc:creator>
    <category>Databricks</category>
    <category>databricks cost</category>
    <category>finops</category>
    <category>Cost Optimization</category>
    <description>Databricks stores no cost column anywhere. These system tables queries turn usage quantities into cost, then narrow it to the workspace, job, failed run, team and identity behind it, with the checks that catch a wrong number before you share it.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/how-to-find-out-what-databricks-is-costing-you-with-system-tables/cover.jpg" alt="FinOps Asked Why the Databricks Bill Went Up? Find the Job in System Tables or in Altimate" /></p>
<p>It usually comes up at month-end. FinOps sends the Databricks cost report, and the analytics team's line is higher than last month. Nobody made any obvious changes. To explain the increase, you need the job, the team or the failed run behind it.</p>
<p>The invoice gives you one total. The <a href="https://docs.databricks.com/aws/en/admin/governance-hub/cost">Cost page in Governance Hub</a> shows spend at list price and its main drivers. It is an account-level view, still in Beta. Neither one names the job, the team or the failed run. Those answers sit in the Databricks system tables, if you know where to look.</p>
<p>The <a href="https://docs.databricks.com/aws/en/admin/system-tables/billing"><code>system.billing.usage</code></a> table logs every billable event you generate, from cluster-hours to serverless job runs to SQL warehouse compute. It stores usage quantities, not what they cost. The <code>usage_quantity</code> column counts in the row's billing unit, and that unit is not always a DBU. No column in the table holds a cost. If DBUs are new to you, <a href="/blog/understanding-databricks-compute-costs">understanding Databricks compute costs</a> explains how they are priced.</p>
<p>In this post I'll follow one question as it narrows. It starts at where the money went and ends at whose budget it belongs to. Along the way, I'll show you where each answer can be wrong.</p>
<p>Every query below needs <code>USE</code> and <code>SELECT</code> on the system schemas. If you don't have that access, ask a teammate who has it to grant it or to run the queries for you. Start by turning usage quantities into cost.</p>
<h2>How Do I Turn Databricks Usage Quantities Into Cost?</h2>
<p>You turn usage quantities into cost by joining <code>usage_quantity</code> against the SKU's rate. Every query in this post reuses that join, so we write it once as a view. You can also use it as a CTE.</p>
<p>The <a href="https://docs.databricks.com/aws/en/admin/system-tables/pricing"><code>system.billing.list_prices</code></a> table holds the rate for each SKU. It only gets a new row when the price changes, so you join on the price's effective window rather than on a date. If you have a discounted or committed-use rate, you might also have a table named <code>system.billing.account_prices</code>.</p>
<pre><code class="language-sql">CREATE OR REPLACE TEMP VIEW priced_usage AS
SELECT
 usage.*,
 list_prices.currency_code,
 list_prices.pricing.effective_list.default AS effective_list_rate,
 usage.usage_quantity * list_prices.pricing.effective_list.default
   AS estimated_list_cost
FROM system.billing.usage AS usage
JOIN system.billing.list_prices AS list_prices
 ON usage.account_id = list_prices.account_id
AND usage.sku_name = list_prices.sku_name
AND usage.cloud = list_prices.cloud
AND usage.usage_unit = list_prices.usage_unit
AND usage.usage_end_time >= list_prices.price_start_time
AND (
     list_prices.price_end_time IS NULL
     OR usage.usage_end_time &#x3C; list_prices.price_end_time
)
WHERE usage.usage_date >= CURRENT_DATE() - INTERVAL 120 DAYS;
</code></pre>
<p>Two details in this join change the total:</p>
<ul>
<li><strong>The join includes <code>usage_unit</code>.</strong> A SKU name alone does not say whether a quantity is DBUs, tokens, bytes or hours.</li>
<li><strong>There is no <code>WHERE record_type = 'ORIGINAL'</code> filter.</strong> When Databricks corrects a record, a negative <code>RETRACTION</code> cancels the original and a <code>RESTATEMENT</code> adds the corrected value. Filtering to originals keeps the wrong number.</li>
</ul>
<p><img class="blog-fig-light" src="/blog/how-to-find-out-what-databricks-is-costing-you-with-system-tables/fig-1.svg" alt="Diagram titled Usage quantity times the effective list rate gives estimated list cost. A row in system.billing.usage, one row per SKU per hour, carries sku_name, usage_unit, usage_quantity and usage_end_time. It joins to system.billing.list_prices, one row per price change, with price_start_time, a nullable price_end_time and pricing.effective_list.default. The join keys are account_id, sku_name, cloud and usage_unit, and the window is usage_end_time at or after price_start_time, with price_end_time null or later than usage_end_time. The result is estimated_list_cost. A note says usage_quantity is a count in the row's own unit, and that unit is not always a DBU."> </p>
<h2>Which Workspaces and SKUs Drove the Databricks Cost?</h2>
<p>Start the money trail at the workspace and the SKU. Keep <code>billing_origin_product</code>, <code>sku_name</code>, <code>usage_type</code> and <code>usage_unit</code> in the result, because several products share a SKU and not every quantity uses the same unit. The query reads from the <code>priced_usage</code> view above:</p>
<pre><code class="language-sql">SELECT
 workspace_id,
 COALESCE(billing_origin_product, 'UNKNOWN') AS billing_origin_product,
 sku_name,
 usage_type,
 usage_unit,
 currency_code,
 usage_date,
 SUM(usage_quantity) AS usage_quantity,
 SUM(estimated_list_cost) AS estimated_list_cost
FROM priced_usage
WHERE usage_date >= CURRENT_DATE() - INTERVAL 31 DAYS
 AND usage_date &#x3C; CURRENT_DATE() - INTERVAL 1 DAY
GROUP BY
 workspace_id,
 COALESCE(billing_origin_product, 'UNKNOWN'),
 sku_name,
 usage_type,
 usage_unit,
 currency_code,
 usage_date
HAVING ABS(SUM(usage_quantity)) > 0
ORDER BY estimated_list_cost DESC;
</code></pre>
<p>This query takes you from "the bill went up" to "workspace X ran a lot more of this SKU this week". To look at DBU-based compute only, add <code>AND usage_unit = 'DBU'</code>. Do not add raw quantities across units, because ten DBUs, ten gigabytes and ten thousand tokens are not comparable.</p>
<p>When I ran the query above on one of our Databricks accounts, it showed this:</p>
<blockquote>
<p>The top cost drivers over the last 30 days are Vector Search (<del>$74/day), Apps Compute (</del>$34/day), and Model Serving (~$20/day).</p>
</blockquote>
<p>I know the numbers are small, but the same query shows you exactly where the largest share of your money is going.</p>
<h2>Which Databricks Jobs Are Driving the Cost?</h2>
<p>The workspace and SKU query shows where the money went. The next question is which job is responsible and whether it is getting worse. The query below compares two complete seven-day windows and includes run counts. With both, you can tell a more expensive run from a job that simply ran more often:</p>
<pre><code class="language-sql">WITH latest_jobs AS (
 SELECT
   workspace_id,
   job_id,
   name
 FROM system.lakeflow.jobs
 QUALIFY ROW_NUMBER() OVER (
   PARTITION BY workspace_id, job_id
   ORDER BY change_time DESC
 ) = 1
),
job_windows AS (
 SELECT
   workspace_id,
   usage_metadata.job_id AS job_id,
   currency_code,
   MAX_BY(usage_metadata.job_name, usage_end_time) AS billing_job_name,
   COUNT(DISTINCT CASE
     WHEN usage_date >= DATE_ADD(CURRENT_DATE(), -8)
      AND usage_date &#x3C; DATE_ADD(CURRENT_DATE(), -1)
     THEN usage_metadata.job_run_id
   END) AS recent_7d_runs,
   COUNT(DISTINCT CASE
     WHEN usage_date >= DATE_ADD(CURRENT_DATE(), -15)
      AND usage_date &#x3C; DATE_ADD(CURRENT_DATE(), -8)
     THEN usage_metadata.job_run_id
   END) AS prior_7d_runs,
   SUM(CASE
     WHEN usage_date >= DATE_ADD(CURRENT_DATE(), -8)
      AND usage_date &#x3C; DATE_ADD(CURRENT_DATE(), -1)
     THEN estimated_list_cost ELSE 0
   END) AS recent_7d_estimated_list_cost,
   SUM(CASE
     WHEN usage_date >= DATE_ADD(CURRENT_DATE(), -15)
      AND usage_date &#x3C; DATE_ADD(CURRENT_DATE(), -8)
     THEN estimated_list_cost ELSE 0
   END) AS prior_7d_estimated_list_cost,
   MAX(usage_end_time) AS last_seen_at
 FROM priced_usage
 WHERE billing_origin_product = 'JOBS'
   AND usage_metadata.job_id IS NOT NULL
   AND usage_date >= DATE_ADD(CURRENT_DATE(), -15)
   AND usage_date &#x3C; DATE_ADD(CURRENT_DATE(), -1)
 GROUP BY workspace_id, usage_metadata.job_id, currency_code
)
SELECT
 windows.workspace_id,
 COALESCE(
   windows.billing_job_name,
   jobs.name,
   CONCAT('job ', windows.job_id)
 ) AS job_name,
 windows.job_id,
 windows.currency_code,
 windows.recent_7d_runs,
 windows.prior_7d_runs,
 ROUND(windows.recent_7d_estimated_list_cost, 2)
   AS recent_7d_estimated_list_cost,
 ROUND(windows.prior_7d_estimated_list_cost, 2)
   AS prior_7d_estimated_list_cost,
 ROUND(
   windows.recent_7d_estimated_list_cost
     - windows.prior_7d_estimated_list_cost,
   2
 ) AS estimated_list_cost_change,
 ROUND(
   TRY_DIVIDE(
     windows.recent_7d_estimated_list_cost
       - windows.prior_7d_estimated_list_cost,
     windows.prior_7d_estimated_list_cost
   ) * 100,
   1
 ) AS estimated_list_cost_change_pct,
 windows.last_seen_at
FROM job_windows AS windows
LEFT JOIN latest_jobs AS jobs
 ON windows.workspace_id = jobs.workspace_id
AND windows.job_id = jobs.job_id
ORDER BY
 estimated_list_cost_change DESC,
 recent_7d_estimated_list_cost DESC;
</code></pre>
<p><code>usage_metadata.job_id</code> is populated for jobs on Jobs Compute and serverless. Jobs on all-purpose compute or SQL warehouses are not billed as jobs, so they do not appear here. <a href="/blog/databricks-all-purpose-vs-jobs-compute">All-purpose vs Jobs compute</a> compares the two billing models. <code>system.lakeflow.jobs</code> is regional, so run this query in each region.</p>
<p>Before you conclude a job got more expensive, check whether it started failing. A job that fails 40 minutes into a run has already spent 40 minutes of DBUs. A job that fails after four minutes has spent very little.</p>
<h2>Which Failed Databricks Job Runs Cost the Most?</h2>
<p>A job can fail after a few seconds or after most of its work is complete. A count of failures does not show what those failures cost. This query totals each billed run and keeps the runs whose latest terminal state is an error:</p>
<pre><code class="language-sql">WITH latest_jobs AS (
  SELECT
    workspace_id,
    job_id,
    name
  FROM system.lakeflow.jobs
  QUALIFY ROW_NUMBER() OVER (
    PARTITION BY workspace_id, job_id
    ORDER BY change_time DESC
  ) = 1
),
run_cost AS (
  SELECT
    workspace_id,
    usage_metadata.job_id AS job_id,
    usage_metadata.job_run_id AS run_id,
    MAX_BY(usage_metadata.job_name, usage_end_time) AS billing_job_name,
    MAX_BY(identity_metadata.run_as, usage_end_time) AS run_as_identity,
    currency_code,
    SUM(estimated_list_cost) AS run_estimated_list_cost,
    MAX(usage_end_time) AS last_billed_at
  FROM priced_usage
  WHERE billing_origin_product = 'JOBS'
    AND usage_metadata.job_id IS NOT NULL
    AND usage_metadata.job_run_id IS NOT NULL
    AND usage_date >= CURRENT_DATE() - INTERVAL 32 DAYS
    AND usage_date &#x3C; CURRENT_DATE() - INTERVAL 1 DAY
  GROUP BY
    workspace_id,
    usage_metadata.job_id,
    usage_metadata.job_run_id,
    currency_code
  HAVING ABS(SUM(usage_quantity)) > 0
),
terminal_state AS (
  SELECT
    workspace_id,
    job_id,
    run_id,
    result_state,
    period_end_time
  FROM system.lakeflow.job_run_timeline
  WHERE result_state IS NOT NULL
    AND period_end_time >= CURRENT_TIMESTAMP() - INTERVAL 32 DAYS
  QUALIFY ROW_NUMBER() OVER (
    PARTITION BY workspace_id, job_id, run_id
    ORDER BY period_end_time DESC
  ) = 1
)

SELECT

  cost.workspace_id,

  COALESCE(
    cost.billing_job_name,
    jobs.name,
    CONCAT('job ', cost.job_id)
  ) AS job_name,
  cost.job_id,
  cost.run_id,
  state.result_state,
  cost.run_as_identity,
  cost.currency_code,
  ROUND(cost.run_estimated_list_cost, 2)
    AS failed_run_estimated_list_cost,
  state.period_end_time AS terminal_at,
  cost.last_billed_at
FROM run_cost AS cost
JOIN terminal_state AS state
  ON cost.workspace_id = state.workspace_id
 AND cost.job_id = state.job_id
 AND cost.run_id = state.run_id
LEFT JOIN latest_jobs AS jobs
  ON cost.workspace_id = jobs.workspace_id
 AND cost.job_id = jobs.job_id
WHERE state.result_state IN ('ERROR', 'FAILED', 'TIMED_OUT')
ORDER BY failed_run_estimated_list_cost DESC;
</code></pre>
<p>The query deliberately does not price the failed part of a run that was later repaired. A repaired run can carry several terminal states under one <code>run_id</code>. Pricing only the failed attempts needs the start and end of each attempt. For that, use the "Retry patterns" query in the Databricks <a href="https://docs.databricks.com/aws/en/admin/system-tables/jobs-cost">jobs cost monitoring docs</a>.</p>
<h2>How Much of Your Databricks Cost Carries a Valid Team Tag?</h2>
<p>Now that you know where and what, the next question is who. Tags answer it, but only when the resources carry them. Measure tag coverage by cost, not by row count:</p>
<pre><code class="language-sql">WITH valid_teams AS (
  SELECT LOWER(team) AS team
  FROM VALUES
    ('analytics'),
    ('finance'),
    ('platform')
  AS teams(team)
),

classified_usage AS (
  SELECT
    currency_code,
    NULLIF(TRIM(LOWER(custom_tags['team'])), '') AS team,
    estimated_list_cost
  FROM priced_usage
  WHERE usage_date >= CURRENT_DATE() - INTERVAL 31 DAYS
    AND usage_date &#x3C; CURRENT_DATE() - INTERVAL 1 DAY
),
coverage AS (
  SELECT
    usage.currency_code,
    CASE
      WHEN usage.team IS NULL THEN 'missing'

      WHEN valid.team IS NULL THEN 'invalid'
      ELSE 'valid'
    END AS tag_status,
    COALESCE(usage.team, '(missing)') AS team,
    usage.estimated_list_cost
  FROM classified_usage AS usage
  LEFT JOIN valid_teams AS valid
    ON usage.team = valid.team
),
coverage_summary AS (
  SELECT
    currency_code,
    tag_status,
    team,
    SUM(estimated_list_cost) AS estimated_list_cost
  FROM coverage
  GROUP BY currency_code, tag_status, team
)

SELECT
  currency_code,
  tag_status,
  team,
  ROUND(estimated_list_cost, 2) AS estimated_list_cost,
  ROUND(
    100 * estimated_list_cost
      / SUM(estimated_list_cost) OVER (PARTITION BY currency_code),
    2
  ) AS pct_of_estimated_list_cost
FROM coverage_summary
ORDER BY currency_code, estimated_list_cost DESC;
</code></pre>
<p>This query catches missing and invalid values. It cannot see a wrong-but-valid tag. That happens when a user has several serverless usage policies and picks the wrong one. If the user does not choose, Databricks can fall back to the first policy alphabetically. The result is a valid-looking tag that points at the wrong team.</p>
<p>Use <code>usage_metadata.usage_policy_id</code> to trace serverless usage back to its policy. To catch a wrong tag, keep a versioned table that maps each resource to its responsible team, and compare the tag against it.</p>
<h2>Which User or Service Principal Ran the Workload?</h2>
<p>The last thing I'd check is who ran the work. <code>identity_metadata</code> holds that answer, but its meaning changes by product. Treat it as evidence, not as the team that owns the budget:</p>
<pre><code class="language-sql">WITH classified_identity AS (

  SELECT
    billing_origin_product,
    CASE
      WHEN billing_origin_product = 'ALL_PURPOSE'
        THEN 'compute_creator'
      WHEN billing_origin_product = 'SQL'
       AND identity_metadata.owned_by IS NOT NULL
        THEN 'warehouse_owner'
      WHEN identity_metadata.run_as IS NOT NULL
        THEN 'run_as'
      WHEN identity_metadata.created_by IS NOT NULL
        THEN 'app_or_agent_creator'
      ELSE 'unavailable'
    END AS identity_basis,
    CASE
      WHEN billing_origin_product = 'ALL_PURPOSE'
        THEN identity_metadata.run_as
      WHEN billing_origin_product = 'SQL'
       AND identity_metadata.owned_by IS NOT NULL
        THEN identity_metadata.owned_by
      WHEN identity_metadata.run_as IS NOT NULL
        THEN identity_metadata.run_as
      WHEN identity_metadata.created_by IS NOT NULL
        THEN identity_metadata.created_by
      ELSE '(unavailable)'
    END AS identity_value,
    currency_code,
    estimated_list_cost
  FROM priced_usage
  WHERE usage_date >= CURRENT_DATE() - INTERVAL 31 DAYS
    AND usage_date &#x3C; CURRENT_DATE() - INTERVAL 1 DAY
)
SELECT
  billing_origin_product,
  identity_basis,
  COALESCE(identity_value, '(unavailable)') AS identity_value,
  currency_code,
  ROUND(SUM(estimated_list_cost), 2) AS estimated_list_cost
FROM classified_identity
GROUP BY
  billing_origin_product,
  identity_basis,
  COALESCE(identity_value, '(unavailable)'),
  currency_code
ORDER BY estimated_list_cost DESC;
</code></pre>
<p>The identity field means something different on each product:</p>
<table>
<thead>
<tr>
<th>Product</th>
<th>Field</th>
<th>What it identifies</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jobs compute and serverless jobs</td>
<td><code>run_as</code></td>
<td>The configured user or service principal</td>
</tr>
<tr>
<td>All-purpose compute</td>
<td><code>run_as</code></td>
<td>The identity that created the compute, not its current owner</td>
</tr>
<tr>
<td>SQL warehouses</td>
<td><code>owned_by</code></td>
<td>The warehouse owner, not the person who submitted each query</td>
</tr>
</tbody>
</table>
<p>A service principal often appears as an opaque application ID, so keep a governed directory that maps each one to a name and a team. Use identity to investigate, and let your ownership model decide whose budget it is.</p>
<h2>Five Ways a Databricks System Tables Cost Query Goes Wrong</h2>
<p>Every query above will run and return a number. Each can also be wrong in a way that looks right, so check these five before you act on a result.</p>
<p><strong>A task-timeline join multiplies cost.</strong> <code>system.lakeflow.job_task_run_timeline</code> has a row per task run per hour. Join billing rows to it on <code>job_id</code> alone, and every usage row fans out across every task. Aggregate both sides to a shared grain first, normally <code>workspace_id</code>, <code>job_id</code>, <code>job_run_id</code> and a time bucket, then join.</p>
<p><img class="blog-fig-light" src="/blog/how-to-find-out-what-databricks-is-costing-you-with-system-tables/fig-2.svg" alt="Diagram titled Match the grain before you sum the cost. On the safe side, billing usage grouped by workspace_id, job_id and job_run_id joins on the full run key to one terminal job-run row where result_state is not null, giving one cost total per completed run. On the unsafe side, one billing usage row costing 10 dollars joins on job_id only to three task rows of 10 dollars each, so SUM(cost) returns 30 dollars. A note says a query can run successfully and still be wrong."> </p>
<p><strong>Driver and worker rows split by node type.</strong> When a cluster's driver and workers use the same instance type, Databricks combines their usage into one record. When they differ, usage appears in separate records. A <code>SUM</code> over all rows is fine, but a query that assumes one row per cluster silently undercounts. Both records carry the same <code>usage_metadata.cluster_id</code>, so grouping by that ID restores the total.</p>
<p><img class="blog-fig-light" src="/blog/how-to-find-out-what-databricks-is-costing-you-with-system-tables/fig-3.svg" alt="Diagram titled Rows split only when the instance types differ. Cluster A uses the same instance type for driver and workers and produces one usage row with usage_metadata.cluster_id clus-A. Cluster B uses different instance types and produces two usage rows, the driver on i3.xlarge and the workers on r5.2xlarge, both with cluster_id clus-B. A query that assumes one row per cluster undercounts cluster B, and grouping by cluster_id restores the total."> </p>
<p><strong><code>usage_metadata</code> changes by workload type.</strong> A grouping can silently drop records when the field you selected is not populated for that compute type. The all-purpose caveat above is one case of this. Before you group on any nested field, check what share of the base cost has that field populated.</p>
<p><strong>Regional scope breaks enrichment without breaking the query.</strong> The usage table is account-wide, while the Lakeflow job and compute tables are regional. A left join keeps the full total but leaves names blank for workspaces outside the current region. An inner join drops those costs. Run regional enrichment in each region and union the results.</p>
<p><strong>The number is still list price, not the invoice.</strong> Contracted rates, commitments, credits, taxes, corrections and cloud infrastructure costs all sit between the two. Use the invoice for the financial close and the system tables for day-to-day analysis.</p>
<h2>How Do I Check the Cost Total Before I Share It?</h2>
<p>Before I'd trust any of this, I'd run a conservation check. Establish a base total for one closed period, enrich it, and confirm the total did not change. An unexpected increase means fan-out. An unexpected decrease means a join or a filter dropped usage.</p>
<p><img class="blog-fig-light" src="/blog/how-to-find-out-what-databricks-is-costing-you-with-system-tables/fig-4.svg" alt="Flowchart titled Enrichment must leave the base total unchanged. Step 1 sums priced_usage for one closed period. Step 2 adds job, team or compute metadata after pre-aggregating both sides to one grain. Step 3 asks whether the total changed. If no, step 4 publishes the breakdown with its scope and limitations. If yes, stop and inspect the join for fan-out, dropped rows, missing prices, regional gaps or mixed units, then fix it and rerun from step 2."> </p>
<p>Because the price join is an inner join, also run this anti-join to find usage rows with no matching price. A trustworthy result is zero rows, or only rows you can explain:</p>
<pre><code class="language-sql">SELECT
  usage.sku_name,
  usage.cloud,
  usage.usage_unit,
  MIN(usage.usage_end_time) AS first_unpriced_usage,
  MAX(usage.usage_end_time) AS last_unpriced_usage,
  SUM(usage.usage_quantity) AS unmatched_usage_quantity
FROM system.billing.usage AS usage
LEFT ANTI JOIN system.billing.list_prices AS list_prices
  ON usage.account_id = list_prices.account_id
 AND usage.sku_name = list_prices.sku_name
 AND usage.cloud = list_prices.cloud
 AND usage.usage_unit = list_prices.usage_unit
 AND usage.usage_end_time >= list_prices.price_start_time
 AND (
      list_prices.price_end_time IS NULL
      OR usage.usage_end_time &#x3C; list_prices.price_end_time
 )
WHERE usage.usage_date >= CURRENT_DATE() - INTERVAL 31 DAYS
  AND usage.usage_date &#x3C; CURRENT_DATE() - INTERVAL 1 DAY
GROUP BY usage.sku_name, usage.cloud, usage.usage_unit
HAVING ABS(SUM(usage.usage_quantity)) > 0
ORDER BY last_unpriced_usage DESC;
</code></pre>
<p>Keep two habits on every query. Show <code>usage_unit</code> beside any <code>usage_quantity</code>, and call a value <code>dbus</code> only after you filter to <code>usage_unit = 'DBU'</code>.</p>
<h2>What Do I Do With Each Answer?</h2>
<table>
<thead>
<tr>
<th>Question</th>
<th>Query above</th>
<th>What to do next</th>
</tr>
</thead>
<tbody>
<tr>
<td>Where did the money go?</td>
<td>Workspaces and SKUs</td>
<td>Investigate the highest-cost workspace and SKU first</td>
</tr>
<tr>
<td>Which jobs are driving it?</td>
<td>Two seven-day job windows</td>
<td>Separate frequency from cost per run, then check failures</td>
</tr>
<tr>
<td>Which failures burned money?</td>
<td>Failed job runs</td>
<td>Fix the expensive failures before anything else</td>
</tr>
<tr>
<td>Whose budget is it?</td>
<td>Team tag coverage</td>
<td>Enforce tags and investigate wrong-but-valid ownership</td>
</tr>
<tr>
<td>Who ran it?</td>
<td>Identity</td>
<td>Resolve service principals and map identity to a team</td>
</tr>
</tbody>
</table>
<p>When the answer is one expensive job cluster, <a href="/blog/right-sizing-databricks-job-clusters-automatically">right-sizing Databricks job clusters automatically</a> covers the next step.</p>
<h2>How Altimate Keeps These Databricks Cost Views Current</h2>
<p>The system tables hold the raw data, and Governance Hub gives you the baseline view. Maintaining these queries as your own Databricks cost dashboard takes ongoing work. <a href="/product-highlights/databricks-cost-breakdown-workspace-sku-cluster">Altimate's Databricks cost breakdown</a> keeps the workspace, SKU, resource and trend views up to date. It also connects expensive resources to its tuning workflow.</p>
<p>Altimate does not change the underlying facts. List price is still not the invoice. Shared all-purpose compute still lacks per-job attribution, and identity still needs mapping to financial ownership.</p>
<h2>How to Follow the Cost Trail in Your Own Account</h2>
<p>Pull up your own account and follow the trail through the Databricks system tables in order. Start wide, then narrow to the job, the failure and the team. Check the total before you act on it, so the number you take to FinOps is one you can defend.</p>
<h2>Frequently Asked Questions</h2>
<h3>What are Databricks system tables?</h3>
<p>Databricks system tables are tables in the <code>system</code> catalog that hold your account's operational data. For cost, <code>system.billing.usage</code> logs every billable event and <code>system.billing.list_prices</code> holds the rate for each SKU. The <code>system.lakeflow</code> tables hold jobs and job runs.</p>
<h3>Do Databricks system tables show cost in dollars?</h3>
<p>No. <code>system.billing.usage</code> stores usage quantities, and no column in the table holds a cost. You get an estimated list cost by joining <code>usage_quantity</code> to the rate in <code>system.billing.list_prices</code> on the price's effective window.</p>
<h3>Why does a system tables cost total differ from the Databricks invoice?</h3>
<p>The system tables give you list price. Contracted rates, commitments, credits, taxes, corrections and cloud infrastructure costs all sit between list price and the invoice. Use the invoice for the financial close and the system tables for day-to-day analysis.</p>
<h3>Can I see all-purpose compute cost per job?</h3>
<p>No. Jobs on all-purpose compute or SQL warehouses are not billed as jobs, so they do not appear in a query on <code>usage_metadata.job_id</code>. For all-purpose compute, <code>run_as</code> names the identity that created the compute.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/how-to-find-out-what-databricks-is-costing-you-with-system-tables/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Idle Databricks Model Serving and Vector Search Endpoints Billed for Nothing. Check Yours</title>
    <link>https://altimate.ai/blog/databricks-model-serving-cost-idle-vector-search</link>
    <guid isPermaLink="true">https://altimate.ai/blog/databricks-model-serving-cost-idle-vector-search</guid>
    <pubDate>Wed, 21 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Anusha Sharma</dc:creator>
    <category>Databricks</category>
    <category>databricks cost</category>
    <category>AI costs</category>
    <category>finops</category>
    <description>Databricks Model Serving cost does not stop when an AI project does. Three idle endpoints cost about $194,000 over ten months, and orphaned Vector Search indexes billed for a year. How each happens, and a five-minute check.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/databricks-model-serving-cost-idle-vector-search/cover.jpg" alt="Idle Databricks Model Serving and Vector Search Endpoints Billed for Nothing. Check Yours" /></p>
<p>Model Serving and Vector Search endpoints on Databricks can keep billing after the project that used them has ended. A project like that usually runs on separate pieces. A model endpoint answers requests. If it looks things up in your documents, a search index serves those lookups. When the project shuts down, those pieces do not always go with it. In customer workspaces we found three idle model endpoints that cost about $194,000 over ten months, and Vector Search endpoints that billed for about a year.</p>
<p>Two mechanisms explain both cases:</p>
<ol>
<li><strong>Idle Model Serving.</strong> Provisioned-throughput endpoints bill for their capacity continuously, whether or not anything calls them. The billing mode itself separates cost from usage.</li>
<li><strong>Orphaned Vector Search.</strong> A Vector Search endpoint is not tied to the agent or model that queries it. Delete the agent, and the endpoint and its indexes keep running and billing until someone removes them.</li>
</ol>
<p>We confirmed both with direct evidence: invocation counts for Model Serving and lifecycle records for Vector Search. Neither finding is an inference from a flat bill.</p>
<p>Wasted cloud spend is a known problem well beyond AI. Flexera's <a href="https://info.flexera.com/CM-REPORT-State-of-the-Cloud">2026 State of the Cloud report</a> puts estimated waste at 29%, the first increase in five years, and ties it to AI workloads. These two cases stood out for their mechanism. Each one is a deliberate design choice with a side effect nobody accounted for. For the classic-compute side of Databricks waste, see <a href="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill">six levers that cut the Databricks bill</a>.</p>
<h2>What Do Databricks Model Serving and Vector Search Do?</h2>
<ul>
<li><strong><a href="https://docs.databricks.com/aws/en/machine-learning/model-serving/">Model Serving</a></strong> is how Databricks hosts a model so other apps can call it. That can be a model your team built, an agent, or an LLM from Databricks or another provider.</li>
<li><strong><a href="https://docs.databricks.com/aws/en/generative-ai/vector-search">Vector Search</a></strong> is what an agent uses to look things up in your own documents before it answers. Your documents become an index, and the index lives on a Vector Search endpoint. Databricks now calls this product AI Search.</li>
</ul>
<p>The first problem sits on the Model Serving side. Some endpoints hold capacity whether or not anyone calls them, so an endpoint set up for a test and forgotten keeps billing. The second sits on the Vector Search side. The endpoint is not tied to the agent that used it. Deleting the agent leaves the endpoint running.</p>
<h2>Why Does Databricks Model Serving Cost Money When Idle?</h2>
<p>Not every Model Serving endpoint costs money when nobody uses it. Databricks Model Serving pricing for LLMs has three billing modes through the <a href="https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/">Foundation Model APIs</a>. Pay-per-token bills for the tokens you actually use, so an unused endpoint costs nothing. Provisioned throughput bills for dedicated capacity by the hour, whether or not anything calls it. It comes in two kinds: on-demand, with no term commitment, and reserved, for a fixed term.</p>
<p><img class="blog-fig-light" src="/blog/databricks-model-serving-cost-idle-vector-search/fig-1.svg" alt="Chart titled Provisioned throughput keeps billing after requests stop. Two panels show requests falling over six periods. Under pay-per-token, the cost bars fall with the requests to about zero. Under provisioned throughput, the cost bars stay flat after requests stop. A note says provisioned throughput bills for allocated capacity by the hour, not for usage."> </p>
<table>
<thead>
<tr>
<th>Billing behavior</th>
<th>What you pay for</th>
<th>Cost when nobody calls it</th>
</tr>
</thead>
<tbody>
<tr>
<td>Pay-per-token</td>
<td>The tokens you actually use</td>
<td>Nothing</td>
</tr>
<tr>
<td>On-demand provisioned throughput</td>
<td>Allocated capacity, with no term commitment</td>
<td>The allocated capacity, until you scale it down or remove it</td>
</tr>
<tr>
<td>Reserved provisioned throughput</td>
<td>A fixed-term capacity reservation</td>
<td>The full reservation, until the term ends</td>
</tr>
<tr>
<td>Custom model, scale-to-zero on</td>
<td>The compute it runs</td>
<td>Nothing, after 30 minutes without traffic</td>
</tr>
<tr>
<td>Custom model, scale-to-zero off</td>
<td>The compute it runs</td>
<td>The minimum warm capacity</td>
</tr>
</tbody>
</table>
<p>Provisioned throughput is often the right choice for production. It is also why an endpoint built for a test and never taken down keeps billing for its capacity, with nothing to prompt a review.</p>
<p>Custom models, which include your own models and agents, bill for the compute they run. <a href="https://docs.databricks.com/aws/en/machine-learning/model-serving/custom-models#endpoint-scaling-expectations">Scale-to-zero is optional</a> for them, and an endpoint only scales down after 30 minutes without traffic. With scale-to-zero off, a minimum amount of capacity stays warm so the endpoint can answer quickly. That capacity bills even when no one calls it.</p>
<p>In customer workspaces, we found provisioned-throughput endpoints that had run for months with zero invocations. Three of them ran for about ten months at a combined cost of about $20,000 a month, about $194,000 in total before anyone addressed them. Finding them was the hard part. Once the pattern was visible, the fix was straightforward.</p>
<p><img class="blog-fig-light" src="/blog/databricks-model-serving-cost-idle-vector-search/fig-2.svg" alt="Table titled Three endpoints, zero invocations, about $194,000, for one customer. Provisioned-throughput endpoints with zero invocations: 3. How long they ran before anyone addressed them: about 10 months. Combined cost while running: about $20,000 a month. Total before it was addressed: about $194,000. A note says the figures are rounded and that the same check first returned 9,000-plus and 144 million requests on two endpoints with known traffic."> </p>
<p>The fix comes down to two calls:</p>
<ul>
<li><strong>You are sure the endpoint is not needed.</strong> Decommission it.</li>
<li><strong>You have any doubt.</strong> Scale it to zero or lower its minimum capacity, leave it for a while, and decommission it once you are sure.</li>
</ul>
<p>If the endpoint is on reserved capacity, the saving comes when the term ends, so do not renew it.</p>
<p>The zero was a direct count. With usage tracking turned on, an <a href="https://docs.databricks.com/aws/en/ai-gateway/">AI Gateway</a> setting, Model Serving logs every request made to an endpoint. So we read zero requests over the full tracked period of each endpoint. To test the check itself, we first ran it against two endpoints with known traffic. One returned just over 9,000 requests and the other 144 million, before we trusted a zero from the same method.</p>
<h2>Why Does Vector Search Outlive the Agent It Served?</h2>
<p>A retrieval-augmented agent answers from your own documents instead of guessing. It runs on two separate resources. A model endpoint talks to the user. A Vector Search endpoint holds the searchable index of those documents. Nothing ties the two together.</p>
<p><img class="blog-fig-light" src="/blog/databricks-model-serving-cost-idle-vector-search/fig-3.svg" alt="Diagram titled Delete the agent and its search index keeps billing. Before, with the agent live, a client question goes to the model endpoint, which retrieves from the Vector Search index. After the agent is deleted, the model endpoint is gone, the index has no path in, and the index is still billing. A note says billing starts once an index exists and stops 24 hours after the last index is deleted."> </p>
<p>Delete the agent or its model endpoint, and the Vector Search endpoint and its indexes keep running. Databricks Vector Search pricing starts once an index exists and stops 24 hours after the last index is deleted. The endpoint keeps billing for its provisioned capacity even when nothing queries it. Nothing tells it that its agent is gone.</p>
<p>At a marketing analytics company, several Vector Search endpoints had billed this way for close to a year before anyone identified the pattern. Decommissioning them saved more than $70,000 a year.</p>
<p>This surface is larger than it was a year or two ago. Retrieval-augmented systems moved from experiments to production infrastructure quickly. Not every pilot survives. A project that was built, tested and abandoned is a candidate for exactly this problem: a retrieval index with no agent left to serve.</p>
<h2>How We Found the Orphaned Endpoints</h2>
<p>Nothing links a Vector Search endpoint to the agent it served. So we matched each Vector Search endpoint that was still billing to a model endpoint with the same name. That caught some orphans and missed most of them, because the two names often differ slightly. So we loosened the match to allow for that.</p>
<p>Not every flagged endpoint was equally certain, so we sorted them into three groups:</p>
<ul>
<li><strong>Confirmed orphans</strong> had an explicit record that the parent agent was deleted.</li>
<li><strong>Unverified endpoints</strong> had the same flat billing but no record either way.</li>
<li><strong>Do-not-touch endpoints</strong> still had a live agent in production, so removing them would have broken something.</li>
</ul>
<p><img class="blog-fig-light" src="/blog/databricks-model-serving-cost-idle-vector-search/fig-4.svg" alt="Diagram titled Three groups, and only one is safe to delete. Confirmed orphans have an explicit record that the parent agent was deleted. Unverified endpoints have the same flat billing but no record either way. Do-not-touch endpoints still serve a live agent in production. At a marketing analytics company, the endpoints billed unnoticed for about 1 year, and decommissioning them saved more than $70,000 a year."> </p>
<p>Across the confirmed and unverified endpoints, the daily bill was nearly identical from one endpoint to the next. There was no single large offender, only many similarly sized ones. That made the cost easy to overlook and expensive to ignore.</p>
<h2>How to Check Your Own Databricks Workspace in Five Minutes</h2>
<ol>
<li><strong>Model Serving.</strong> List your provisioned-throughput endpoints and pull each one's request count for the last 90 days from its invocation log. First check that usage tracking has been on for the endpoint for the whole 90 days, because a zero from a period without tracking tells you nothing. Any endpoint at zero is a candidate for scale-to-zero or decommissioning.</li>
<li><strong>Vector Search.</strong> Pull every Vector Search endpoint from <code>system.billing.usage</code> that still shows usage in the last few days. Cross-reference it against your live Model Serving endpoints, and treat any endpoint billing with no living counterpart as a candidate. This is a billing-and-lifecycle check, because Vector Search has no per-request invocation log the way Model Serving does.</li>
<li><strong>Before you delete.</strong> Talk to the project owner about anything you cannot confirm.</li>
</ol>
<h2>How Altimate Surfaces This Spend</h2>
<p>These are two patterns we found in real customer environments. We check Databricks tenants for spend that bills while nobody watches it. The review runs continuously, not as a one-time audit. <a href="/use-cases/altimate-for-databricks">Altimate for Databricks</a> surfaces each finding as an opportunity, sizes the saving and shows when it was first detected. The <a href="/product-highlights/databricks-cost-breakdown-workspace-sku-cluster">Databricks cost breakdown</a> shows where the rest of your Databricks Model Serving cost sits, by workspace and SKU.</p>
<p><strong>Want us to run this same check against your environment?</strong> We will walk through how we surfaced these patterns for other Databricks tenants, at no cost and no obligation.</p>
<p><a href="https://calendly.com/d/cvq6-s45-kqq/altimate-ai-for-databricks-overview">Book a free scan</a></p>
<h2>Frequently Asked Questions</h2>
<h3>Does a Databricks Model Serving endpoint cost money when no one calls it?</h3>
<p>It depends on the billing mode. Pay-per-token bills only for the tokens you use, so an unused endpoint costs nothing. On-demand provisioned throughput bills for allocated capacity until you scale it down or remove it. Reserved provisioned throughput bills the full reservation until the term ends. A custom model endpoint with scale-to-zero off keeps minimum capacity warm and bills for it.</p>
<h3>What is the difference between pay-per-token and provisioned throughput?</h3>
<p>Pay-per-token bills for the tokens a model actually processes. Provisioned throughput bills for dedicated capacity by the hour, either on demand or as a fixed-term reservation. Provisioned throughput often suits production, and an endpoint built for a test on it keeps billing for its capacity.</p>
<h3>Does deleting an agent delete its Vector Search endpoint?</h3>
<p>Deleting an agent leaves its Vector Search endpoint running. A Vector Search endpoint is not tied to the agent or model endpoint that queries it. Billing starts once an index exists and stops 24 hours after the last index is deleted. The endpoint keeps billing after the agent is gone.</p>
<h3>How do you find idle Databricks Model Serving endpoints?</h3>
<p>Turn on usage tracking in AI Gateway, then pull each provisioned-throughput endpoint's request count for the last 90 days from its invocation log. Usage tracking must have been on for the whole period. An endpoint with zero requests is a candidate to scale to zero or decommission.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/databricks-model-serving-cost-idle-vector-search/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Databricks Chargeback With Altimate: Show Each Team Exactly What It Spent</title>
    <link>https://altimate.ai/blog/databricks-finops-chargeback-cost-attribution</link>
    <guid isPermaLink="true">https://altimate.ai/blog/databricks-finops-chargeback-cost-attribution</guid>
    <pubDate>Mon, 19 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Sudhanshu Prajapati</dc:creator>
    <category>Databricks</category>
    <category>databricks cost</category>
    <category>finops</category>
    <category>Cost Optimization</category>
    <description>No field on a Databricks billing record names the team that should pay. Tags fill that gap, but untagged serverless usage and shared all-purpose clusters stay unattributed. Measure your coverage with three SQL queries, then choose between showback and chargeback.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/databricks-finops-chargeback-cost-attribution/cover.jpg" alt="Databricks Chargeback With Altimate: Show Each Team Exactly What It Spent" /></p>
<p>No field on a Databricks billing record names the team that should pay. With one team on Databricks, the monthly bill is enough. With several teams sharing workspaces, that gap blocks the first Databricks FinOps question: who spent what? Databricks cost attribution fills the gap with tags. Two kinds of spend stay unattributed even with tagging enforced. The first is serverless usage from users with no usage policy. The second is shared all-purpose clusters, billed as one unit.</p>
<p>This guide covers how Databricks billing records cost, three SQL queries that measure your tag coverage, and how to handle the spend no tag reaches. It ends with how to choose between showback and chargeback.</p>
<p>Cost attribution assigns Databricks spend to the team or project that incurred it. Showback reports each team's attributed cost while a central budget pays the bill. Databricks chargeback bills each team's budget directly. Both run on the same attribution data, so the same gaps limit both.</p>
<table>
<thead>
<tr>
<th>Term</th>
<th>What it does</th>
<th>What it requires</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cost attribution</td>
<td>Connects usage to a team or project</td>
<td>Tags and a governed owner mapping</td>
</tr>
<tr>
<td>Showback</td>
<td>Reports each team's cost</td>
<td>Attributed cost, with shared amounts shown separately</td>
</tr>
<tr>
<td>Chargeback</td>
<td>Bills each team's budget</td>
<td>Allocation rules, reconciliation, and a dispute process</td>
</tr>
</tbody>
</table>
<p>A query that groups spend by <code>custom_tags['team']</code> is one input to chargeback. It reports which tag each workload carries. It does not decide who pays for shared warehouses, platform jobs, discounts or untagged usage. Those are allocation rules, and chargeback requires them to be defined and documented. The FinOps Foundation calls this the <a href="https://www.finops.org/framework/capabilities/invoicing-chargeback/">invoicing and chargeback capability</a>.</p>
<h2>How Does Databricks Billing Work?</h2>
<p>Classic compute generates two charges per workload. Databricks charges for DBUs (Databricks Units), priced per SKU. The cloud provider charges separately for the VMs, which classic compute provisions in your cloud account. Serverless compute runs in the Databricks-managed serverless compute plane, so the DBU charge is the full cost.</p>
<p>Attribution follows the same split. Tags in <code>system.billing.usage</code> attribute the DBU charge. The VM charge for classic compute appears in the cloud provider's billing export, such as the <a href="https://docs.aws.amazon.com/cur/latest/userguide/what-is-cur.html">AWS Cost and Usage Report</a>.</p>
<p>Databricks propagates default and custom tags to the instances it launches, so you can join the export to Databricks usage on <code>ClusterId</code>. Instances for clusters created from a pool carry pool and workspace tags, not cluster tags. So set team tags for pooled compute on the pool or the workspace. Serverless has no VM charge in your account.</p>
<p>For DBU cost, <code>system.billing.usage</code> records usage quantity per SKU, and <code>system.billing.list_prices</code> records the list price per SKU over time. Joining them gives estimated list cost. How accurately that cost maps to teams depends on tag coverage. The <a href="https://docs.databricks.com/aws/en/admin/system-tables/billing">billable usage system table reference</a> documents every column, and <a href="/blog/understanding-databricks-compute-costs">what DBUs cost per compute type</a> covers the pricing side.</p>
<h2>Why Does Databricks Cost Attribution Depend on Tags?</h2>
<p>The billing record shows what was consumed, not who should pay for it. Tags are the only ownership field on the record. Databricks applies these default tags:</p>
<table>
<thead>
<tr>
<th>Compute type</th>
<th>Default tags</th>
</tr>
</thead>
<tbody>
<tr>
<td>All-purpose compute</td>
<td><code>Vendor, ClusterId, ClusterName, Creator</code></td>
</tr>
<tr>
<td>Jobs compute</td>
<td><code>Vendor, ClusterId, ClusterName, Creator, RunName, JobId</code></td>
</tr>
<tr>
<td>SQL warehouses</td>
<td><code>Vendor, ClusterId, SqlEndpointId, Creator</code></td>
</tr>
<tr>
<td>Pools</td>
<td><code>Vendor, DatabricksInstancePoolId, DatabricksInstancePoolCreatorId</code></td>
</tr>
</tbody>
</table>
<p>These identify the resource and the user who created it. None identifies the team that pays. Custom tags fill that gap. Set a tag such as <code>team</code> or <code>cost-center</code> on a cluster, SQL warehouse or pool, or enforce it with a compute policy. The tag appears in the <code>custom_tags</code> map column of <code>system.billing.usage</code>. Databricks documents the full model in <a href="https://docs.databricks.com/aws/en/admin/account-settings/usage-detail-tags">use tags to attribute and track usage</a>.</p>
<h3>How serverless tagging works</h3>
<p>Serverless workloads are not tagged through compute settings. Their tags come from <a href="https://docs.databricks.com/aws/en/admin/usage/budget-policies">serverless usage policies</a>. An admin creates a policy with tags and assigns users to it, and those users' serverless usage carries the policy's tags in <code>custom_tags</code>. Policies apply to serverless notebooks, jobs, pipelines and model serving endpoints.</p>
<p>Two cases reduce attribution accuracy:</p>
<ul>
<li><strong>No policy assigned.</strong> The user's serverless usage is recorded with an empty <code>custom_tags</code> map.</li>
<li><strong>Several policies assigned.</strong> The user selects a policy when creating the workload. If they do not, Databricks defaults to the first policy in alphabetical order. The resulting tag reflects policy name order, not the intended cost owner. A wrong tag is harder to detect than a missing one, because it passes a null check.</li>
</ul>
<p><img class="blog-fig-light" src="/blog/databricks-finops-chargeback-cost-attribution/fig-1.svg" alt="Flowchart titled Serverless usage without a policy arrives untagged. On the classic compute path, a cluster or warehouse is created, a custom tag such as team=analytics is applied through the UI or a compute policy, and the tags land in the custom_tags map of system.billing.usage, which becomes the team's chargeback line. On the serverless path, a notebook or job runs and the chart asks whether a usage policy is assigned. If yes, the policy's tags reach the same table. If no, custom_tags arrives empty and the spend stays unattributed, with no team and no invoice line."> </p>
<h2>How Do You Measure Your Current Attribution?</h2>
<p>The three queries below show how much spend is attributable today. They require <code>USE</code> and <code>SELECT</code> on the system schemas, or an admin role. The <a href="https://docs.databricks.com/aws/en/admin/system-tables/">system tables documentation</a> lists the exact grants.</p>
<h3>Query 1 shows spend by team and SKU</h3>
<p>Estimated list cost per team tag and SKU for the last 30 days:</p>
<pre><code class="language-sql">SELECT
  u.custom_tags['team'] AS team,
  u.sku_name,
  SUM(u.usage_quantity) AS usage_quantity,
  SUM(u.usage_quantity * lp.pricing.effective_list.default) AS list_cost
FROM system.billing.usage AS u
JOIN system.billing.list_prices AS lp
  ON u.account_id = lp.account_id
  AND u.cloud = lp.cloud
  AND u.sku_name = lp.sku_name
  AND u.usage_unit = lp.usage_unit
  AND u.usage_end_time >= lp.price_start_time
  AND (lp.price_end_time IS NULL OR u.usage_end_time &#x3C; lp.price_end_time)
WHERE u.usage_date >= current_date() - INTERVAL 30 DAYS
GROUP BY u.custom_tags['team'], u.sku_name
ORDER BY list_cost DESC;
</code></pre>
<p>Read the rows where <code>team</code> is NULL first. Their share of total cost is your actual tag coverage. It is often lower than the coverage your tagging policy reports.</p>
<h3>Query 2 shows attribution status</h3>
<p>This query sorts last month's cost into three states. Cost is directly attributable, missing a team tag, or tagged with a value outside the governed owner list. Replace the sample values in <code>valid_cost_owners</code> with your owner list.</p>
<pre><code class="language-sql">WITH valid_cost_owners AS (
  SELECT team
  FROM VALUES ('analytics'), ('finance'), ('ml-platform') AS t(team)
),
priced_usage AS (
  SELECT
    LOWER(TRIM(u.custom_tags['team'])) AS team,
    lp.currency_code,
    u.usage_quantity * lp.pricing.effective_list.default AS estimated_list_cost
  FROM system.billing.usage AS u
  JOIN system.billing.list_prices AS lp
    ON u.account_id = lp.account_id
    AND u.cloud = lp.cloud
    AND u.sku_name = lp.sku_name
    AND u.usage_unit = lp.usage_unit
    AND u.usage_end_time >= lp.price_start_time
    AND (lp.price_end_time IS NULL OR u.usage_end_time &#x3C; lp.price_end_time)
  WHERE u.usage_date >= CAST(ADD_MONTHS(DATE_TRUNC('month', current_date()), -1) AS DATE)
    AND u.usage_date &#x3C; CAST(DATE_TRUNC('month', current_date()) AS DATE)
),
classified AS (
  SELECT
    p.*,
    CASE
      WHEN p.team IS NULL OR p.team = '' THEN 'missing_team_tag'
      WHEN v.team IS NULL THEN 'unrecognized_team_tag'
      ELSE 'directly_attributable'
    END AS attribution_status
  FROM priced_usage AS p
  LEFT JOIN valid_cost_owners AS v
    ON p.team = v.team
)
SELECT
  attribution_status,
  currency_code,
  ROUND(SUM(estimated_list_cost), 2) AS estimated_list_cost,
  ROUND(
    100.0 * SUM(estimated_list_cost)
      / SUM(SUM(estimated_list_cost)) OVER (PARTITION BY currency_code),
    1
  ) AS pct_of_cost
FROM classified
GROUP BY attribution_status, currency_code
ORDER BY estimated_list_cost DESC;
</code></pre>
<p>Do not filter on <code>record_type = 'ORIGINAL'</code>. Databricks writes corrections as a <code>RETRACTION</code> record with a negative <code>usage_quantity</code>, usually followed by a <code>RESTATEMENT</code> record with the corrected values. Summing all record types gives the corrected total.</p>
<p>We ran it on one of our workspaces. 82% of cost was directly attributable, 10% was missing a team tag, and 8% carried a value outside the owner list. So 18% of estimated cost had no confirmed owner.</p>
<p><img class="blog-fig-light" src="/blog/databricks-finops-chargeback-cost-attribution/fig-2.svg" alt="Stacked bar titled 18% of estimated cost had no confirmed owner, for one month on one workspace: 82 percent directly attributable, 10 percent missing a team tag and 8 percent tagged with a value not on the owner list. A note says Query 2 cannot catch a valid but wrong tag, such as one set by the alphabetical policy default, and to compare billed tags with a versioned ownership table."> </p>
<p>The query cannot detect a valid but incorrect tag, such as one assigned by the alphabetical policy default. To catch those, maintain a versioned ownership table with <code>workspace_id</code>, <code>resource_type</code>, <code>resource_id</code>, <code>expected_team</code>, <code>valid_from</code> and <code>valid_to</code>. Then compare the billed tag with the expected owner for each period.</p>
<h3>Query 3 shows spend by identity</h3>
<p><code>identity_metadata.run_as</code> records the identity behind the usage. For jobs compute and serverless jobs, it is the job's run-as user or service principal. For all-purpose compute, it is the identity that created the cluster, not necessarily the user who ran a given workload. On mature platforms, most high-cost rows resolve to service principals, which appear as application IDs. The query below resolves IDs to names.</p>
<p><strong>Before running it:</strong> <code>system.information_schema.users</code> and <code>system.information_schema.service_principals</code> are not among the information schema views Databricks documents. Confirm both exist in your account.</p>
<pre><code class="language-sql">SELECT
  u.identity_metadata.run_as AS principal_id,
  COALESCE(sp.display_name, usr.user_name) AS resolved_name,
  SUM(u.usage_quantity) AS usage_quantity
FROM system.billing.usage AS u
LEFT JOIN system.information_schema.service_principals AS sp
  ON u.identity_metadata.run_as = sp.application_id
LEFT JOIN system.information_schema.users AS usr
  ON u.identity_metadata.run_as = usr.user_name
WHERE u.usage_date >= current_date() - INTERVAL 30 DAYS
GROUP BY u.identity_metadata.run_as, resolved_name
ORDER BY usage_quantity DESC;
</code></pre>
<h2>Where Does Databricks Cost Attribution Break?</h2>
<p>Two categories of spend cannot be fully attributed even with complete tagging. Measure both before chargeback goes live.</p>
<ul>
<li><strong>Shared all-purpose compute.</strong> <code>usage_metadata.job_id</code> and <code>job_run_id</code> are populated for serverless jobs and jobs compute, but not for jobs run on all-purpose compute. When several users or notebooks share an all-purpose cluster, the billing record covers the cluster as a whole. No field splits its cost across the workloads that ran on it. A Databricks community post describes one workaround. It joins <code>system.access.audit</code> command events to billing records. Then it splits each hour's cost by execution time. The result is an estimate, suitable for budget discussions but not for exact allocation. <a href="/blog/databricks-all-purpose-vs-jobs-compute">How job compute and all-purpose compute differ</a> covers when to move a workload off a shared cluster.</li>
<li><strong>Untagged serverless usage.</strong> Serverless usage from users without a usage policy has an empty <code>custom_tags</code> map. No tagging error is involved. This remains the default until policy assignment is part of user onboarding.</li>
</ul>
<h2>How Do You Classify Costs for Chargeback?</h2>
<p>Assign every cost to one of four buckets. The bucket depends on how reliably you can attribute the cost:</p>
<table>
<thead>
<tr>
<th>Bucket</th>
<th>Typical examples</th>
<th>Treatment</th>
</tr>
</thead>
<tbody>
<tr>
<td>Direct</td>
<td>Dedicated jobs compute, a team-owned warehouse, serverless usage with a valid policy</td>
<td>Charge to the governed owner</td>
</tr>
<tr>
<td>Shared</td>
<td>Shared all-purpose clusters, shared SQL warehouses</td>
<td>Apply a documented allocation driver, or report as showback</td>
</tr>
<tr>
<td>Platform</td>
<td>Central monitoring, governance, security, CI/CD</td>
<td>Retain in the platform budget, or allocate by one consistent rule</td>
</tr>
<tr>
<td>Unallocated</td>
<td>Missing tags, invalid values, stale mappings</td>
<td>Hold in an exception account until resolved</td>
</tr>
</tbody>
</table>
<p><img class="blog-fig-light" src="/blog/databricks-finops-chargeback-cost-attribution/fig-3.svg" alt="Diagram titled Every dollar lands in one of four buckets. Direct cost has a valid owner tag and is charged to the governed owner. Shared cost, such as shared all-purpose clusters and warehouses, uses an agreed driver or stays as showback. Platform cost, such as monitoring, governance and CI/CD, is kept central or allocated by one consistent rule. Unallocated cost, with missing, invalid or stale tags, goes to an exception account until resolved. All four reconcile so that direct plus shared plus platform plus unallocated equals the authoritative period cost, which produces auditable team lines."> </p>
<p>Here is one month we measured, with the Databricks charge and the classic-compute cloud cost combined into a $100,000 cost pool:</p>
<table>
<thead>
<tr>
<th>Bucket</th>
<th>Amount</th>
<th>Treatment</th>
</tr>
</thead>
<tbody>
<tr>
<td>Direct</td>
<td>$72,000</td>
<td>Post to the identified owners</td>
</tr>
<tr>
<td>Shared</td>
<td>$12,000</td>
<td>Allocate using an agreed driver</td>
</tr>
<tr>
<td>Platform</td>
<td>$8,000</td>
<td>Retain centrally or allocate by one rule</td>
</tr>
<tr>
<td>Unallocated</td>
<td>$8,000</td>
<td>Hold in an exception account until resolved</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td><strong>$100,000</strong></td>
<td>Must reconcile to the cost pool</td>
</tr>
</tbody>
</table>
<p>Keep unallocated cost in an exception account, with an owner responsible for resolving it. Do not spread it across teams to make totals balance. The reconciliation check is:</p>
<pre><code class="language-plaintext">Direct + Shared + Platform + Unallocated = Authoritative period cost
</code></pre>
<p>Operational reporting often uses list prices while finance requires actual cost. Apply that adjustment at the most granular reliable level: cloud, product or SKU. Do not apply it as one account-wide percentage.</p>
<h2>How Do You Run a Monthly Chargeback Close?</h2>
<p>Dashboards cover in-month visibility. Databricks chargeback needs a controlled monthly close:</p>
<ol>
<li><strong>Freeze a completed month.</strong> <code>ORIGINAL</code> billing records are typically available within 12 hours, and new workspaces can take longer. That timing does not apply to <code>RETRACTION</code> and <code>RESTATEMENT</code> records.</li>
<li><strong>Pull the complete source set.</strong> That is <code>system.billing.usage</code>, <code>system.billing.list_prices</code>, the invoice, cloud billing for classic compute, the owner list and the ownership mapping.</li>
<li><strong>Classify every amount into the four buckets.</strong> Record missing, invalid and mismatched ownership as separate reasons.</li>
<li><strong>Apply versioned allocation rules.</strong> Each rule has a name, an owner, an effective date and a change history.</li>
<li><strong>Reconcile the allocated total to the authoritative cost pool.</strong></li>
<li><strong>Publish team lines with a dispute window.</strong> Record dispute outcomes and update the ownership mapping.</li>
</ol>
<p><img class="blog-fig-light" src="/blog/databricks-finops-chargeback-cost-attribution/fig-4.svg" alt="Six-step flow titled Six steps from a frozen month to team lines: 1, freeze a completed month, not live partial data. 2, pull sources: usage, list prices, the invoice and the cloud bill. 3, classify as direct, shared, platform or unallocated. 4, apply versioned allocation rules and owner mapping. 5, reconcile so the allocated total equals the authoritative cost pool. 6, publish team lines with a dispute window."> </p>
<p>A list-price total that does not match the invoice is not necessarily a broken query. List price may be the wrong financial basis for chargeback. Committed-use discounts (CUDs) and custom contract terms change the actual cost.</p>
<h2>How Do You Choose Between Showback and Chargeback?</h2>
<table>
<thead>
<tr>
<th>Model</th>
<th>Use when</th>
</tr>
</thead>
<tbody>
<tr>
<td>Showback first</td>
<td>Tag coverage is inconsistent, or teams do not yet trust the numbers</td>
</tr>
<tr>
<td>Chargeback</td>
<td>Custom tags and serverless usage policies are already enforced</td>
</tr>
<tr>
<td>Hybrid</td>
<td>Most workloads are tagged, but some teams run heavily on shared all-purpose compute</td>
</tr>
</tbody>
</table>
<p>Hybrid is the most common outcome. Shared all-purpose compute cannot be split exactly, even after tagging is enforced.</p>
<h2>What to Track After Chargeback Goes Live</h2>
<table>
<thead>
<tr>
<th>Metric</th>
<th>What it shows</th>
</tr>
</thead>
<tbody>
<tr>
<td>Directly attributable cost %</td>
<td>Share of cost assigned to a team without allocation</td>
</tr>
<tr>
<td>Missing-owner cost</td>
<td>Spend with no team tag</td>
</tr>
<tr>
<td>Invalid-owner cost</td>
<td>Spend with a team tag that is not on the owner list</td>
</tr>
<tr>
<td>Shared and platform %</td>
<td>Spend that is allocated rather than directly attributed</td>
</tr>
<tr>
<td>Unallocated cost and age</td>
<td>Spend in the exception account, and how long it has been there</td>
</tr>
<tr>
<td>Corrections and disputed lines</td>
<td>Count and value</td>
</tr>
<tr>
<td>Time to resolve an exception</td>
<td>How quickly ownership gaps are closed</td>
</tr>
</tbody>
</table>
<p>These Databricks FinOps metrics show whether attribution coverage improves. A report can reconcile while coverage stays flat.</p>
<h2>How Altimate Tracks Databricks Spend by Team</h2>
<p>For a Databricks FinOps team, the queries above give a point-in-time view. Databricks chargeback needs the same numbers every month, with coverage gaps tracked over time. <a href="/use-cases/altimate-for-databricks">Altimate for Databricks</a> splits spend by team first, then by workspace, SKU, product and user. It rolls every dollar up to an owning team before the invoice arrives. The <a href="/product-highlights/databricks-cost-breakdown-workspace-sku-cluster">Databricks cost breakdown</a> shows the same split from the Summary page down to one warehouse.</p>
<p>It also reports the size of both structural gaps continuously: shared all-purpose compute and untagged serverless usage. It does not close them. Shared all-purpose cost still cannot be split exactly. Serverless usage stays untagged until an admin assigns a usage policy.</p>
<h2>What Databricks FinOps Needs for Chargeback</h2>
<p>Databricks chargeback requires five things:</p>
<ol>
<li>Tags for attribution.</li>
<li>Documented allocation rules for shared and platform cost.</li>
<li>An exception account for unallocated cost.</li>
<li>Reconciliation to the authoritative cost pool.</li>
<li>Published team lines with a dispute process.</li>
</ol>
<p>Measure your Databricks cost attribution coverage with the queries above before you choose between showback, chargeback and a hybrid model. That measurement is where a Databricks FinOps practice starts.</p>
<h2>Frequently Asked Questions</h2>
<h3>What is Databricks chargeback?</h3>
<p>Databricks chargeback bills each team's budget directly for the Databricks spend it incurred. It runs on Databricks cost attribution data from tags. It also needs allocation rules, reconciliation to the authoritative cost pool and a dispute process. Showback reports the same attributed cost while a central budget pays the bill.</p>
<h3>How does Databricks chargeback work?</h3>
<p>Tags in <code>system.billing.usage</code> attribute the DBU charge to a team. Every cost then goes into one of four buckets: direct, shared, platform or unallocated. A monthly close freezes the month, applies versioned allocation rules, reconciles to the authoritative cost pool and publishes team lines with a dispute window.</p>
<h3>Why is my Databricks cost attribution incomplete?</h3>
<p>Two kinds of spend stay unattributed even with tagging enforced. Serverless usage from users with no usage policy arrives with an empty <code>custom_tags</code> map. Shared all-purpose clusters are billed as one unit, with no field that splits their cost across the workloads that ran on them.</p>
<h3>How do you tag serverless usage in Databricks?</h3>
<p>Serverless workloads take their tags from serverless usage policies, not from compute settings. An admin creates a policy with tags and assigns users to it. A user with several policies who does not pick one gets the first policy in alphabetical order.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/databricks-finops-chargeback-cost-attribution/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Your DBU Bill Hides Part of Your Databricks Cluster Cost. Altimate Shows the Rest</title>
    <link>https://altimate.ai/blog/databricks-cluster-cost-beyond-dbu-bill</link>
    <guid isPermaLink="true">https://altimate.ai/blog/databricks-cluster-cost-beyond-dbu-bill</guid>
    <pubDate>Mon, 19 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Manoharan Sridharan</dc:creator>
    <category>Databricks</category>
    <category>databricks cost</category>
    <category>Cost Optimization</category>
    <category>finops</category>
    <description>Your Databricks cluster cost arrives on two bills: DBUs from Databricks and virtual machines from your cloud provider. On job clusters, the cloud bill ran 3.7 times the DBU cost. Here is how to measure both and check your own split.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/databricks-cluster-cost-beyond-dbu-bill/cover.jpg" alt="Your DBU Bill Hides Part of Your Databricks Cluster Cost. Altimate Shows the Rest" /></p>
<p>Your Databricks cluster cost arrives on two bills. Databricks bills you for DBUs, and AWS, Azure or GCP bills you for the machines. Most teams watch only the first one, their Databricks DBU cost. When one of our customers right-sized a scheduled job, the Databricks bill showed $575 saved. The same fix saved $2,121 on the cloud bill, and a DBU-only report never showed it.</p>
<p>We tracked both bills across customer environments in different industries. The goal was to find which workloads hide the most cost on the second bill, and how you can check your own split.</p>
<p>Four facts explain the gap:</p>
<ol>
<li><strong>DBU and cloud infrastructure are two separate billing legs.</strong> Serverless SKUs combine both into one number. Classic and provisioned compute bill them separately.</li>
<li><strong>The infra leg ranged from zero to nearly four times the DBU leg.</strong> The size of the gap tracked the workload type, not the company.</li>
<li><strong>The same right-sizing fix that trims a job's DBU cost also trims its infra cost.</strong></li>
<li><strong>Most tenants do not measure the second leg today.</strong> Reading it means configuring access to tables that Databricks and the cloud provider already expose.</li>
</ol>
<h2>What Is Included in Databricks Cluster Cost?</h2>
<p>A classic compute Databricks bill has two parts. The first is the DBU charge. A DBU is Databricks' metering unit for its platform. The <a href="https://www.databricks.com/product/pricing">Databricks pricing page</a> lists its price for each compute type and tier. The second is the cost of the virtual machines the workload ran on, billed by AWS, Azure or GCP on a separate invoice. On serverless, Databricks runs the machines and folds their cost into the DBU price.</p>
<p><img class="blog-fig-light" src="/blog/databricks-cluster-cost-beyond-dbu-bill/fig-1.svg" alt="Diagram titled Classic compute sends two bills, serverless sends one. On classic and provisioned compute, bill 1 comes from Databricks for DBUs, priced per DBU by compute type and tier, and bill 2 comes from AWS, Azure or GCP for the virtual machines the job ran on. On serverless, one Databricks bill covers DBUs with the machines folded in. A note says pricing guides from Flexera, CloudZero and Cloudchipr put bill 2 at 50 to 100 percent on top of DBUs."> </p>
<p>Pricing guides from Flexera, CloudZero and Cloudchipr put the second leg at 50 to 100 percent on top of DBUs. They suggest budgeting two to three times the DBU-only estimate. That figure is an average across many customers, and an average hides how much the second leg changes from one workload to the next.</p>
<p>So we measured it directly. Auto Tune is our right-sizing engine. It records what each cluster change saved on both legs, for every run. We pulled those records for customers in different industries and split them by compute type.</p>
<table>
<thead>
<tr>
<th>Compute type</th>
<th>How it runs</th>
<th>Who pays for the machines</th>
<th>Where its waste lands</th>
</tr>
</thead>
<tbody>
<tr>
<td>Job clusters</td>
<td>Created for one scheduled run, then torn down</td>
<td>You, on the cloud bill</td>
<td>Size: an oversized VM fleet, billed in infra</td>
</tr>
<tr>
<td>All-purpose clusters</td>
<td>Long-lived, shared and used from notebooks</td>
<td>You, on the cloud bill</td>
<td>Duration: idle runtime, billed in DBUs</td>
</tr>
<tr>
<td>Serverless</td>
<td>One bundled rate</td>
<td>Databricks, inside the DBU price</td>
<td>Nothing to split</td>
</tr>
</tbody>
</table>
<p>For a closer look at the first two, see <a href="/blog/databricks-all-purpose-vs-jobs-compute">how job compute and all-purpose compute differ in cost</a>.</p>
<h2>How Big Is the Infra Half of Your Databricks Bill?</h2>
<p>The infra half depends on what you run. We broke one tenant's realized savings data out by compute type. Infra ran 3.7x the DBU cost on job clusters. It ran 0.4x on all-purpose clusters and zero on serverless.</p>
<p><img class="blog-fig-light" src="/blog/databricks-cluster-cost-beyond-dbu-bill/fig-2.svg" alt="Bar chart titled The infra bill depends on the compute type. Each compute type shows a DBU bar scaled to 1 beside an infra bar: job clusters 3.7x, all-purpose clusters 0.4x, serverless 0x because the infra cost is bundled into the DBU rate. A note says the figures come from one tenant's realized-savings ledger, rounded, and that other tenants ranged from under 1x to 2.5x on job clusters and under 0.2x on all-purpose clusters."> </p>
<p>A single rule of thumb, "infra is roughly 2x DBU", is close on average and wrong for every compute type above. The gap comes from how each cluster type wastes money. Databricks provisions a job cluster fresh for every run. A policy default sets its size, not what the run needed. So a job cluster wastes money on size. An all-purpose cluster is already the size someone picked and sits idle between uses, so its waste is duration.</p>
<p>We checked the pattern in other customer environments, each in a different industry. It held. In one, job-cluster infra cost ran as high as 2.5x the DBU cost. In another, it stayed under 1x. All-purpose clusters stayed under 0.2x everywhere. Databricks job clusters always carried more infra cost than all-purpose clusters.</p>
<p>Two teams with the same DBU bill can therefore have very different infra bills. A team running mostly job clusters has far more cost going uncounted than one running mostly serverless warehouses.</p>
<h2>Why Does a Smaller Job Cluster Cut Both Bills?</h2>
<p>Job-cluster waste comes from the size of the cluster. So the fix that trims the DBU line also trims the infra line on the same run. Both bills follow from one number, the size of the cluster.</p>
<p>One job in the first customer environment shows this. It is the largest single contributor to the 3.7x figure above, and roughly 80 percent of that tenant's job-cluster savings. Auto Tune applied one recommendation to it, then kept applying it automatically across roughly 9,960 later runs of the same job. The realized total from that one decision was <strong>$575 in DBU savings and $2,121 in infra savings</strong>, tracked in the same ledger against the same runs.</p>
<p><img class="blog-fig-light" src="/blog/databricks-cluster-cost-beyond-dbu-bill/fig-3.svg" alt="Chart titled One recommendation cut both bills on the same runs. One Auto Tune recommendation, applied automatically across about 9,960 runs of one job, produced 75 in DBU savings and ,121 in infra savings. A DBU-only report shows only the 75. The infra to DBU saving ratio is 3.7 to 1, the tenant's job-cluster average."> </p>
<p>That split lands almost exactly on the tenant's 3.7x job-cluster average. Nobody went looking for infra savings separately. A smaller cluster meters fewer DBUs and rents fewer VM-hours at the same time. The DBU-side fixes your team has already shipped are likely buying infra savings that nobody counts. Where the ratio runs two to four times, that is two to four uncounted dollars for every dollar claimed. <a href="/blog/right-sizing-databricks-job-clusters-automatically">How Auto Tune right-sizes job clusters</a> covers the right-sizing side in detail.</p>
<h2>How to Track Databricks Infra Cost Next to DBUs</h2>
<p>Most Databricks tenants do not measure the infra leg yet. The cost is measurable, and reading it means turning something on. The DBU side already sits in the <a href="https://docs.databricks.com/aws/en/admin/system-tables/billing"><code>system.billing.usage</code> system table</a>. The machine side sits in your cloud provider's billing export, such as the <a href="https://docs.aws.amazon.com/cur/latest/userguide/what-is-cur.html">AWS Cost and Usage Report</a>. Reading both takes one account-level configuration step, because Databricks and the cloud provider already expose the tables.</p>
<p>That configuration step is the gap we close. We walk a customer through the account-side setup once and ingest the infra-cost tables next to their DBU billing. The two then sit side by side, per job and per cluster, in one platform, so nobody reconciles two exports by hand. From there the customer gets one total cost of ownership number and tracks and forecasts DBU and infra separately. The same right-sizing levers that already pull DBU savings then show their effect on the infra number too.</p>
<p><img class="blog-fig-light" src="/blog/databricks-cluster-cost-beyond-dbu-bill/fig-4.svg" alt="Diagram titled Join cloud cost tables to DBU billing, per job. Databricks DBU billing, already flowing, and cloud infra cost tables, which need account setup, are joined per job and per cluster. The joined data gives total cost of ownership with DBU and infra together, DBU and infra tracked and forecast separately, and right-sizing credited on both meters. A note gives an example job with 82 in DBU savings and ,740 in infra savings."> </p>
<p>Another customer environment connected its infra cost data. One job there showed $782 in DBU savings and $1,740 in infra savings. Both numbers landed in the platform's savings log automatically.</p>
<h2>How to Check Your Own DBU and Infra Split</h2>
<p>You can run three checks on your own Databricks cluster cost this week.</p>
<ol>
<li><strong>Split DBU from infra by compute type.</strong> Pull your cost or savings data and break job clusters out from all-purpose clusters before you trust one blended ratio. Leave serverless out. Databricks bundles its infra cost into the DBU rate. Expect the widest gap on job clusters.</li>
<li><strong>Check whether infra cost is tracked at all.</strong> Look for the actual-cost table that your cloud provider and Databricks expose. An empty or missing table means nobody turned on an account-level configuration step. It is not a hard limit.</li>
<li><strong>Find the infra delta of one fix you already shipped.</strong> Pick a right-sizing change on a job cluster and look for its infra-cost change on those same runs. Tooling that reports only DBUs will not show it. That saving goes uncounted.</li>
</ol>
<h2>Why Do You Need Both the DBU and the Infra Leg?</h2>
<p>Savings work that measures only DBUs measures half the bill. On job clusters, a fix that shows a DBU saving very likely produces an uncounted infra saving too. Wire in the infra leg and you get one total cost of ownership number for Databricks cluster cost. You can track and forecast it per job and per cluster. Each fix then gets credit for what it saved on both meters. <a href="/use-cases/altimate-for-databricks">Altimate for Databricks</a> puts both legs in one place, per job and per cluster.</p>
<p><strong>See your own DBU and infra split.</strong> We will show how this gap surfaced in other Databricks tenants and what the setup takes in yours. There is no cost and no obligation.</p>
<p><a href="https://calendly.com/d/cncb-mfh-wpq/demo-request-platform-cost-savings">Book a free scan</a></p>
<h2>Frequently Asked Questions</h2>
<h3>Does Databricks cluster cost include the cloud VMs?</h3>
<p>It does on classic and provisioned compute, which has two parts. Databricks charges for DBUs, priced by compute type and tier. AWS, Azure or GCP charges separately for the virtual machines the workload ran on. On serverless, Databricks runs the machines and folds their cost into the DBU price.</p>
<h3>How much does cloud infrastructure add to the DBU bill?</h3>
<p>It depends on the compute type. Pricing guides put it at 50 to 100 percent on top of DBUs on average. In one tenant's realized savings, infra ran 3.7x the DBU cost on job clusters, 0.4x on all-purpose clusters and zero on serverless.</p>
<h3>Why do Databricks job clusters carry the most infra cost?</h3>
<p>A job cluster is provisioned fresh for every run and sized from a policy default rather than from what the run needed. Its waste is size, an oversized VM fleet, and that lands on the cloud bill. An all-purpose cluster's waste is idle duration, which lands mostly in DBUs.</p>
<h3>Does right-sizing a cluster reduce both DBU and infra cost?</h3>
<p>Right-sizing reduces both. A smaller cluster meters fewer DBUs and rents fewer VM-hours on the same runs. One Auto Tune recommendation ran across roughly 9,960 runs of one job. It saved $575 in DBUs and $2,121 in infra.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/databricks-cluster-cost-beyond-dbu-bill/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Snowflake Cortex Pricing: The AI Bill Your Resource Monitors Miss</title>
    <link>https://altimate.ai/blog/snowflake-cortex-pricing-spend-caps</link>
    <guid isPermaLink="true">https://altimate.ai/blog/snowflake-cortex-pricing-spend-caps</guid>
    <pubDate>Mon, 19 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Yuktha Raman</dc:creator>
    <category>snowflake</category>
    <category>Snowflake Costs</category>
    <category>AI costs</category>
    <description>Snowflake Cortex AI cost bills on tokens, messages, pages and GB indexed, on its own lines, and a resource monitor never sees it. What each service costs, which five you can cap, and how to track the four you cannot.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/snowflake-cortex-pricing-spend-caps/cover.jpg" alt="Snowflake Cortex Pricing: The AI Bill Your Resource Monitors Miss" /></p>
<p>Snowflake Cortex AI cost is climbing fast, and a resource monitor never sees it. Snowflake Cortex pricing bills every AI service on its own line, separate from warehouse compute. Each one meters on tokens, messages, pages or gigabytes of data indexed. If your cost controls predate Cortex, no rule catches that growth.</p>
<p>In short:</p>
<ul>
<li><strong>Four billing units.</strong> Every Cortex AI service bills on tokens, messages, pages processed or GB indexed, never on warehouse time.</li>
<li><strong>Five services accept a hard spend cap.</strong> Four do not, and for those a usage-history view plus a manual monthly review is your only control.</li>
<li><strong>Every cap lags.</strong> A budget action can take up to 8 hours to take effect.</li>
<li><strong>Two credit types.</strong> Snowflake splits the bill into Platform Credits and AI Credits. One quota watches only one type, so capping a person's whole spend takes two quota objects.</li>
</ul>
<p>Every rate below comes from Snowflake's documentation and its <a href="https://www.snowflake.com/legal-files/CreditConsumptionTable.pdf">Service Consumption Table</a>, read in August 2026. Snowflake changes these rates often, so recheck any figure older than a month.</p>
<h2>Why Do Resource Monitors Miss Snowflake Cortex AI Cost?</h2>
<p>Almost every Cortex AI service charges you for something other than warehouse time, and that charge lands on its own line. Snowflake runs Cortex AI calls on its own serverless compute, so none of your warehouses stays up to answer them. A <a href="https://docs.snowflake.com/en/user-guide/resource-monitors">resource monitor</a> watches the credits a warehouse burns. A Cortex AI call never touches that warehouse counter.</p>
<p><img class="blog-fig-light" src="/blog/snowflake-cortex-pricing-spend-caps/fig-1.svg" alt="Diagram titled Resource monitors never see Cortex AI spend. Resource monitors watch warehouse credits, the compute your warehouses burn. Two hybrid exceptions also run on a warehouse: the SQL that Cortex Analyst generates and the Cortex Search refresh. Cortex AI itself runs on Snowflake-managed compute that a resource monitor never sees, and bills on tokens for AI SQL, Fine-Tuning and Cortex Code, messages for Cortex Analyst, pages for Document AI and GB indexed for Cortex Search."> </p>
<p>Two hybrid exceptions exist. The SQL that Snowflake Cortex Analyst writes runs on a warehouse you name. The index-refresh step for Cortex Search also runs on a warehouse. Those two pieces land on the warehouse bill, and the AI calls themselves do not.</p>
<p>So if your only cost controls today are resource monitors, nothing caps your Cortex spend and nothing alerts on it. Two other controls exist, <a href="https://docs.snowflake.com/en/user-guide/budgets">budgets</a> and per-user quotas. Both live under a different admin surface than the resource monitors your team already knows. For the warehouse side of the bill, see <a href="/blog/snowflake-cost-optimization-techniques">12 Snowflake cost optimization techniques</a>.</p>
<h2>What Does Snowflake Cortex Pricing Look Like per Service?</h2>
<p>Snowflake Cortex pricing follows one of four billing units per service, and every rate is on the Service Consumption Table.</p>
<table>
<thead>
<tr>
<th>Service</th>
<th>Billing unit</th>
<th>What that looks like</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>AI SQL functions</strong> (AI_COMPLETE, AI_EMBED, AI_CLASSIFY, AI_EXTRACT, others)</td>
<td>Tokens in and out</td>
<td>You pay per million tokens. The rate differs by model. Embedding calls only charge for input tokens. (<a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/aisql-cost">AI SQL Cost</a>)</td>
</tr>
<tr>
<td><strong>Cortex Analyst</strong></td>
<td>Messages</td>
<td>You pay per message: 67 Platform Credits per 1,000 messages on the rate card, counting successful responses only. The SQL Analyst writes then runs on a warehouse, and that time bills separately. (<a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-analyst">Cortex Analyst</a>)</td>
</tr>
<tr>
<td><strong>Cortex Search</strong></td>
<td>Data indexed, plus queries served</td>
<td>Two charges. Credits per token embedded when data loads or changes, plus 6.3 AI Credits per GB of indexed data per month to serve queries. Refresh bills as warehouse credits. (<a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-search/cortex-search-costs">Cortex Search Costs</a>)</td>
</tr>
<tr>
<td><strong>Document AI</strong> (AI_PARSE_DOCUMENT)</td>
<td>Pages processed</td>
<td>You pay per 1,000 pages: 3.66 AI Credits per 1,000 pages in Layout mode, 0.68 in OCR. Layout costs 5.4 times as much. (<a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/document-ai/overview">Document AI Overview</a>)</td>
</tr>
<tr>
<td><strong>Cortex Fine-Tuning</strong></td>
<td>Training tokens</td>
<td>You pay per training token, at a rate that varies by base model. The fine-tuned model then bills like any AI_COMPLETE inference call. (<a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-finetuning">Cortex Fine-Tuning</a>)</td>
</tr>
<tr>
<td><strong>Cortex Code (CoCo)</strong></td>
<td>Tokens, plus a subscription on two surfaces</td>
<td>You pay per token, metered on each surface. CLI and Desktop carry a $20 monthly subscription on top of the token charges. (<a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code">Cortex Code</a>)</td>
</tr>
</tbody>
</table>
<p>Snowflake Cortex Code pricing is the only one in this table with a subscription: $20 a month for CLI and Desktop, on top of the tokens. Model choice is the biggest lever on the token bill. A Claude or GPT-class model costs several credits per million output tokens. A Llama or Mistral model costs a fraction of one.</p>
<h2>Why Does Every Snowflake Spend Cap Lag by Eight Hours?</h2>
<p>Snowflake evaluates budgets periodically rather than instantly. Its docs put a budget action at up to eight hours to take effect, or up to two hours on the latency-optimized option. Between two evaluations, spend passes the limit. Your real exposure is the limit plus up to eight hours of extra spend at the pipeline's peak rate.</p>
<p><img class="blog-fig-light" src="/blog/snowflake-cortex-pricing-spend-caps/fig-2.svg" alt="Timeline titled A cap acts up to eight hours after spend crosses it. Spend rises past the budget limit, and the budget action fires up to 8 hours later, or 2 hours on the latency-optimized option. The advice reads: set each cap below the finance limit by eight hours of spend at the pipeline's peak rate."> </p>
<p>Budgets come in three forms, and they are not interchangeable. Two of them can stop spend and one only reports it. Pick the wrong one and you get a report where you needed a cap.</p>
<ul>
<li><strong>Shared resource budgets</strong> tag AI usage to a team or a cost center. A shared budget shows you who spent what, and it does not cap the spend. (<a href="https://docs.snowflake.com/en/user-guide/budgets/budget-shared-resources">Docs</a>)</li>
<li><strong>Per-user quotas</strong> set a monthly credit ceiling per user or group, with an optional daily ceiling. A quota blocks usage automatically on the AI domains only. Warehouse spend gets a separate quota that tracks spend but never blocks it. (<a href="https://docs.snowflake.com/en/user-guide/budgets/per-user-quotas">Docs</a>)</li>
<li><strong>Resource budgets</strong> sit on one named object, so the cap applies to that object only. Three services support them: Cortex Agents, Snowflake CoWork and Cortex Search. At 80% or 100% of the limit, a resource budget fires an alert, revokes access or runs a custom action. (<a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-agents-resource-budgets">Docs</a>)</li>
</ul>
<p>Snowflake bills in two credit types: Platform Credits for warehouse compute, and AI Credits for AI services. One quota monitors only one type.</p>
<p><img class="blog-fig-light" src="/blog/snowflake-cortex-pricing-spend-caps/fig-3.svg" alt="Diagram titled One quota watches one credit type. Platform Credits pay for warehouse compute, and their per-user quota tracks spend and never blocks it. AI Credits pay for AI services, and their per-user quota blocks usage automatically. Capping one person's whole spend takes two quota objects."> </p>
<p>Set each cap below the finance limit by the amount your pipeline could burn in eight hours at its peak rate. A higher cap lets the lag window carry spend past the limit before the cap acts.</p>
<h2>Which Snowflake Cortex Services Can You Cap?</h2>
<p>Five services accept a spend cap. Four do not, and for those a usage-history view is the entire cost control. The usage-history view shows spend after Snowflake bills it. Snowflake adds services often, so treat the table below as the current catalog rather than a fixed set.</p>
<p><img class="blog-fig-light" src="/blog/snowflake-cortex-pricing-spend-caps/fig-4.svg" alt="Two columns titled Five accept a spend cap, four rely on a usage view. Cap supported: AI SQL functions with shared budgets and quotas, Cortex Search with resource budgets, Snowflake CoWork and Cortex Agents with resource and shared budgets and quotas, and Cortex Code with shared budgets, credit limits and quotas. No cap, usage-history view only: Cortex Analyst and Cortex Fine-Tuning, not supported nor planned, and Document AI and Cortex Guardrails, absent from the budget table."> </p>
<table>
<thead>
<tr>
<th>Service</th>
<th>Status</th>
<th>Billing unit</th>
<th>Cap supported</th>
<th>Usage-history view</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>AI SQL functions</strong> (AI_COMPLETE, AI_EMBED, AI_CLASSIFY, others)</td>
<td>GA (some preview)</td>
<td>Tokens</td>
<td>✓ Shared budgets, quotas</td>
<td>CORTEX_AI_FUNCTIONS_USAGE_HISTORY</td>
</tr>
<tr>
<td><strong>Cortex Analyst</strong></td>
<td>GA on AWS, Azure</td>
<td>Messages</td>
<td>✗ Snowflake names this "not supported nor planned"</td>
<td>CORTEX_ANALYST_USAGE_HISTORY</td>
</tr>
<tr>
<td><strong>Cortex Search</strong></td>
<td>GA</td>
<td>GB indexed, plus queries</td>
<td>✓ Resource budgets</td>
<td>CORTEX_SEARCH_DAILY_USAGE_HISTORY</td>
</tr>
<tr>
<td><strong>Snowflake CoWork</strong></td>
<td>GA</td>
<td>Rolled up under Agents</td>
<td>✓ Resource budgets, shared budgets, quotas</td>
<td>SNOWFLAKE_COWORK_USAGE_HISTORY</td>
</tr>
<tr>
<td><strong>Document AI</strong> (AI_PARSE_DOCUMENT)</td>
<td>GA / Preview</td>
<td>Pages processed</td>
<td>✗ Absent from the budget table rather than refused</td>
<td>CORTEX_DOCUMENT_PROCESSING_USAGE_HISTORY</td>
</tr>
<tr>
<td><strong>Cortex Fine-Tuning</strong></td>
<td>GA</td>
<td>Training tokens</td>
<td>✗ Named alongside Analyst</td>
<td>CORTEX_FINE_TUNING_USAGE_HISTORY</td>
</tr>
<tr>
<td><strong>Cortex Guardrails</strong></td>
<td>GA</td>
<td>Tokens scanned</td>
<td>✗ Also absent rather than refused</td>
<td>CORTEX_AI_GUARDRAILS_USAGE_HISTORY</td>
</tr>
<tr>
<td><strong>Cortex Agents</strong></td>
<td>GA</td>
<td>Per step, per underlying tool</td>
<td>✓ Resource budgets, shared budgets, quotas</td>
<td>CORTEX_AGENT_USAGE_HISTORY</td>
</tr>
<tr>
<td><strong>Cortex Code (CoCo)</strong></td>
<td>GA (SDK preview)</td>
<td>Tokens, plus $20/month CLI + Desktop subscription</td>
<td>✓ Shared budgets, credit usage limits, quotas</td>
<td>CORTEX_CODE_CLI_USAGE_HISTORY, Snowsight, Desktop</td>
</tr>
</tbody>
</table>
<h2>How Do You Track the Four Services You Cannot Cap?</h2>
<p>Start with CORTEX_AI_FUNCTIONS_USAGE_HISTORY, the broadest single view. It lists every AI function call with its model, user, role, credits and tokens. The <a href="https://docs.snowflake.com/en/sql-reference/account-usage/cortex_ai_functions_usage_history">full reference</a> has the schema, and METERING_HISTORY gives the account-wide total.</p>
<p><strong>Do not sum usage across views.</strong> Snowflake's own footnote says CORTEX_SEARCH_DAILY_USAGE_HISTORY includes embeddings that also appear in CORTEX_AI_FUNCTIONS_USAGE_HISTORY. Add the two together and you double-count every embedding.</p>
<p>CORTEX_AISQL_USAGE_HISTORY does not cover every AI function. Snowflake's docs point readers at CORTEX_AI_FUNCTIONS_USAGE_HISTORY to see all functions, including AI_PARSE_DOCUMENT. A dashboard built on the narrower view silently under-counts the calls that the broader view carries.</p>
<h2>How Altimate Helps With Snowflake Cortex AI Cost</h2>
<p>Every check in this post runs on data you already have: the Cortex usage-history views, Snowflake billing records and the metering tables. The hard part is pulling it together across every service, user and model before next month's invoice shows the spike.</p>
<p><a href="/products/altimate-lite">Altimate Lite</a> is a Snowflake Native App, so your usage data never leaves your account. Its <a href="/product-highlights/snowflake-cortex-ai-cost-breakdown">Cortex AI cost breakdown</a> splits spend by service, user and model, and the three filters combine. It drills into single calls where Snowflake exposes them:</p>
<ul>
<li><strong>AI SQL functions, Cortex Code, Cortex Agents and Snowflake Intelligence</strong> carry one row per call. Each row has a Query ID or Request ID, the user, the model and the token count.</li>
<li><strong>Cortex Analyst</strong> reports only hourly request counts per user.</li>
<li><strong>Cortex Search</strong> carries no user or request ID at all.</li>
</ul>
<p>The <a href="https://calendly.com/d/cxsb-8h7-5z9/altimate-ai-for-snowflake-overview">Altimate Enterprise Platform</a> covers the rest of the account. It <a href="/product-highlights/snowflake-cost-alerts-by-team">attributes Snowflake spend to the team that owns it</a>, by warehouse or by query.</p>
<p>Snowflake's usage-history views answer "what did we spend?" after the fact. The harder question is which workload burns the money, and what to change. Per-call rows and team attribution answer that question.</p>
<h2>Frequently Asked Questions</h2>
<h3>Does Snowflake Cortex AI cost show up on the warehouse bill?</h3>
<p>It almost never does. Nearly every Cortex AI service bills as its own line item, separate from warehouse compute. Cortex Analyst and Cortex Search are partial exceptions. The SQL that Snowflake Cortex Analyst writes runs on a warehouse, and so does the index refresh for Cortex Search.</p>
<h3>Which Cortex AI services have no spend cap at all?</h3>
<p>Four services today: Cortex Analyst, Cortex Fine-Tuning, Document AI and Cortex Guardrails. They support neither budgets nor per-user quotas. Snowflake names the first two as not supported nor planned. For all four, a usage-history view is the only control you get.</p>
<h3>Does the Snowflake free trial cover Cortex AI usage?</h3>
<p>It does, with two limits. The standard trial gives you $400 in credits over 30 days, and Cortex usage draws on that balance. A trial account with no valid payment method also gets roughly ten credits of AI Functions usage per day. The CoCo trial is a carve-out inside the $400, with $40 for CoCo inference and $360 for everything else.</p>
<h3>Do Cortex Code subscriptions replace token billing?</h3>
<p>They stack on top of it. Snowflake Cortex Code pricing adds a $20 monthly subscription for CLI and Desktop on top of per-token inference billing. One subscription covers all CoCo inference across those two surfaces. CoCo in Snowsight, the editor integrations and the SDK carry no subscription.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/snowflake-cortex-pricing-spend-caps/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>A Practical Way to Review AI-Generated dbt Code Before It Ships</title>
    <link>https://altimate.ai/blog/review-ai-generated-dbt-code-before-production</link>
    <guid isPermaLink="true">https://altimate.ai/blog/review-ai-generated-dbt-code-before-production</guid>
    <pubDate>Fri, 16 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Atharva Shah</dc:creator>
    <category>dbt</category>
    <category>Data Engineering</category>
    <category>Data Quality</category>
    <category>AI Coding</category>
    <description>AI writes dbt models in seconds, and the bugs it leaves compile and pass data tests. Five failure modes, why the usual checks miss them, and a five-question review to run before you merge.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/review-ai-generated-dbt-code-before-production/cover.jpg" alt="A Practical Way to Review AI-Generated dbt Code Before It Ships" /></p>
<p>You ask Cursor or Claude Code for a new dbt model. It writes the SQL and Jinja in seconds. The model compiles, <code>dbt build</code> passes and the pull request looks clean. Two weeks later, finance asks why a customer metric moved, and nobody can say which line changed it.</p>
<p>AI made the writing step fast. The review step is the same size it was, and it now covers more code that nobody on the team typed. This guide shows how to review AI-generated dbt code before you merge. It names five ways an AI-written model goes wrong after it compiles. It explains why the usual checks miss them. Then it gives you a review routine to run in the editor.</p>

<h2>AI Made Writing Models Faster While Review Stayed Manual</h2>
<p>Data teams adopted AI for writing code first. In the <a href="https://www.getdbt.com/resources/state-of-analytics-engineering-2026" target="_blank" rel="noopener noreferrer">dbt Labs State of Analytics Engineering 2026</a> report, 72% of respondents prioritize AI-assisted coding. Only 24% prioritize AI for pipeline management, which includes testing and observability. The same report found that 71% of data professionals name incorrect or hallucinated output reaching stakeholders as a top concern.</p>
<p>Developers feel the gap in their own work. The <a href="https://survey.stackoverflow.co/2025/ai" target="_blank" rel="noopener noreferrer">Stack Overflow 2025 Developer Survey</a> asked what frustrates developers most about AI tools. The top answer was "AI solutions that are almost right, but not quite," picked by 66%. In the same survey, 46% distrust the accuracy of AI tools and 33% trust it.</p>
<p>An almost-right dbt model is the expensive kind. A syntax error fails the build in seconds. A model that returns plausible numbers passes every gate, and someone outside the data team finds the error first.</p>

<h2>Five Ways an AI-Written Model Goes Wrong After It Compiles</h2>
<p>Each case below compiles, runs and passes the common <code>not_null</code> and <code>unique</code> tests. Each one also changes a number that someone downstream trusts.</p>

<h3>1. A NULL Branch Quietly Returns Zero</h3>
<p>A CASE expression handles the "no orders" case with <code>else 0</code> in one column and <code>else null</code> in the next. In a demo Jaffle Shop project, 38 of 100 customers had never ordered. The model reported a 0% return rate for all 38 of them, when the honest answer was NULL. Any average built on that column is now wrong.</p>
<p>A simplified version of the pattern looks like this:</p>
<pre><code class="language-sql">case when number_of_orders &gt; 0
     then returned_orders / number_of_orders
     else 0      -- should be null: these customers never ordered
end as return_rate</code></pre>

<h3>2. A Join Multiplies Rows</h3>
<p>Someone changes a left join to a full outer join, or joins on a key that is not unique. The CTE that held 99 rows now holds about 990. Revenue doubles on the dashboard and every row still looks valid. The <a href="/blog/dbt-anti-patterns-ai-should-catch">dbt anti-patterns guide</a> lists this fan-out join first among the patterns review should catch.</p>

<h3>3. A Column Change Breaks a Model Three Hops Away</h3>
<p>The assistant renames a column or changes its type in a staging model. Nothing fails in that model. The break shows up in a mart three models downstream, or in a dashboard that reads it. Column-level lineage answers "who reads this column", but dbt Labs gates it to an Enterprise plan with Catalog. Its own <a href="https://docs.getdbt.com/docs/explore/column-level-lineage" target="_blank" rel="noopener noreferrer">documentation</a> says the view does not reflect usage in joins and filters.</p>

<h3>4. Logic That No Test Checks</h3>
<p>Data tests check the rows a model produces after it builds. They catch a duplicate key or a null. They cannot tell you that a split payment was summed into the wrong bucket. A <a href="https://docs.getdbt.com/docs/build/unit-tests" target="_blank" rel="noopener noreferrer">dbt unit test</a> checks logic on fixed inputs before the model builds, and dbt has supported them since version 1.8. Writing a dbt unit test takes time, because each scenario needs hand-written input and expected-output YAML.</p>

<h3>5. A Macro Nobody Can Explain</h3>
<p>Generated models lean on whatever <code>ref()</code> calls and macros the assistant found in your project. The compiled SQL shows the result of the Jinja and hides where each piece came from. The reviewer has to trust a macro they never read, or open five files to check it.</p>

<h2>Why Compiling, Data Tests and Pull Request Review Miss These Bugs</h2>
<p>Most dbt code review happens in a pull request diff, after compile and data tests pass. Each of those checks answers a narrower question than the one you care about.</p>
<ul>
<li><strong>Compiling</strong> proves the SQL is valid. It says nothing about whether the numbers are right.</li>
<li><strong>Data tests</strong> run after the build and check shape: nulls, keys, accepted values. Wrong logic with clean shape passes.</li>
<li><strong>Pull request review</strong> reads a diff. The reviewer sees the changed lines, and never sees the row counts or the downstream models.</li>
<li><strong>Asking a chatbot</strong> covers only the checks you thought to name in the prompt, and the chatbot cannot see your data.</li>
</ul>
<table>
<thead><tr><th>Failure</th><th>Compile</th><th>Data tests</th><th>PR diff</th><th>Check that catches it</th></tr></thead>
<tbody>
<tr><td>NULL branch returns zero</td><td>Passes</td><td>Passes</td><td>Often missed</td><td>Read the logic in every branch</td></tr>
<tr><td>Join multiplies rows</td><td>Passes</td><td>Passes unless a key test covers it</td><td>Missed</td><td>Row count per CTE</td></tr>
<tr><td>Column change breaks a model downstream</td><td>Passes</td><td>Fails late, if at all</td><td>Missed</td><td>Column-level lineage</td></tr>
<tr><td>Logic no test checks</td><td>Passes</td><td>Passes</td><td>Often missed</td><td>Unit test</td></tr>
<tr><td>Macro nobody can explain</td><td>Passes</td><td>Passes</td><td>Missed</td><td>Read every ref() and macro</td></tr>
</tbody>
</table>
<p>Model quality does not close this gap on its own. On the <a href="https://spider2-sql.github.io/" target="_blank" rel="noopener noreferrer">Spider 2.0</a> benchmark of real enterprise SQL tasks, o1-preview solved 17.1% at launch. The best agent on the Spider 2.0-Lite leaderboard now scores 76.23, so it still misses about one task in four. Better models raise the share of correct SQL. Someone still has to find the rest before stakeholders do.</p>

<h2>Run a Five-Question Review Before You Merge</h2>
<p>To review AI-generated dbt code, turn the five failure modes into five questions. Answer each one with evidence before you approve the pull request. This makes a dbt code review a checklist instead of a skim.</p>
<ol>
<li><strong>Is the logic correct in every branch?</strong> Look for CASE expressions, NULL handling and divisions by a column that can be zero.</li>
<li><strong>Does any join multiply rows?</strong> Compare the row count of each CTE with the one before it.</li>
<li><strong>What breaks downstream if a column changes?</strong> Trace the changed columns to every model and dashboard that reads them.</li>
<li><strong>Is there a unit test for the logic you changed?</strong> Data tests alone do not count.</li>
<li><strong>Can you explain every <code>ref()</code> and macro the model uses?</strong> If not, read them before you approve.</li>
</ol>
<p>You can answer these by hand with a scratch query per CTE, a search across the project and a YAML file per test. That works, and it takes hours on a long model. The open source <a href="/products/dbt-power-user">dbt Power User</a> extension, a dbt VS Code extension that also runs in Cursor, does the same routine in the editor.</p>

<h2>Answer All Five Questions Inside VS Code or Cursor</h2>
<p>dbt Power User has 1M+ installs, and 35,000 developers use it every month. Its other name is the PowerUser Plugin for dbt. Each answer below names the feature for one review question, links to a walkthrough, and lists what else that feature does during a review. The playlist shows all five features in a live dbt project.</p>
<div style="position:relative;width:100%;aspect-ratio:16/9;margin:28px 0;border-radius:12px;overflow:hidden"><iframe src="https://www.youtube.com/embed/uMptd4t_mGI?list=PLfMXFrl2Dcdg&amp;rel=0" title="dbt Power User Feature Spotlights, all five videos" style="position:absolute;inset:0;width:100%;height:100%;border:0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p><strong>Logic in every branch.</strong> <a href="/product-highlights/profile-a-slow-dbt-query-execution-plan">Profile Query</a> sends the compiled SQL to Altimate Code with the prompt already written. The report leads with correctness bugs, such as the NULL branch above, then ranks the fixes.</p>
<img src="/product-highlights/109-dpu19-correctness-bug.webp" alt="The Profile: customers.sql chat under the heading Correctness bug. It explains that 38 of 100 customers never ordered, so 38% of customers show a return_rate of 0%, and suggests else null." loading="lazy" />
<p>Also in the editor for this check:</p>
<ul>
<li><strong>Validate SQL</strong> flags columns that do not exist, keyword typos and unbalanced parentheses while you edit.</li>
<li><strong>Compare query results</strong> keeps the earlier result in a tab. Run the changed query and read the two result sets side by side.</li>
<li><strong>Review with Altimate</strong> appears in the right-click menu while the file has uncommitted git changes, so you can review an AI edit before you commit it.</li>
</ul>
<p><strong>Rows a join multiplies.</strong> <a href="/product-highlights/debug-a-dbt-model-by-profiling-each-cte">Profile CTEs</a> runs every CTE and writes its runtime and row count beside it. The CTE that jumps from 99 rows to 990 holds the fan-out join.</p>
<img src="/product-highlights/112-dpu22-profile-ctes-metrics.webp" alt="Profile CTEs results in orders.sql. The orders CTE reads 4.4s and 99 rows, payments reads 644ms and 113 rows, and order_payments reads 181ms and 99 rows." loading="lazy" />
<p>Also in the editor for this check:</p>
<ul>
<li><strong>Execute CTE</strong> previews the rows of a single CTE from the link above it.</li>
<li><strong>SQL Visualizer</strong>, in beta, draws the CTEs, joins, filters and unions as a graph. Hover a join to see its code.</li>
</ul>
<p><strong>What breaks downstream.</strong> The <a href="/product-highlights/ask-ai-about-dbt-lineage-in-vs-code">Lineage tab</a> shows model and column lineage on your machine. Altimate Code then answers what depends on a model and how one column gets its value.</p>
<img src="/product-highlights/110-dpu20-upstream-dependencies.webp" alt="The Chat: orders tab titled Upstream dependencies of orders dbt model. A tree shows orders reading stg_orders and stg_payments, which read the seeds raw_orders and raw_payments." loading="lazy" />
<p>Also in the editor for this check:</p>
<ul>
<li><strong>Solid and dotted links.</strong> In column lineage, a solid line means the data flows through a select. A dotted line means the column appears in a where, join or having clause, which dbt's own column-level lineage view leaves out.</li>
<li><strong>Transformation icons</strong> label each column as original, alias, transformation or unchanged. A code icon shows the SQL that built it.</li>
<li><strong>Other projects.</strong> With dbt-loom, models from other projects appear in the graph as ext nodes.</li>
</ul>
<p><strong>A unit test for the change.</strong> The <a href="/product-highlights/generate-dbt-unit-tests-in-the-documentation-editor">Documentation Editor</a> proposes unit test scenarios with full YAML and adds the one you approve.</p>
<img src="/product-highlights/111-dpu21-unit-test-scenarios.webp" alt="The Altimate Code chat titled Unit tests proposal for orders dbt model, listing four proposed unit test scenarios, above the Documentation Editor for Model: orders with its Data Tests and Unit Tests rows." loading="lazy" />
<p>Also in the editor for this check:</p>
<ul>
<li><strong>Data tests.</strong> The same editor adds unique, not_null, accepted_values and relationships tests. One click lists a column's distinct values for accepted_values.</li>
<li><strong>Custom tests.</strong> Altimate Code writes a custom test with dbt_utils or dbt_expectations when installed, and with a macro otherwise.</li>
<li><strong>Defer to production</strong> runs a model and its tests without first building the parent models. It reads a production manifest.</li>
</ul>
<p><strong>Every ref() and macro.</strong> <a href="/product-highlights/dbt-macros-and-ref-explained-on-hover">Hover cards</a> show a model's DAG depth and the models that use a macro, with an explanation one click away.</p>
<img src="/product-highlights/113-dpu23-macro-hover-insights.webp" alt="The hover card on the pct_of_total macro call at line 55. It reads (Macro) pct_of_total, (Referenced by) orders, and offers Explain what this macro does and Find risky usages." loading="lazy" />
<p>Also in the editor for this check:</p>
<ul>
<li><strong>Explain transformation</strong> on a ref() hover walks through the model's selects, filters, joins and aggregations.</li>
<li><strong>Find risky usages</strong> on a macro hover checks for missing arguments, wrong types, edge cases and anti-patterns.</li>
<li><strong>Go to definition</strong> works for models, macros, sources and doc blocks. The toolbar shows the compiled SQL that the Jinja renders to.</li>
</ul>

<p>Model-level lineage, query previews and running a single CTE work without a key. Column lineage and the AI checks need a free Altimate API key, and you can use your own model provider key. Nothing is written to your project until you approve it.</p>

<h2>Where the Review Routine Still Needs You</h2>
<p>Tools answer the five questions faster. They do not decide whether a change is right for the business. A unit test only checks the scenarios someone chose, so choose at least one edge case, such as an order with no payments. Snowflake does not support EXPLAIN ANALYZE. So on Snowflake, a plan shows estimates instead of measured runtimes. Treat a finding as a lead to confirm with a query, then merge.</p>
<p>Each feature has limits. Column lineage does not support snapshots, and unnest, lateral view flatten and JSON flatten can leave a lineage incomplete. Altimate Code can retry dbt commands, ignore installed packages or write an inaccurate test, so read each generated test before you save it. The Documentation Editor does not show tests written in dbt's alternative format or defined as macros.</p>
<p>Start with the model that changed most recently. Install dbt Power User from the <a href="https://marketplace.visualstudio.com/items?itemName=innoverio.vscode-dbt-power-user" target="_blank" rel="noopener noreferrer">VS Code Marketplace</a>, or from <a href="https://open-vsx.org/extension/innoverio/vscode-dbt-power-user" target="_blank" rel="noopener noreferrer">Open VSX</a> for Cursor, and run the five checks on your next pull request. If you already run <code>dbt compile</code> in a loop to read Jinja, the <a href="/blog/how-i-stopped-running-dbt-compile-50-times-a-day">compile loop guide</a> shows how to cut that step too.</p>
<h2>Frequently Asked Questions</h2>
<h3>How do I review AI-generated dbt code?</h3>
<p>To review AI-generated dbt code, check five things before you merge. Read the logic in every branch. Compare the row count after each join. Trace the changed columns to the models downstream. Add a unit test for the changed logic, and read every ref() and macro the model uses.</p>
<h3>What is the difference between dbt data tests and unit tests?</h3>
<p>Data tests run after the model builds and check its rows, such as no nulls or no duplicate keys. Unit tests run on fixed input rows you provide and compare the output to the rows you expect. Data tests find bad data, and unit tests find wrong logic.</p>
<h3>Why does an AI-written dbt model pass tests and still return wrong numbers?</h3>
<p>Because the common tests check shape, not meaning. A model can have unique keys and no nulls while it sums payments into the wrong bucket or multiplies rows in a join. Only a unit test or a direct check of the logic catches that.</p>
<h3>How do I find a fan-out join in a dbt model?</h3>
<p>Run each CTE on its own and compare row counts. A fan-out join matches more rows than expected, so one CTE returns far more rows than the CTE before it. Profile CTEs in dbt Power User does this for every CTE in one click.</p>
<h3>Is dbt Power User free?</h3>
<p>Yes. This dbt VS Code extension is open source and free to install from the VS Code Marketplace or Open VSX. Model lineage, query previews and CTE runs work without a key. Column lineage and the AI features need a free Altimate API key.</p>
<h3>Does dbt Power User work in Cursor?</h3>
<p>Yes, it does. Cursor installs extensions from Open VSX, where dbt Power User is listed. Every check in this guide works the same way in Cursor as in VS Code.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/review-ai-generated-dbt-code-before-production/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>What Is Databricks Predictive Optimization? And What Does It Cost?</title>
    <link>https://altimate.ai/blog/databricks-predictive-optimization</link>
    <guid isPermaLink="true">https://altimate.ai/blog/databricks-predictive-optimization</guid>
    <pubDate>Sat, 10 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Saurabh Arora</dc:creator>
    <category>Databricks</category>
    <category>databricks cost</category>
    <category>Cost Optimization</category>
    <category>Data Engineering</category>
    <description>Databricks Predictive Optimization automatically runs OPTIMIZE, VACUUM, and ANALYZE on Unity Catalog managed tables. Check which tables it covers, what it ran, and what it costs.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/databricks-predictive-optimization/cover.jpg" alt="What Is Databricks Predictive Optimization? And What Does It Cost?" /></p>
<p>A lakehouse typically starts with files: usually Parquet files written to object storage. Delta Lake adds a transaction log, ACID transactions, schema enforcement, and versioned table state on top of those files. But using Delta Lake does not make the physical table maintenance-free. As data is inserted, streamed, merged, updated, and deleted, three familiar problems appear:</p>
<table>
<thead>
<tr><th>Problem</th><th>Why it matters</th><th>Maintenance operation</th></tr>
</thead>
<tbody>
<tr><td>Many small or poorly arranged files</td><td>Queries open and scan more files than necessary</td><td><code>OPTIMIZE</code> rewrites files to improve size and layout</td></tr>
<tr><td>Old files are no longer referenced by the current table state</td><td>They continue consuming storage and preserve data beyond the intended retention window</td><td><code>VACUUM</code> removes unreferenced files after the retention period</td></tr>
<tr><td>Table and column statistics become stale</td><td>The optimizer has less reliable information when choosing a query plan</td><td><code>ANALYZE</code> refreshes statistics</td></tr>
</tbody>
</table>
<p>These issues need managing. Optimized writes and auto compaction can reduce small-file pressure, but they do not replace every file-layout, retention, and statistics task. So many platform teams built Databricks OPTIMIZE, VACUUM, and ANALYZE commands into notebooks or SQL tasks, like these:</p>
<pre><code class="language-sql">OPTIMIZE main.sales.orders;
VACUUM main.sales.orders;
ANALYZE TABLE main.sales.orders
COMPUTE STATISTICS;</code></pre>
<p>The platform team chose (or guessed at) the tables, the commands, the schedule, and the compute. A nightly or weekly schedule helped avoid a harder question: <strong>does this table actually need maintenance now?</strong> A fixed schedule works, but it is very inefficient.</p>
<h2>What is Databricks Predictive Optimization?</h2>
<p>Databricks Predictive Optimization is a managed service that automatically runs maintenance operations like <code>OPTIMIZE</code>, <code>VACUUM</code>, and <code>ANALYZE</code> on Unity Catalog managed tables, based on table needs and workload telemetry, not a fixed schedule.</p>
<p>Predictive Optimization moves that maintenance decision off a schedule maintained by your team and onto Databricks. For eligible Unity Catalog managed Delta Lake and Apache Iceberg tables, Databricks identifies tables that would benefit from maintenance and queues <code>OPTIMIZE</code>, <code>VACUUM</code>, or <code>ANALYZE</code>. The operations run on <a href="https://docs.databricks.com/aws/en/jobs/compute">serverless compute for jobs</a> rather than on a cluster you configure for a maintenance workflow.</p>
<table>
<thead>
<tr><th>Without Predictive Optimization</th><th>With Predictive Optimization</th></tr>
</thead>
<tbody>
<tr><td>Your team selects tables</td><td>Databricks evaluates eligible tables</td></tr>
<tr><td>Commands run at a fixed time</td><td>Operations run when Databricks decides they are useful</td></tr>
<tr><td>Your team provisions and monitors compute</td><td>Databricks uses serverless jobs compute</td></tr>
<tr><td>Cost is attached to a known job</td><td>Cost appears as platform-managed usage</td></tr>
<tr><td>A failed schedule is visible in Jobs</td><td>You inspect table history and system tables</td></tr>
</tbody>
</table>
<p>Predictive Optimization has three practical benefits:</p>
<ul>
<li><p>Maintenance is based on observed need rather than only a calendar.</p>
</li>
<li><p>Teams do not provision separate job compute for eligible tables.</p>
</li>
<li><p>Statistics and file layout can be maintained more consistently.</p>
</li>
</ul>
<p>But the same automation changes visibility. Predictive Optimization can be inherited from the account through the catalog and schema to the table, so behavior can change without anyone adding a new job. Databricks enables it by default for accounts created on or after November 11, 2024, while lower-level settings can override the inherited value.</p>
<p>That creates two problems. First, the work has no owner: it runs on serverless compute for jobs, billed under a SKU that several other Databricks features share, so the line on your bill doesn't say it came from table maintenance. Only <code>billing_origin_product = 'PREDICTIVE_OPTIMIZATION'</code> identifies it. Second, if a team already schedules its own <code>OPTIMIZE</code> and <code>VACUUM</code> job on the same table, two systems now maintain that table, and each has its own billing line. Databricks doesn't document what Predictive Optimization does when the table is already compacted, so the only way to find out is to look at <code>system.storage.predictive_optimization_operations_history</code> for your own tables.</p>
<h2>Databricks Predictive Optimization covers only Unity Catalog managed tables</h2>
<p>In real Databricks workspaces, <strong>table format, catalog, and storage ownership are separate concerns.</strong> Converting Parquet data to Delta adds the Delta transaction log. It does not necessarily turn the result into a Unity Catalog managed table. For example, <code>CONVERT TO DELTA</code> can convert Parquet data in an external location into an external Delta table. That table gains Delta semantics, but it remains external. Predictive Optimization supports only Unity Catalog managed tables.</p>
<table>
<thead>
<tr><th>Table state</th><th>Predictive Optimization coverage</th></tr>
</thead>
<tbody>
<tr><td>Parquet files or a Parquet table</td><td>✗</td></tr>
<tr><td>Delta table outside Unity Catalog</td><td>✗</td></tr>
<tr><td>Unity Catalog external Delta table</td><td>✗</td></tr>
<tr><td>Unity Catalog managed Delta or Iceberg table</td><td>✓ Eligible, subject to enablement and prerequisites</td></tr>
<tr><td>Managed table that still has a legacy maintenance job</td><td>✓ Eligible, but audit both maintenance paths</td></tr>
</tbody>
</table>
<p>Predictive Optimization also excludes tables received through OpenSharing. It requires a Premium plan or above, a supported region, and SQL warehouses or Databricks Runtime 12.2 LTS or later. So don’t assume it is available or active.</p>
<p>Predictive Optimization does not run <code>ZORDER</code>, and it ignores Z-ordered files. Its <code>VACUUM</code> retention behavior follows the table's <code>delta.deletedFileRetentionDuration</code> property, with a seven-day minimum when Predictive Optimization runs <code>VACUUM FULL</code>. A manual job that applies a deliberate Z-ordering strategy or encodes special retention behavior might therefore remain necessary.</p>
<h2>Enablement does not prove Predictive Optimization ran</h2>
<p>Enablement and execution are different things. Check a table directly:</p>
<pre><code class="language-sql">DESCRIBE TABLE EXTENDED main.sales.orders;</code></pre>
<p>The <code>Predictive Optimization</code> field shows whether the setting is enabled, disabled, or inherited. It does not prove that Databricks has executed maintenance.</p>
<p>On Databricks Runtime 18 LTS and later, you can inspect the latest evaluation and selected skip reasons with:</p>
<pre><code class="language-sql">DESCRIBE TABLE EXTENDED main.sales.orders AS JSON;</code></pre>
<p>The JSON includes <code>predictive_optimization_evaluations</code> for supported operation types. Only the latest evaluation is shown, results can take up to 24 hours to appear, and skip reasons are not provided for <code>ANALYZE</code>.</p>
<p>For historical activity across tables, query the Predictive Optimization system table:</p>
<pre><code class="language-sql">SELECT
  metastore_name,
  catalog_name,
  schema_name,
  table_name,
  table_id,
  operation_type,
  COUNT(DISTINCT operation_id) AS successful_operations,
  SUM(usage_quantity) AS estimated_dbus,
  MAX(end_time) AS last_run
FROM system.storage.predictive_optimization_operations_history
WHERE start_time &gt;= CURRENT_TIMESTAMP() - INTERVAL 30 DAYS
  AND operation_status = 'SUCCESSFUL'
  AND usage_unit = 'ESTIMATED_DBU'
GROUP BY
  metastore_name,
  catalog_name,
  schema_name,
  table_name,
  table_id,
  operation_type
ORDER BY estimated_dbus DESC;</code></pre>
<p>The result tells you which tables Databricks maintained, which operations ran, and the estimated DBUs attributed to them. The estimate is approximate when several operations share a cluster. The table can also contain operation types beyond the three headline commands, including compaction, clustering, column selection, deletion, purge, and compatibility work.</p>
<h2>How much does Databricks Predictive Optimization cost?</h2>
<p>Predictive Optimization uses billable <a href="/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper">serverless jobs compute</a>. In <code>system.billing.usage</code>, identify it by this filter rather than by the SKU name alone:</p>
<pre><code class="language-sql">billing_origin_product = 'PREDICTIVE_OPTIMIZATION'</code></pre>
<p>The following query returns recorded DBUs and an <a href="/blog/understanding-databricks-compute-costs">estimated list-price cost</a>:</p>
<pre><code class="language-sql">SELECT
  DATE_TRUNC('day', u.usage_start_time) AS usage_day,
  u.workspace_id,
  u.sku_name,
  p.currency_code,
  SUM(u.usage_quantity) AS dbus,
  SUM(u.usage_quantity * p.pricing.effective_list.default) AS estimated_list_cost
FROM system.billing.usage AS u
JOIN system.billing.list_prices AS p
  ON u.account_id = p.account_id
 AND u.cloud = p.cloud
 AND u.sku_name = p.sku_name
 AND u.usage_unit = p.usage_unit
 AND u.usage_end_time &gt;= p.price_start_time
 AND (p.price_end_time IS NULL OR u.usage_end_time &lt; p.price_end_time)
WHERE u.billing_origin_product = 'PREDICTIVE_OPTIMIZATION'
  AND u.usage_unit = 'DBU'
  AND u.usage_date &gt;= CURRENT_DATE() - INTERVAL 30 DAYS
GROUP BY
  DATE_TRUNC('day', u.usage_start_time),
  u.workspace_id,
  u.sku_name,
  p.currency_code
ORDER BY usage_day;</code></pre>
<p>These four values are distinct:</p>
<pre><code class="language-plaintext">Estimated per-operation DBUs
≠ recorded billing DBUs
≠ estimated list-price cost
≠ final invoice amount</code></pre>
<p>The operation-history table normally updates within two hours. Billing data can take up to 24 hours. List-price cost can differ from the invoice because of negotiated rates, commitments, credits, taxes, and billing corrections such as retractions and restatements.</p>
<h2>Should you keep your existing OPTIMIZE and VACUUM jobs?</h2>
<p>Some of your existing Databricks VACUUM and OPTIMIZE jobs may no longer be needed, and some still are. Review them one at a time, in three steps.</p>
<ol>
<li><p>Run the operation-history query above to list the tables Predictive Optimization maintained.</p>
</li>
<li><p>Find the jobs that run <code>OPTIMIZE</code>, <code>VACUUM</code>, or <code>ANALYZE</code> on those same tables.</p>
</li>
<li><p>Decide what to do with each job, using the table below.</p>
</li>
</ol>
<p>A table that appears in both lists has two maintenance paths. That shows possible overlap, but it doesn't prove you paid twice, because the two paths may run different operations or touch different files.</p>
<table>
<thead>
<tr><th>Existing job</th><th>What to do</th></tr>
</thead>
<tbody>
<tr><td>Plain scheduled <code>OPTIMIZE</code> on an eligible managed table</td><td>Compare recent automatic and manual runs, then consider pausing it as a test</td></tr>
<tr><td><code>OPTIMIZE ... ZORDER BY</code></td><td>Keep it. Predictive Optimization doesn't run <code>ZORDER</code></td></tr>
<tr><td><code>VACUUM</code> with a deliberate retention requirement</td><td>Check the table's retention property and your recovery needs first</td></tr>
<tr><td>Job on an external or shared table</td><td>Keep it. Predictive Optimization doesn't cover these tables</td></tr>
<tr><td>Notebook that also runs checks, alerts, or downstream tasks</td><td>Move the maintenance commands out and keep the rest of the notebook</td></tr>
</tbody>
</table>
<p>Don't delete a job because a table shows <code>ENABLED</code> or because one automatic operation succeeded. Test on one table first. Pause one low-risk schedule, keep a way to turn it back on, and watch the table through several normal write and query cycles. Then compare:</p>
<ul>
<li><p>Table history and operation metrics</p>
</li>
<li><p>Query performance</p>
</li>
<li><p>Storage behavior</p>
</li>
<li><p>Predictive Optimization cost</p>
</li>
<li><p>The cost of the job you removed</p>
</li>
</ul>
<p>The saving is the cost of the removed job, minus anything that went up afterwards:</p>
<pre><code class="language-plaintext">Net saving = removed job cost
             - increase in Predictive Optimization cost
             - increase in query and storage cost</code></pre>
<p>If Predictive Optimization cost rises by about as much as the job used to cost, the net saving is close to zero.</p>
<h2>What to check before you pause a maintenance job</h2>
<p>Databricks Predictive Optimization moves maintenance from schedules your team owns to decisions Databricks makes, and it moves part of the cost from named jobs into serverless usage. This change reduces unnecessary maintenance toil, but in a workspace that mixes Parquet data, external Delta tables, managed Unity Catalog tables, and older jobs, the change is easy to overlook. Before you change any schedule, check four things:</p>
<ul>
<li><p><strong>Eligibility.</strong> Confirm the table is a Unity Catalog managed table and see whether the setting is enabled, disabled, or inherited.</p>
</li>
<li><p><strong>What ran.</strong> Use the operation-history table to see what Databricks actually evaluated and ran on it.</p>
</li>
<li><p><strong>What it cost.</strong> Filter <code>system.billing.usage</code> on <code>billing_origin_product = 'PREDICTIVE_OPTIMIZATION'</code> to see the DBUs.</p>
</li>
<li><p><strong>What overlaps.</strong> Compare that activity with the jobs your team still owns.</p>
</li>
</ul>
<p>With those four answers, you can decide which schedules are still useful and what Predictive Optimization is costing you.</p>
<h2>Frequently asked questions</h2>
<h3>What is Databricks Predictive Optimization?</h3>
<p>Databricks Predictive Optimization is a managed service that automatically runs maintenance operations like <code>OPTIMIZE</code>, <code>VACUUM</code>, and <code>ANALYZE</code> on Unity Catalog managed tables, based on table needs and workload telemetry, not a fixed schedule. The operations run on serverless compute for jobs rather than on a cluster you configure.</p>
<h3>Is Databricks Predictive Optimization enabled by default?</h3>
<p>Databricks enables it by default for accounts created on or after November 11, 2024. The setting is inherited from the account through the catalog and schema to the table, and lower-level settings can override the inherited value. <code>DESCRIBE TABLE EXTENDED</code> shows whether it is enabled, disabled, or inherited, but not whether Databricks has executed maintenance.</p>
<h3>How is Databricks Predictive Optimization billed?</h3>
<p>Predictive Optimization uses billable serverless jobs compute, under a SKU that several other Databricks features share. Filter <code>system.billing.usage</code> on <code>billing_origin_product = 'PREDICTIVE_OPTIMIZATION'</code> to see its DBUs, and join <code>system.billing.list_prices</code> for an estimated list-price cost.</p>
<h3>Which tables does Predictive Optimization not cover?</h3>
<p>Predictive Optimization supports only Unity Catalog managed tables. Parquet tables, Delta tables outside Unity Catalog, Unity Catalog external Delta tables, and tables received through OpenSharing are not covered.</p>
<h3>Does Predictive Optimization replace a Databricks OPTIMIZE job with ZORDER?</h3>
<p>No. Predictive Optimization does not run <code>ZORDER</code>, and it ignores Z-ordered files, so keep a Databricks OPTIMIZE job that applies a deliberate Z-ordering strategy. A Databricks VACUUM job with a deliberate retention requirement also needs a check first, because Predictive Optimization follows the table's <code>delta.deletedFileRetentionDuration</code> property.</p>
<h2>Sources and further reading</h2>
<ul>
<li><p><a href="https://docs.databricks.com/aws/en/optimizations/predictive-optimization">Predictive Optimization for Unity Catalog managed tables</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/admin/system-tables/predictive-optimization">Predictive Optimization system table reference</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/admin/usage/system-tables">Monitor costs using system tables</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/tables/operations/optimize">Optimize data file layout</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/tables/operations/vacuum">Remove unused data files with VACUUM</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-aux-analyze-compute-statistics">ANALYZE TABLE … COMPUTE STATISTICS</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/ingestion/data-migration/convert-to-delta">Convert to Delta Lake</a></p>
</li>
</ul>
]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/databricks-predictive-optimization/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Always-On Databricks Streaming Tables: What Continuous Execution Costs You</title>
    <link>https://altimate.ai/blog/databricks-streaming-tables-continuous-vs-triggered</link>
    <guid isPermaLink="true">https://altimate.ai/blog/databricks-streaming-tables-continuous-vs-triggered</guid>
    <pubDate>Fri, 09 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Saurabh Arora</dc:creator>
    <category>Databricks</category>
    <category>databricks cost</category>
    <category>Cost Optimization</category>
    <category>Data Pipelines</category>
    <description>A Databricks streaming table can process data incrementally without running continuously. Confusing those two decisions is an expensive mistake.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/databricks-streaming-tables-continuous-vs-triggered/cover.jpg" alt="Always-On Databricks Streaming Tables: What Continuous Execution Costs You" /></p>
<p><em>A Databricks streaming table can process data incrementally without running continuously. Confusing those two decisions is an expensive mistake.</em></p>
<p>Continuous Lakeflow pipelines can incur unnecessary compute costs when their configured freshness exceeds actual business requirements. A pipeline with a 15-minute freshness requirement, for example, does not necessarily need compute available continuously. If the source is quiet for long periods, executors spend most of their time waiting while the pipeline continues paying for that availability. This often happens when teams choose continuous execution during launch to meet freshness requirements but never revisit the execution model as usage patterns become clearer.</p>
<p>Databricks cost reviews tend to focus on <a href="/blog/databricks-right-sizing-vs-autoscaling">oversized clusters</a>. That matters, but it is often not the largest mistake in a Lakeflow pipeline. The more consequential problem can sit one level above node size: the execution lifecycle does not match the latency the business actually uses.</p>
<p>The phrase “always-on streaming table” also hides a technical distinction. A Databricks streaming table defines how data is processed. Continuous and triggered modes define how the pipeline runs. Databricks supports streaming tables and materialized views in either pipeline mode, and standalone streaming tables and materialized views are always refreshed in triggered mode. Lakeflow pipelines were called Databricks DLT (Delta Live Tables) until June 2025, when Databricks renamed the product Spark Declarative Pipelines on Lakeflow.</p>
<p>A Databricks streaming table therefore does not need to run continuously to remain incremental. The better question for Databricks cost optimization is: <em>What is the least expensive execution pattern that still satisfies the measured freshness requirement?</em></p>
<h2>Do Databricks streaming tables need to run continuously?</h2>
<p>No. A Databricks streaming table records its progress through checkpoints, so it processes data incrementally in either of its two modes: triggered or continuous.</p>
<ul>
<li><p>In <strong>triggered mode</strong>, the pipeline starts, processes the data available when the update begins, commits its progress, and stops. The next update resumes from that checkpoint. It does not need to replay the complete source history.</p>
</li>
<li><p><strong>Continuous mode</strong> keeps the pipeline active and processes new data as it arrives. This reduces the delay between arrival and processing, but it also requires continuously available compute.</p>
</li>
</ul>
<p>Those modes solve different problems.</p>
<ul>
<li><p>Triggered execution fits an hourly finance model, a fifteen-minute operations dashboard, or a source that lands files in periodic bursts.</p>
</li>
<li><p>Continuous execution fits fraud decisions, alerting, inventory updates, and other workloads where seconds of delay change an operational outcome.</p>
</li>
</ul>
<p>Databricks recommends starting with triggered execution because it consumes compute only while an update is running. Continuous execution should be reserved for workloads with a demonstrated low-latency requirement. The current guidance from Databricks places <a href="https://docs.databricks.com/gcp/en/ldp/properties#pipelines-trigger-interval">triggered pipelines roughly in the ten-minute-to-daily range</a> and continuous pipelines in the ten-second-to-few-minute range. Real-time mode covers operational workloads that require sub-second processing.</p>
<img class="blog-fig-light" src="/blog/databricks-streaming-tables-continuous-vs-triggered/fig-1.svg" alt="Comparison table of triggered and continuous pipeline modes. How it runs: triggered starts, processes, commits and stops, while continuous stays active and processes on arrival. Compute: triggered runs only while an update runs, continuous is always on. Latency range: about 10 minutes to daily for triggered, about 10 seconds to a few minutes for continuous. Fits: hourly finance models, 15-minute dashboards and file bursts for triggered, and fraud decisions, alerting and inventory updates for continuous. Use when: triggered is the default starting point, continuous is for when low latency is a proven need." style="display:block;margin:0 auto" />
<p>These time ranges are useful starting points, but they are not substitutes for measuring the actual data path.</p>
<img src="/blog/databricks-streaming-tables-continuous-vs-triggered/fig-2.svg" alt="Timeline chart titled The cost is the area under the compute curve, across 24 hours. In the continuous row, a shaded compute window covers the whole day while ten short bars of useful work are scattered through it. In the triggered row, compute is shaded only around six short updates spaced through the day. Two notes read Cost: active time times metered rate, and Freshness: wake-up interval plus runtime." style="display:block;margin:0 auto" />
<p><em>Figure 1. Continuous execution buys a shorter wait between data arrival and processing. The cost is the full span of time for which compute remains available, not only the periods where useful work occurs.</em></p>
<h2>When do Databricks streaming tables need continuous mode?</h2>
<p>Continuous compute keeps a pipeline running at all times so it can process data as soon as it arrives. You pay for that compute whether or not the consumer needs data that quickly. Sometimes the consumer does. If an authorization system needs a risk signal within 30 seconds, a pipeline scheduled every 10 minutes will not meet the requirement.</p>
<p>Costs become a problem in two cases. First, the pipeline stays in continuous mode after the consumer no longer needs low latency. Second, a single low-latency table forces every upstream table it depends on, across the Bronze, Silver and Gold layers, to run in continuous execution too.</p>
<p>A production design needs an explicit freshness service-level objective (SLO), measured from source event time to data being available to the consumer. Measure this at P50 and P95. Include each step that adds delay: source delay, queueing, compute startup, checkpoint recovery, processing, commit time, downstream publication, and dashboard caching.</p>
<p>"Real time" is not a specific enough requirement to work with. A 5-second target, a 5-minute target and a 1-hour target each need a different pipeline design. Choose the pipeline mode based on the consumer's freshness requirement and the data's arrival pattern, not on the dataset type (streaming table or materialized view).</p>
<img src="/blog/databricks-streaming-tables-continuous-vs-triggered/fig-3.svg" alt="Diagram titled Freshness chooses the execution mode. Three bands: Real-time for sub-second operational decisions, Continuous for about 10 seconds to a few minutes with steady arrival and a measured need for fresh results, and Triggered for about 10 minutes to daily with periodic or bursty data. Three inputs sit below: consumer SLO measured at P50 and P95, arrival pattern, and startup share. A note says a streaming table or a materialized view can live in either a triggered or continuous pipeline." style="display:block;margin:0 auto" />
<p><em>Figure 2. Choose execution mode from the consumer’s freshness SLO and the arrival pattern. Dataset type and execution mode are independent decisions.</em></p>
<h2>Most of the DBU cost of continuous mode comes from uptime</h2>
<p>Consider a continuous pipeline that consumes an average of 6 DBUs per wall-clock hour. The number is illustrative. An actual evaluation should use billing records from the target pipeline.</p>
<p>Running continuously for a year produces:</p>
<pre><code class="language-plaintext">6 DBU/hour × 24 hours/day × 365 days = 52,560 DBUs/year</code></pre>
<p>Now assume the consumers only need data refreshed once an hour. Historical runs show that each triggered update finishes in fifteen minutes. After tightening the compute envelope, the pipeline consumes an average of 3 DBUs per active hour.</p>
<p>The annual consumption becomes:</p>
<pre><code class="language-plaintext">3 DBU/hour × 0.25 active hours/run × 24 runs/day × 365 days = 6,570 DBUs/year</code></pre>
<p>The modeled reduction is 45,990 DBUs, or 87.5%. The triggered design uses one-eighth as many DBUs.</p>
<table>
<thead>
<tr><th>Execution mode (illustrative model)</th><th>Refresh</th><th>Active compute per day</th><th>Average DBUs per active hour</th><th>DBUs per year</th></tr>
</thead>
<tbody>
<tr><td>Continuous</td><td>Always on</td><td>24 hours</td><td>6</td><td>52,560</td></tr>
<tr><td>Triggered, hourly</td><td>Once an hour, 15-minute update</td><td>6 hours</td><td>3</td><td>6,570 (87.5% fewer)</td></tr>
</tbody>
</table>
<p>Not every continuous pipeline can save 87.5%. The example changes two variables:</p>
<ul>
<li><p>The number of hours for which compute remains active.</p>
</li>
<li><p>Average DBU consumption during those active hours.</p>
</li>
</ul>
<p>Startup overhead, source volume, pipeline complexity, autoscaling behavior, performance mode, retries, and the actual duration of each update will change the result.</p>
<p>The formula is:</p>
<pre><code class="language-plaintext">annual platform cost = metered DBUs × effective DBU rate</code></pre>
<p>For classic compute, the underlying cloud infrastructure charge must be added separately. A list-price estimate can be produced by joining <code>system.billing.usage</code> to <code>system.billing.list_prices</code>, as in <a href="/blog/understanding-databricks-compute-costs">this breakdown of Databricks compute costs</a>. A realized-savings calculation should use the effective rate in the organization’s Databricks contract.</p>
<img src="/blog/databricks-streaming-tables-continuous-vs-triggered/fig-4.svg" alt="Comparison titled Two decisions turn 52,560 DBUs into 6,570. The continuous baseline uses 52,560 DBUs a year, from 6 DBUs per hour times 24 hours times 365 days. The hourly triggered pipeline with a tighter compute envelope uses 6,570 DBUs a year, from 3 DBUs per hour times 0.25 hours per run times 24 runs times 365 days, which is 8 times lower. A banner reads 45,990 fewer DBUs a year." style="display:block;margin:0 auto" />
<p><em>Figure 3. The eight-fold result is an illustrative model, not a benchmark. Recompute it with the pipeline’s observed DBUs, active duration, schedule, and effective price.</em></p>
<h2>Five-minute triggered schedules can be worse than continuous mode</h2>
<p>Replacing every continuous pipeline with a triggered one would create a different set of problems. At short intervals, triggered execution repeatedly pays for compute provisioning, runtime initialization, graph setup, source connections, checkpoint recovery, and teardown.</p>
<p>A <a href="https://community.databricks.com/t5/technical-blog/triggered-vs-continuous-mode-a-deep-dive-into-serverless/bc-p/165279">Databricks employee benchmark</a> compared a serverless pipeline scheduled every five minutes with the same workload running continuously. Each triggered lifecycle took between 153 and 194 seconds, averaging about 177 seconds. Continuous execution reduced median freshness from 4.0 minutes to 33 seconds and P95 freshness from 9.3 minutes to 60 seconds. Eligible streaming queries also saw roughly 1.7 times the throughput through stream pipelining.</p>
<p>That is one vendor-run benchmark on one workload, not a universal performance result. If a five-minute schedule spends nearly three minutes starting, processing, and stopping, the pipeline has become a busy loop with poor freshness. Continuous execution may be the better architecture and, at sufficient utilization, may not be the more expensive one.</p>
<p>There is also more room between the two extremes than the pipeline-mode toggle suggests. For continuous pipelines, <code>pipelines.trigger.interval</code> controls how frequently an individual flow begins an update. Current defaults vary by flow type:</p>
<ul>
<li><p>Five seconds for streaming queries.</p>
</li>
<li><p>One minute for complete queries over Delta sources.</p>
</li>
<li><p>Ten minutes when complete queries may use non-Delta sources.</p>
</li>
</ul>
<p>The interval can be configured at the table level when flows have different requirements.</p>
<p><a href="/blog/databricks-all-purpose-vs-jobs-compute">Serverless performance mode</a> also changes the trade-off. Standard mode is intended for cost-sensitive batch work and typically starts in four to six minutes. Performance-optimized mode starts in seconds and is designed for latency-sensitive execution. An hourly pipeline can usually absorb the startup time of Standard mode. A five-minute schedule probably cannot.</p>
<p>The boundary should be found empirically. Plot total active time, startup share, end-to-end freshness, backlog, update duration, and DBUs per unit of data over several representative weeks. The cheapest valid mode is then visible in the data.</p>
<h2>Split Lakeflow pipelines where freshness targets differ</h2>
<p>Many expensive pipelines are not uniformly latency-sensitive. Bronze ingestion may need new events within thirty seconds. Silver tables may tolerate five minutes. A Gold revenue materialized view may only be read during business hours and can refresh once per hour.</p>
<p>Keeping all three layers in one continuous graph makes the strictest freshness requirement the default for every dataset. That coupling is convenient during development and expensive in production.</p>
<p>Databricks recommends grouping datasets by shared cadence and dependency, then splitting pipelines at ownership, layer, and latency boundaries. Its guidance is direct: a continuous low-latency stream should not share a pipeline with a once-a-day batch aggregate.</p>
<p>A more appropriate design might use:</p>
<ol>
<li><p>A continuous ingestion pipeline for the small part of the graph that genuinely requires low latency.</p>
</li>
<li><p>A triggered transformation pipeline for datasets with five- or fifteen-minute requirements.</p>
</li>
<li><p>A separate hourly or daily pipeline for expensive aggregates and reporting tables.</p>
</li>
<li><p>A Lakeflow Job to coordinate dependencies and provide a unified operational view.</p>
</li>
</ol>
<p>This division also allows each pipeline to use <a href="/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper">the compute model suited to its work</a>. The continuous ingestion path can use serverless execution or enhanced autoscaling tuned for a steady streaming workload. Triggered transformations can use Standard serverless mode or a right-sized classic update cluster that terminates after the update.</p>
<p>Pipelines should not be split mechanically at every medallion-layer boundary. A tightly coupled chain with the same freshness requirement may belong together. The split is justified when independent control over cadence, compute, ownership, or failure blast radius is worth the additional orchestration.</p>
<img src="/blog/databricks-streaming-tables-continuous-vs-triggered/fig-5.svg" alt="Diagram titled Split the graph where latency diverges. On the left, a coupled graph holds Bronze Kafka ingestion with a 30-second SLO, Silver tables where 5 minutes is enough, and a Gold revenue materialized view where 1 hour is enough. On the right, three pipelines: pipeline A runs Kafka to Bronze continuously at 30-second freshness, pipeline B runs Bronze to Silver triggered every 5 to 15 minutes, and pipeline C runs Silver to Gold triggered hourly or in business hours. A Lakeflow Job coordinates dependencies, retries and end-to-end visibility." style="display:block;margin:0 auto" />
<p><em>Figure 4. Split the dataflow where freshness, ownership, or scaling requirements diverge. Orchestrate the pipelines together in a Lakeflow Job so the operational view remains coherent.</em></p>
<h2>A cheaper schedule does not fix an expensive refresh plan</h2>
<p>Execution mode controls when compute runs. Refresh strategy controls how much data each update processes, and that second decision can cost more than the first.</p>
<p>During a normal refresh, a streaming table processes records that arrived after its previous checkpoint. A full refresh clears the table’s data and checkpoints and reprocesses the source. Its duration and cost can therefore scale with the available source history.</p>
<p>Materialized views have different behavior. They preserve batch-equivalent results and are incrementally refreshed when Databricks can prove that an incremental plan is valid and economical.</p>
<p>On serverless pipelines, Databricks evaluates whether an incremental refresh is possible and uses a cost model to choose between incremental work and full recomputation. Materialized views running on classic pipeline compute are fully recomputed.</p>
<p>Moving a materialized-view pipeline from continuous execution to an hourly schedule may reduce uptime. It does not fix an hourly full scan of a large history.</p>
<p>Use <code>EXPLAIN CREATE MATERIALIZED VIEW</code> before deployment to evaluate structural eligibility for incremental refresh. At runtime, inspect the incrementalization information in the pipeline UI and event log. The event log can report techniques such as <code>ROW_BASED</code>, <code>GROUP_AGGREGATE</code>, <code>NO_OP</code>, and <code>FULL_RECOMPUTE</code>, as well as reasons why the cost model rejected an incremental plan.</p>
<p>The same event log exposes streaming backlog and, for classic pipelines, executor counts, task-slot utilization, and queued tasks. That evidence helps distinguish four problems that may look similar on an invoice:</p>
<ul>
<li><p>Continuous compute spending most of its time waiting for data.</p>
</li>
<li><p>A triggered pipeline dominated by startup.</p>
</li>
<li><p>A cluster with an inappropriate autoscaling floor or ceiling.</p>
</li>
<li><p>A materialized view repeatedly scanning more history than expected.</p>
</li>
</ul>
<p>Changing the schedule fixes only the first two.</p>
<h2>Storage costs do not scale with refresh frequency</h2>
<p>Bronze, Silver, and Gold tables can accumulate substantial storage. Continuous execution is not automatically the cause. Storage consumption is affected by logical data retention, duplicate materializations, unnecessary persisted intermediates, Delta history, Change Data Feed retention, streaming state, checkpoints, and table design.</p>
<p>A pipeline that refreshes every minute and one that refreshes every hour should converge to the same logical table contents if they process the same input correctly. Refresh frequency can affect checkpoint and transaction-log churn, small-file patterns, maintenance activity, and how quickly data becomes eligible for optimization. Refreshing more often does not mean storing proportionally more data.</p>
<p>Use pipeline-scoped views for intermediate transformations that do not need to be queried outside the pipeline. This avoids persisting every stage of the graph as another managed table.</p>
<p>Lakeflow-managed tables receive <a href="/blog/databricks-predictive-optimization">automatic maintenance</a>, including <code>OPTIMIZE</code> and <code>VACUUM</code>. Predictive-optimization activity can be inspected through <code>system.storage.predictive_optimization_operations_history</code>.</p>
<p>Treat that maintenance as a measurable cost line. It is not a substitute for deciding which datasets need to be materialized in the first place.</p>
<h2>How to audit Lakeflow pipeline costs with Databricks system tables</h2>
<p>A useful fleet audit should answer four questions for every pipeline:</p>
<ol>
<li><p>How much did the pipeline cost over the last thirty days?</p>
</li>
<li><p>Is it actually running continuously, including through Job orchestration?</p>
</li>
<li><p>What freshness did consumers receive, and what freshness do they require?</p>
</li>
<li><p>Where did active time go: startup, useful processing, backlog recovery, waiting, maintenance, or full recomputation?</p>
</li>
</ol>
<p>Among the Databricks system tables, <code>system.billing.usage</code> attributes Lakeflow usage through <code>usage_metadata.dlt_pipeline_id</code>. Update and maintenance identifiers are also available. <code>system.lakeflow.pipelines</code> is an SCD Type 2 table that contains pipeline type and settings such as <code>continuous</code>, <code>serverless</code>, and edition.</p>
<p>The following query provides a useful first ranking. It estimates list-price platform cost. Negotiated pricing and the underlying infrastructure cost of classic compute need to be handled separately.</p>
<pre><code class="language-sql">WITH current_pipelines AS (
  SELECT * EXCEPT (rn)
  FROM (
    SELECT
      *,
      ROW_NUMBER() OVER (
        PARTITION BY workspace_id, pipeline_id
        ORDER BY change_time DESC
      ) AS rn
    FROM system.lakeflow.pipelines
  )
  WHERE rn = 1
    AND delete_time IS NULL
),
usage_30d AS (
  SELECT
    u.workspace_id,
    u.usage_metadata.dlt_pipeline_id AS pipeline_id,
    SUM(u.usage_quantity) AS dbus_30d,
    SUM(
      u.usage_quantity * lp.pricing.effective_list.default
    ) AS estimated_list_cost_30d
  FROM system.billing.usage u
  LEFT JOIN system.billing.list_prices lp
    ON u.cloud = lp.cloud
   AND u.sku_name = lp.sku_name
   AND u.usage_start_time &gt;= lp.price_start_time
   AND (
     lp.price_end_time IS NULL
     OR u.usage_start_time &lt; lp.price_end_time
   )
  WHERE u.usage_date &gt;= CURRENT_DATE() - INTERVAL 30 DAYS
    AND u.usage_metadata.dlt_pipeline_id IS NOT NULL
  GROUP BY ALL
)
SELECT
  p.workspace_id,
  p.pipeline_id,
  p.name,
  p.pipeline_type,
  p.settings.continuous AS pipeline_continuous,
  p.settings.serverless AS serverless,
  p.settings.edition AS edition,
  COALESCE(u.dbus_30d, 0) AS dbus_30d,
  COALESCE(u.estimated_list_cost_30d, 0)
    AS estimated_list_cost_30d
FROM current_pipelines p
LEFT JOIN usage_30d u
  USING (workspace_id, pipeline_id)
ORDER BY estimated_list_cost_30d DESC;</code></pre>
<p>A settings-only audit has one limitation. Databricks now recommends running continuous pipelines through a continuous Lakeflow Job. Job orchestration overrides the pipeline’s configured mode. A pipeline can therefore have <code>settings.continuous = false</code> while still being executed continuously by a Job.</p>
<p>The audit must also inspect <code>system.lakeflow.jobs</code> for <code>CONTINUOUS</code> triggers and correlate those Jobs with pipeline updates. Looking only at the pipeline setting will miss part of the always-on fleet.</p>
<p>The invoice tells you where to investigate. The event log explains why the spend occurred. Consumer SLOs determine whether the design can be changed.</p>
<h2>How to automate Lakeflow pipeline cost changes safely</h2>
<p>A platform team can manually fix three pipelines. It cannot repeatedly inspect hundreds of pipelines as data volumes, query plans, consumer behavior, and business hours change.</p>
<p>A safe optimization loop has five stages:</p>
<ol>
<li><p><strong>Observe.</strong> Collect enough history to capture weekdays, weekends, peak periods, retries, and backfills.</p>
</li>
<li><p><strong>Diagnose.</strong> Identify the dominant mechanism: unnecessary continuous uptime, startup-heavy triggering, oversizing, a wide autoscaling range, backlog recovery, or full recomputation.</p>
</li>
<li><p><strong>Price.</strong> Attach the evidence, expected saving, freshness impact, owner, and rollback condition to one proposed change.</p>
</li>
<li><p><strong>Apply.</strong> Make the change after the appropriate approval and, where possible, between pipeline runs.</p>
</li>
<li><p><strong>Watch.</strong> Compare cost, failures, backlog, duration, and freshness with the previous baseline. Revert if an agreed guardrail is breached.</p>
</li>
</ol>
<p>Cadence changes deserve particular care. Moving from thirty-second to hourly freshness changes a business promise, not merely a compute setting.</p>
<p>The Altimate platform can surface cadence mismatches as quantified, owned opportunities. Auto Tune can apply supported compute-sizing changes with approval, policy checks, monitoring, and rollback. <a href="/blog/right-sizing-databricks-job-clusters-automatically">Altimate’s current Databricks workflow</a> already follows that safety model: changes are applied between runs and reverted if performance deteriorates.</p>
<p>The available serverless levers are cadence, performance mode, pipeline boundaries, serverless usage policies, query shape, and whether a materialized view can incrementalize. On classic pipelines, node type, enhanced-autoscaling ranges, and minimum worker floors remain meaningful controls.</p>
<p>An agent should not silently change a pipeline from thirty-second freshness to hourly freshness because the bill looks high. Automation should find the mismatch, quantify it, route it to the owner, apply the approved change, and verify that the promised freshness still holds.</p>
<img src="/blog/databricks-streaming-tables-continuous-vs-triggered/fig-6.svg" alt="Diagram titled Optimization is a monitored control loop, with five steps: observe, diagnose, price, apply and watch. Below, a cadence decision panel says to keep the business owner in the loop, because changing 30-second freshness to hourly changes the product promise, and is labelled Discover, priced and owned opportunity. A compute decision panel says approval-gated sizing can be applied, monitored and rolled back, and is labelled Auto Tune, policy-checked and reversible." style="display:block;margin:0 auto" />
<p><em>Figure 5. Cadence changes alter a business SLO and should remain explicit. Compute changes can be automated more aggressively when they are approval-gated, monitored, and reversible.</em></p>
<h2>How to choose an execution mode for Databricks streaming tables</h2>
<p>The cost of a streaming pipeline follows its latency commitments, especially the commitments nobody has re-examined.</p>
<p>Treat these as four separate design decisions:</p>
<ul>
<li><p>Dataset type</p>
</li>
<li><p>Refresh strategy</p>
</li>
<li><p>Execution mode</p>
</li>
<li><p>Compute sizing</p>
</li>
</ul>
<p>Start with triggered execution, and move to continuous execution when a measured freshness requirement needs it. At short scheduling intervals, account for startup overhead, because continuous execution may be the more efficient design. Split pipelines when datasets have different cadence, ownership, scaling, or failure requirements. Measure spend from billing tables, explain it with the event log, and validate every change against end-to-end freshness.</p>
<p>The largest saving may leave the SQL untouched and change only how long the pipeline's compute stays available.</p>
<h2>Frequently asked questions</h2>
<h3>Do Databricks streaming tables need to run continuously?</h3>
<p>No. A Databricks streaming table records its progress through checkpoints, so it stays incremental in triggered mode. In triggered mode, the pipeline starts, processes the data available when the update begins, commits its progress, and stops. The next update resumes from that checkpoint.</p>
<h3>What is the difference between triggered and continuous pipeline mode?</h3>
<p>Triggered mode consumes compute only while an update is running. Continuous mode keeps the pipeline active and processes new data as it arrives, which requires continuously available compute. Databricks guidance places triggered pipelines roughly in the ten-minute-to-daily range and continuous pipelines in the ten-second-to-few-minute range.</p>
<h3>How much does a continuous streaming table cost compared with a triggered one?</h3>
<p>In this article's illustrative model, a continuous pipeline at 6 DBUs per hour uses 52,560 DBUs a year. An hourly triggered pipeline that runs fifteen minutes per update at 3 DBUs per active hour uses 6,570 DBUs a year, which is 87.5% less. Startup overhead, source volume, autoscaling behavior, retries and update duration will change the result for a real pipeline.</p>
<h3>When is continuous mode cheaper than a triggered schedule?</h3>
<p>At short intervals, triggered execution repeatedly pays for compute provisioning, runtime initialization, checkpoint recovery, and teardown. In one Databricks employee benchmark, each triggered lifecycle on a five-minute schedule took between 153 and 194 seconds. At sufficient utilization, continuous execution may not be the more expensive design.</p>
<h3>How do I find which Lakeflow pipelines run continuously?</h3>
<p>In the Databricks system tables, join <code>system.billing.usage</code>, which attributes Lakeflow usage through <code>usage_metadata.dlt_pipeline_id</code>, to <code>system.lakeflow.pipelines</code>, which holds settings such as <code>continuous</code> and <code>serverless</code>. Then inspect <code>system.lakeflow.jobs</code> for <code>CONTINUOUS</code> triggers, because Job orchestration overrides the pipeline's configured mode.</p>
<h3>Is a Databricks DLT pipeline the same as Spark Declarative Pipelines?</h3>
<p>Yes. In June 2025 Databricks renamed DLT to Spark Declarative Pipelines on Lakeflow, and no migration is required. A Databricks DLT pipeline and a Lakeflow pipeline are the same product, so the execution-mode trade-offs in this article apply to both.</p>
<h2>Sources and further reading</h2>
<ul>
<li><p><a href="https://docs.databricks.com/aws/en/ldp/concepts/pipeline-mode">Databricks: Triggered vs. continuous pipeline mode</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/release-notes/product/2025/june">Databricks: June 2025 release notes, DLT is now Spark Declarative Pipelines on Lakeflow</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/ldp/concepts/how-to-use-pipelines">Databricks: How to use Lakeflow pipelines</a></p>
</li>
<li><p><a href="https://community.databricks.com/t5/technical-blog/triggered-vs-continuous-mode-a-deep-dive-into-serverless/bc-p/165279">Databricks Community: Triggered vs. continuous serverless benchmark</a></p>
</li>
<li><p><a href="https://docs.databricks.com/gcp/en/ldp/properties">Databricks: Pipeline properties and trigger intervals</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/compute/serverless/migration">Databricks: Serverless performance modes</a></p>
</li>
<li><p><a href="https://docs.databricks.com/gcp/en/ldp/best-practices/organize-datasets">Databricks: Organize datasets across pipelines</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/ldp/incremental-refresh">Databricks: Incremental refresh for materialized views</a></p>
</li>
<li><p><a href="https://docs.databricks.com/gcp/en/ldp/monitor-event-logs">Databricks: Pipeline event log</a></p>
</li>
<li><p><a href="https://docs.databricks.com/gcp/en/admin/system-tables/predictive-optimization">Databricks: Predictive Optimization system table</a></p>
</li>
<li><p><a href="https://docs.databricks.com/gcp/en/admin/system-tables/billing">Databricks: Billable usage system table</a></p>
</li>
<li><p><a href="https://docs.databricks.com/aws/en/admin/system-tables/jobs">Databricks: Lakeflow system tables</a></p>
</li>
<li><p><a href="/use-cases/altimate-for-databricks">Altimate: Databricks cost optimization</a></p>
</li>
</ul>
]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/databricks-streaming-tables-continuous-vs-triggered/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Databricks Cost Optimization: Right-Sizing vs Autoscaling</title>
    <link>https://altimate.ai/blog/databricks-right-sizing-vs-autoscaling</link>
    <guid isPermaLink="true">https://altimate.ai/blog/databricks-right-sizing-vs-autoscaling</guid>
    <pubDate>Mon, 05 Oct 2026 09:00:00 GMT</pubDate>
    <dc:creator>Sudhanshu Prajapati</dc:creator>
    <category>Databricks</category>
    <category>databricks cost</category>
    <category>databricks compute</category>
    <category>Cost Optimization</category>
    <description>Cutting a Databricks cluster from four workers to two made the job 88% slower and 13% pricier, and autoscaling from one to four cost 75% more. Three runs of the same job show why.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/databricks-right-sizing-vs-autoscaling/cover.jpg" alt="Databricks Cost Optimization: Right-Sizing vs Autoscaling" /></p>
<p>Two recommendations come up in almost every Databricks cost review. First, if a fixed cluster looks underused, reduce the worker count. Second, if demand changes during a run, enable autoscaling. Both sound like easy ways to stop paying for redundant compute.</p>
<p>I had a cluster that seemed to fit the first case. It ran with four <code>Standard_D4ds_v5</code> workers, but the <em>Metrics</em> tab showed low CPU for much of the job. So I decided to cut it down to two workers, expecting a decent saving. Instead, it made the job 88% slower (363 seconds against 193 seconds) and about 13% pricier in compute.</p>
<p>So I looked at autoscaling, which is the more sensible next step. I configured the cluster to start with one worker and scale to four, expecting it to add capacity for the busy part and reduce it when demand dropped. However, the run took 482 seconds and cost about 75% more compute than the original.</p>
<p>How come two reasonable changes make the same workload slower?</p>
<p>Three runs of the same job show what right-sizing changes, where autoscaling helps, and what to check before you resize a Databricks cluster to cut cost.</p>
<h2>Right-sizing and autoscaling change different Databricks cluster settings</h2>
<p><a href="/blog/right-sizing-databricks-job-clusters-automatically">Right-sizing</a> covers more than the number of workers. It can include the worker and driver instance types, their sizes, and the number of workers assigned to the cluster. In this post, I kept the instance type fixed at <code>Standard_D4ds_v5</code> for the workers and the driver and changed only the worker count: four fixed workers in run 1, two fixed workers in run 2, and autoscaling between one and four workers in run 3.</p>
<p>A fixed cluster uses one worker count:</p>
<pre><code class="language-json">{
  "node_type_id": "Standard_D4ds_v5",
  "num_workers": 4
}</code></pre>
<p>An autoscaling cluster uses a minimum and maximum:</p>
<pre><code class="language-json">{
  "node_type_id": "Standard_D4ds_v5",
  "autoscale": {
    "min_workers": 1,
    "max_workers": 4
  }
}</code></pre>
<p>Databricks shows the same choice in the compute UI. Without autoscaling, you enter <strong>Workers</strong>. With autoscaling enabled, you enter <strong>Min</strong> and <strong>Max</strong>.</p>
<p>Databricks autoscaling does not choose those numbers for you. It only adds or removes workers within the range you configure. You still need to decide:</p>
<ul>
<li><p>whether <code>max_workers</code> is high enough for the busiest part of the job</p>
</li>
<li><p>whether <code>min_workers</code> is high enough for the work that starts before the cluster can scale out</p>
</li>
<li><p>whether the high- and low-demand parts of the job last long enough for scaling to help.</p>
</li>
</ul>
<p>The minimum, maximum, and the length of each workload phase all affect whether Databricks autoscaling helps. The autoscaling cluster I tested in run 3 started at one worker, which shows why.</p>
<h2>Three Databricks cluster configurations ran the same job</h2>
<p>The workload I described in the opening paragraphs had two phases:</p>
<ul>
<li><p>The first phase shuffled and joined the full dataset. It created more parallel work.</p>
</li>
<li><p>The second phase ran 40 short iterations over a narrow slice and needed fewer workers.</p>
</li>
</ul>
<p>I ran the same job on an Azure Databricks workspace with <code>Standard_D4ds_v5</code> workers. The worker type, driver type, and workload stayed the same. Only the cluster sizing configuration changed.</p>
<p>For a production sizing decision, repeat each configuration several times and compare the median results. The three runs here show how worker count, runtime, and autoscaling timing interacted in this comparison.</p>
<p>Job-time compute cost in the table is node-seconds priced at the Azure pay-as-you-go list rate, explained in the pricing section below.</p>
<table>
<thead>
<tr><th>Run</th><th>Configuration</th><th>Runtime</th><th>Change from run 1</th><th>Compute cost of one run</th><th>Change in cost from run 1</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>4 workers</td><td>193 seconds</td><td>Baseline</td><td>about $0.22</td><td>Baseline</td></tr>
<tr><td>2</td><td>2 workers</td><td>363 seconds</td><td>88% longer</td><td>about $0.25</td><td>13% more</td></tr>
<tr><td>3</td><td>Autoscaling from 1 to 4 workers</td><td>482 seconds</td><td>150% longer</td><td>about $0.38</td><td>75% more</td></tr>
</tbody>
</table>
<img class="blog-fig-light" src="/blog/databricks-right-sizing-vs-autoscaling/fig-1.svg" alt="Bar chart titled Job runtime by cluster configuration. Fixed 4 workers ran in 193 seconds. Fixed 2 workers ran in 363 seconds, 88% longer than the baseline. Autoscaling from 1 to 4 workers ran in 482 seconds, 150% longer than the baseline." style="display:block;margin:0 auto" />
<p><em>Job runtime for the three Databricks cluster configurations.</em></p>
<p>Because runs 1 and 2 used fixed worker counts, they have a clear break-even point that we can calculate. Run 3 needs a different comparison: when the additional workers became available and how that timing affected the job.</p>
<h3>Run 1 with four fixed workers</h3>
<p>Run 1 was the configuration I initially wanted to reduce. It completed the job in 193 seconds. The active-worker line stayed at four while CPU use rose and fell below it.</p>
<img src="/blog/databricks-right-sizing-vs-autoscaling/fig-2.webp" alt="Databricks Metrics chart of CPU utilization and active nodes for run 1, 22:30 to 23:05 IST on 6 Sep 2026. The active nodes line jumps to 5 at the start and stays at 5. CPU utilization, mostly user time, spikes several times to between about 30% and 71%, then stays near 5% from about 22:55." style="display:block;margin:0 auto" />
<p><em>Run 1 CPU utilization and active nodes. Four workers remain active while CPU demand varies.</em></p>
<p>In the screenshot, the average CPU level makes the cluster look too large. But the metrics chart does not tell us whether tasks were queued during a short peak, whether the job waited on I/O, or whether it used all available parallelism for part of the run.</p>
<p>The <strong>Metrics</strong> tab is a useful place to find a cluster worth reviewing, but it is not enough to decide the new worker count by itself.</p>
<h3>Run 2 with two fixed workers</h3>
<p>First, I cut the fixed worker count from four to two. Run 2 took 363 seconds to complete. Including the driver, its Spark node count dropped from five to three.</p>
<p>Because the worker and driver types stayed the same, Spark node-seconds give us a simple way to compare the two fixed configurations.</p>
<p>The baseline used:</p>
<p>5 Spark nodes × 193 seconds = 965 Spark node-seconds</p>
<p>To stay below 965 node-seconds, the three-node configuration had to finish within:</p>
<p>965 ÷ 3 = 321.7 seconds</p>
<p>It took 363 seconds:</p>
<p>3 Spark nodes × 363 seconds = 1,089 Spark node-seconds</p>
<p>The cluster used fewer nodes at any one time, but the longer runtime pushed job-time node-seconds 13% above the baseline.</p>
<img class="blog-fig-light" src="/blog/databricks-right-sizing-vs-autoscaling/fig-3.svg" alt="Line chart titled Run 2 crossed the fixed-size break-even point. Node-seconds for the 3-node configuration rise as 3 times runtime and cross the 5-node baseline of 965 node-seconds at 322 seconds. The observed run 2 point sits at 363 seconds and 1,089 node-seconds, 13% above baseline." style="display:block;margin:0 auto" />
<p><em>Run 2 crossed the 322-second break-even point for the fixed-size comparison.</em></p>
<p>The Metrics view confirms that the cluster stayed at two workers:</p>
<img src="/blog/databricks-right-sizing-vs-autoscaling/fig-4.webp" alt="Databricks Metrics chart of CPU utilization and active nodes for run 2, 23:16 to 23:28 IST on 6 Sep 2026. The active nodes line rises to 2 and then to 3, two workers plus the driver, and stays at 3. CPU utilization runs at about 65% from 23:18 to 23:22, drops to about 21% for two minutes, then to about 6%." style="display:block;margin:0 auto" />
<p><em>Run 2 CPU utilization and active nodes. Two workers remain active throughout the measured period.</em></p>
<p>The Spark UI provides the context missing from the average CPU chart. Two executors were available at the start. The shuffle-heavy first phase took most of the runtime, while the 40 short iterations were packed into the smaller block near the end.</p>
<img src="/blog/databricks-right-sizing-vs-autoscaling/fig-5.webp" alt="Annotated Spark UI event timeline for run 2. Callouts read: 1, two executors are added at the start. 2, the first phase takes most of the runtime. 3, the short, dense tail needs less capacity. Long job bars fill the first five minutes and many short tasks cluster in the final minute." style="display:block;margin:0 auto" />
<p><em>Annotated Spark UI event timeline for run 2.</em></p>
<p>Two workers were enough for the second phase. They were not enough for the first. The job crossed its 322-second break-even point before it finished.</p>
<h3>Run 3 with autoscaling from one to four workers</h3>
<p>The third run was meant to maintain access to four workers without using all four for the complete job. I configured autoscaling from one to four workers.</p>
<p>The run completed in 482 seconds, making it the slowest of the three. Run 3 was also the most expensive. Autoscaling changes the node count during the run, so I derived its node-seconds from the measured compute share, which came to about 1,690 node-seconds against 965 for run 1. That is a 75% increase in compute, larger than the 13% increase in run 2.</p>
<p>The <em>Metrics</em> view shows that the worker count increased after the workload had started:</p>
<img src="/blog/databricks-right-sizing-vs-autoscaling/fig-6.webp" alt="Databricks Metrics chart of CPU utilization and active nodes for run 3, 23:29 to 23:44 IST on 6 Sep 2026. The active nodes line starts at 2, rises to 4 at about 23:35 and to 5 at about 23:39. CPU utilization peaks at about 65% at 23:35 and has fallen to about 10% by the time the fifth node arrives." style="display:block;margin:0 auto" />
<p><em>Run 3 CPU utilization and active nodes. The active-worker line rises during the workload.</em></p>
<p>The <em>Spark UI</em> shows one executor at the beginning, two more arriving at about minute six, and another executor appearing later.</p>
<img src="/blog/databricks-right-sizing-vs-autoscaling/fig-7.webp" alt="Annotated Spark UI event timeline for run 3. Callouts read: 1, one executor is available at the start. 2, two more executors arrive at about minute 6. 3, scale-out trails the workload. Executor 3 is added at about minute 10, after the dense block of short tasks ends." style="display:block;margin:0 auto" />
<p><em>Annotated Spark UI event timeline for run 3.</em></p>
<p>The autoscaling timing matters in two places. First, an autoscaling cluster starts with <code>min_workers</code>. If the busiest phase begins immediately, setting a low minimum can slow the job while Databricks adds workers. The Databricks compute configuration docs (<a href="https://learn.microsoft.com/en-us/azure/databricks/compute/configure">Azure</a>, <a href="https://docs.databricks.com/aws/en/compute/configure">AWS</a>) state that optimized autoscaling can move from the minimum to the maximum in at most two scaling events, but the additional workers still need time to become available.</p>
<p>Second, demand must remain low long enough for workers to be removed. On workspaces on the Premium plan, Databricks uses a 40-second underutilization window for job compute and a 150-second window for <a href="/blog/databricks-all-purpose-vs-jobs-compute">all-purpose compute</a>. If a lighter phase is shorter than that window, the job may finish before scale-down occurs.</p>
<p>That is what happened in this run. The busiest phase came first, but the cluster started with one worker and added the others after work was already running. The second phase, the 40 short iterations, lasted about a minute, shorter than the 150-second window for all-purpose compute. The 1-to-4 range therefore slowed the first phase and had little opportunity to remove workers during the second.</p>
<p>For this job, <code>min_workers: 1</code> was too low. A more useful follow-up would compare autoscaling ranges of 2-to-4 and 3-to-4 workers with the fixed four-worker baseline.</p>
<h2>Why fewer workers and autoscaling both raised Databricks cost</h2>
<p>Reducing the worker count changes two things at the same time. It lowers the amount of compute available per minute, but it can also increase the number of minutes needed to finish the job.</p>
<p>In the fixed-size comparison, the node count fell by 40%, but runtime increased by 88%. The longer runtime was enough to offset the smaller cluster, and job-time node-seconds increased by 13%.</p>
<p>A single run differs by cents, which is why this kind of change passes a review unnoticed. The difference appears when the job repeats. If the same job runs every hour (720 runs a month), the monthly compute cost looks like this:</p>
<table>
<thead>
<tr><th>Run</th><th>Monthly compute cost</th><th>Difference from run 1</th></tr>
</thead>
<tbody>
<tr><td>1: 4 workers</td><td>about $158</td><td>Baseline</td></tr>
<tr><td>2: 2 workers</td><td>about $178</td><td>about $20 more</td></tr>
<tr><td>3: autoscaling 1 to 4</td><td>about $276</td><td>about $118 more</td></tr>
</tbody>
</table>
<p>These figures are measured across three runs. I multiplied node-seconds by the Azure pay-as-you-go list price for <code>Standard_D4ds_v5</code> on a Premium workspace ($0.55 for the 1.00 DBU per hour plus the VM). Your negotiated rate and your region will change the dollar amounts. The percentages stay the same.</p>
<p>Databricks autoscaling had a different problem. The maximum still allowed four workers, but the minimum of one did not suit a job that started with its busiest phase. Additional workers arrived after the work had already begun.</p>
<p>The next useful comparison is an autoscaling range such as 2-to-4 or 3-to-4, rather than another lower fixed count, repeated several times and compared with the four-worker baseline.</p>
<h2>How to compare Databricks compute cost with node-seconds</h2>
<p>The Databricks pricing model depends on the compute product, the amount of compute used, and how long it runs. On classic compute, the cloud provider also charges for the underlying virtual machines and related infrastructure. The exact Databricks cost therefore varies by cloud, region, compute type, plan, and account agreement.</p>
<p>For the two fixed-size runs in this test, the compute type and node types stayed the same. That is why node-seconds are useful for comparing job-time compute:</p>
<p>Spark node-seconds = (number of workers + 1 driver) × runtime</p>
<p>For run 1, that gives 5 nodes × 193 seconds = 965 node-seconds. At $0.816 per node-hour, that is 965 ÷ 3,600 × $0.816, about $0.22. Run 2 is 3 × 363 = 1,089 node-seconds, about $0.25.</p>
<p>This is a comparison method, not an account-specific price. It tells us whether the reduction in nodes was large enough to make up for the increase in runtime.</p>
<p>To <a href="/blog/understanding-databricks-compute-costs">calculate Databricks pricing</a> for your own environment, use the usage records in <code>system.billing.usage</code>, apply the relevant list price from <code>system.billing.list_prices</code>, and include the infrastructure charges from your cloud provider where applicable.</p>
<p>The billed cost in <code>system.billing.usage</code> came out lower for runs 2 and 3 than for run 1, because run 1's cluster sat idle for about 36 minutes before I deleted it. That idle time is not part of the job, so I compared job time only.</p>
<h2>How to use Databricks metrics and the Spark UI to find sizing candidates</h2>
<p>Databricks compute metrics are collected every minute, so a short peak can disappear inside an average. Use the <strong>Metrics</strong> tab to identify a cluster that may need a sizing change, then check the Spark UI before changing its worker count.</p>
<table>
<thead>
<tr><th>What you see</th><th>What to check next</th><th>Change worth testing</th></tr>
</thead>
<tbody>
<tr><td>Low CPU, no pending tasks, little spill or garbage collection, and enough runtime headroom</td><td>Task concurrency, scheduler delay, I/O wait, and several runs</td><td>Reduce the worker count or instance size in small steps.</td></tr>
<tr><td>Low CPU with high I/O wait, spill, garbage collection, or driver pressure</td><td>Stage metrics and hardware metrics</td><td>Fix the resource mismatch or the job before removing workers.</td></tr>
<tr><td>Pending tasks or long scheduler delay during a busy phase</td><td>Stage timeline and executor saturation</td><td>Keep or raise the fixed worker count or <code>max_workers</code>.</td></tr>
<tr><td>Long high- and low-demand periods in the same run</td><td>Worker timeline and phase duration</td><td>Test autoscaling and tune both <code>min_workers</code> and <code>max_workers</code>.</td></tr>
<tr><td>Heavy work starts immediately and the cluster scales out later</td><td>Executor-add events</td><td>Raise <code>min_workers</code>, start with more capacity, or use a fixed cluster.</td></tr>
</tbody>
</table>
<p>A low average CPU line is a reason to investigate a cluster, and on its own it does not tell you the new configuration.</p>
<h2>Autoscaling is unavailable or limited for some Databricks workloads</h2>
<p>Databricks autoscaling is not available, or does not behave the same way, for every workload.</p>
<table>
<thead>
<tr><th>Workload or configuration</th><th>Databricks behavior</th><th>What to do</th></tr>
</thead>
<tbody>
<tr><td><code>spark-submit</code> jobs</td><td>Databricks documents that autoscaling is not available.</td><td>Use fixed sizing for this job type.</td></tr>
<tr><td>Structured Streaming on classic compute</td><td>Scaling down has limitations. Databricks recommends <a href="/blog/databricks-streaming-tables-continuous-vs-triggered">Lakeflow pipelines</a> with enhanced autoscaling for supported streaming workloads.</td><td>Do not assume the cluster will regularly return to a low minimum.</td></tr>
<tr><td><code>spark.dynamicAllocation.enabled</code> with Databricks autoscaling</td><td>The two systems can make conflicting executor and worker decisions.</td><td>Use Databricks autoscaling instead of enabling both.</td></tr>
</tbody>
</table>
<p>Check the workload type before deciding that autoscaling is the next cost optimization step.</p>
<h2>AWS Databricks pricing separates DBU and infrastructure charges</h2>
<p>The runs in this test were performed on Azure Databricks, but the worker-sizing issue is not specific to Azure. A smaller Databricks cluster on AWS can also lose its expected saving when runtime increases more than the node count decreases.</p>
<p>The final AWS Databricks pricing calculation is different. For non-serverless compute, the Databricks charge and the underlying AWS infrastructure charges are separate. Use the runtime and worker-count comparison in this post to test configurations, then apply the DBU price and AWS infrastructure rates for your own account.</p>
<p>The 13% job-time node-second increase from this Azure test should not be copied directly into an AWS cost estimate. The workload behavior may transfer, but the price does not.</p>
<h2>How to choose between right-sizing and autoscaling</h2>
<p>Four workers looked underused in the <strong>Metrics</strong> tab. Reducing the cluster to two workers looked like an easy saving, and autoscaling from one to four looked like the next logical step. Across these three runs, both changes made the job slower (and therefore 13% and 75% more expensive in job-time compute).</p>
<p>The fixed cluster crossed its break-even point because the first phase needed more workers. The autoscaling cluster started that same phase with one worker and added capacity after the work had begun.</p>
<p>For Databricks cost optimization, start with the job rather than the average CPU number. Find when the job needs the most capacity, choose a fixed worker count or autoscaling range that can handle it, and then compare the result with the original run.</p>
<p>Give the job enough capacity for its busiest phase, without keeping workers it does not need.</p>
<h2>Frequently asked questions</h2>
<h3>Does Databricks autoscaling reduce cost?</h3>
<p>Not always. In this test, autoscaling from one to four workers took 482 seconds against 193 seconds for four fixed workers, and cost about 75% more in job-time compute. The cluster started its busiest phase with one worker and added workers after the work had begun.</p>
<h3>What is the difference between right-sizing and autoscaling in Databricks?</h3>
<p>Right-sizing can change the worker and driver instance types, their sizes, and the number of workers assigned to the cluster. Databricks autoscaling only adds or removes workers within the <code>min_workers</code> and <code>max_workers</code> range you configure, and it does not choose those numbers for you.</p>
<h3>Why did cutting a Databricks cluster from four workers to two cost more?</h3>
<p>The node count fell by 40%, but runtime increased by 88%, from 193 to 363 seconds. Job-time node-seconds rose from 965 to 1,089, which is 13% above the four-worker baseline.</p>
<h3>How long does Databricks wait before autoscaling removes workers?</h3>
<p>On workspaces on the Premium plan, Databricks uses a 40-second underutilization window for job compute and a 150-second window for all-purpose compute. If a lighter phase is shorter than that window, the job may finish before scale-down occurs.</p>
]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/databricks-right-sizing-vs-autoscaling/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>The Hidden Cost of Running Databricks Jobs on All-Purpose Compute</title>
    <link>https://altimate.ai/blog/databricks-all-purpose-vs-jobs-compute</link>
    <guid isPermaLink="true">https://altimate.ai/blog/databricks-all-purpose-vs-jobs-compute</guid>
    <pubDate>Wed, 23 Sep 2026 09:00:00 GMT</pubDate>
    <dc:creator>Saurabh Arora</dc:creator>
    <category>Databricks</category>
    <category>databricks cost</category>
    <category>databricks compute</category>
    <category>Cost Optimization</category>
    <description>Databricks interactive compute gets expensive when an automated workload is left running on infrastructure that was set up for a person working in the loop.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/databricks-all-purpose-vs-jobs-compute/cover.jpg" alt="The Hidden Cost of Running Databricks Jobs on All-Purpose Compute" /></p>
<p><em>Databricks interactive compute gets expensive when an automated workload is left running on infrastructure that was set up for a person working in the loop.</em></p>
<p>Interactive compute helps people develop and test code without waiting for a cluster to start each time. Costs can rise when that code becomes a scheduled job but keeps running on the same development cluster.</p>
<p>A data scientist runs a notebook cell, checks the results, changes a feature, and runs it again. Between commands, they might read the output or discuss it with a teammate. Keeping the cluster running makes it easier to pick up where they left off.</p>
<p>Platform teams often configure shared development environments for this kind of work. They allow extra capacity, give several people access, and set a shutdown timeout long enough to accommodate breaks.</p>
<p>Weeks later, the notebook is ready to run every morning at 6 AM. Someone adds a schedule but leaves it attached to the same all-purpose cluster. The job now runs without anyone working through the notebook. It may still be paying for extra capacity and idle time that helped during development.</p>
<img src="/blog/databricks-all-purpose-vs-jobs-compute/fig-1.svg" alt="Timeline titled You pay for the gaps between commands: an all-purpose cluster runs continuously while five short commands execute, with the gaps between them marked as time when no commands are running but the cluster still incurs charges." style="display:block;margin:0 auto" />
<p><em>Figure 1. A running all-purpose cluster incurs charges during the gaps between commands.</em></p>
<h2>Why does Databricks interactive compute keep running?</h2>
<p>Development involves pauses while people inspect results, debug code, and decide what to try next. A shared cluster that stays available through those pauses helps the team resume quickly. A scheduled batch job has different requirements: finish reliably, meet its deadline, and avoid unnecessary compute costs.</p>
<p>Databricks recommends serverless compute for most supported job workloads. For classic compute, it recommends Jobs compute, which terminates after the run completes. All-purpose compute shuts down according to its inactivity setting and may be shared with other users. For a scheduled job, the choice between all-purpose and Jobs compute decides whether billing stops when the run ends. Exceptions include iterative testing and frequent, short jobs where startup delays matter. For more information, see <a href="https://docs.databricks.com/aws/en/jobs/run-classic-jobs">Databricks guidance for Jobs compute</a>.</p>
<img src="/blog/databricks-all-purpose-vs-jobs-compute/fig-2.svg" alt="Two panels. Interactive development loops Run, Review, Edit, Run, with the goal of reducing waiting during development. A scheduled batch job goes Start, Run, Shut down, with the goal of meeting the deadline at a lower cost." style="display:block;margin:0 auto" />
<p><em>Figure 2. Development benefits from quick reruns. Scheduled batch jobs can often release compute when they finish.</em></p>
<p>When a notebook becomes a scheduled job, review its compute choice along with its code.</p>
<h2>DBU rates alone do not tell you what a Databricks workload costs</h2>
<p>A Databricks Unit, or DBU, is a unit of platform usage. Comparing DBU rates helps, but the rate alone does not tell you how much a workload will cost. With classic all-purpose compute, idle time before shutdown still incurs DBU and cloud-instance charges. For more information, see <a href="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill">Databricks Cost Optimization: 6 Levers That Cut Your Bill</a>.</p>
<p>A cluster might run commands for only a small part of the day while people review results, attend meetings, or work elsewhere. Keeping it available may be worthwhile during active development. A scheduled job may have little reason to keep that same environment running between executions.</p>
<p>Using smaller workers can reduce the cost of each running hour. Moving a scheduled workload to compute that stops after the run can also reduce the number of hours you pay for. Check both before deciding that cluster size is the main problem.</p>
<h2>Auto-termination can leave long gaps of paid idle time</h2>
<p>Auto-termination shuts down classic compute after a configured period of inactivity. Databricks considers it inactive once its tracked commands have finished. The configurable timeout ranges from 10 to 10,000 minutes. For more information, see <a href="https://docs.databricks.com/aws/en/compute/clusters-manage">Auto-termination documentation</a>.</p>
<p>Consider a 60-minute timeout. Five-minute commands start at 9:00, 9:50, 10:40, and 11:30. Each arrives before the cluster has been inactive for an hour, keeping it running throughout the morning.</p>
<img src="/blog/databricks-all-purpose-vs-jobs-compute/fig-3.svg" alt="Timeline of four five-minute commands at 9:00, 9:50, 10:40 and 11:30, each separated by 45 minutes idle. No gap reaches the 60-minute auto-termination timeout, so 20 minutes of commands keep the cluster on for about three hours." style="display:block;margin:0 auto" />
<p><em>Figure 3. Short commands can keep a cluster running for hours without exceeding its inactivity timeout.</em></p>
<p>A shorter timeout reduces idle time but makes users restart compute more often. Choose the timeout around how the team works, and review whether scheduled jobs still need that shared environment.</p>
<h2>Review compute when a notebook becomes a production job</h2>
<p>During development, an all-purpose cluster gives people room to inspect intermediate results, debug joins, and try different approaches. Once the notebook runs on a schedule, those requirements may change. The job configuration can still point to the development cluster unless someone explicitly changes it.</p>
<img src="/blog/databricks-all-purpose-vs-jobs-compute/fig-4.svg" alt="Develop, Test and Schedule stages all point at the same all-purpose cluster. Adding a schedule leaves the compute selection unchanged." style="display:block;margin:0 auto" />
<p><em>Figure 4. A scheduled job can retain the same all-purpose cluster used during development.</em></p>
<p>Include a compute review in the production deployment process. Confirm that the selected compute fits the job’s schedule, startup requirements, and dependencies.</p>
<p>Databricks provides a system-table query for identifying jobs that run on all-purpose compute. It gives platform teams a practical starting point for finding workloads to review. For more information, see the <a href="https://docs.databricks.com/aws/en/admin/system-tables/jobs">Jobs system-table reference</a>.</p>
<h2>Does Databricks serverless remove the compute decision?</h2>
<p>Serverless notebooks reduce the need to configure and manage infrastructure. Automated workloads still need an appropriate performance mode. Databricks offers two serverless performance modes:</p>
<ul>
<li><p><strong>Performance-optimized:</strong> Keeps warm capacity available to reduce startup delays.</p>
</li>
<li><p><strong>Standard:</strong> Suits batch jobs and pipelines that can tolerate startup times of roughly four to six minutes. Databricks states that it can cost up to 70% less than performance-optimized mode. Standard mode is available for Lakeflow jobs and pipelines, but not notebooks.</p>
</li>
</ul>
<p>The saving is a published maximum, so compare the cost and completion time of your workload. See <a href="https://docs.databricks.com/aws/en/compute/serverless/best-practices">Serverless performance-mode guidance</a>.</p>
<p>Check compatibility as well. Serverless notebooks and jobs do not support R or Spark RDD APIs, use Spark Connect, and do not provide the classic Spark UI. Some workloads will need code changes or classic compute. For more information, see <a href="/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper">Databricks Serverless vs Classic Compute</a>.</p>
<p>Choose based on what the workload needs: interactive development, scheduled batch processing, SQL queries, or capabilities available only on classic compute.</p>
<h2>Shared clusters make individual job costs harder to track</h2>
<p>Shared all-purpose compute also makes it harder to answer a basic question: how much did this pipeline cost last month? The <code>system.billing.usage</code> table includes <code>usage_metadata.job_id</code> for serverless jobs and jobs running on Jobs compute. That field is not populated for jobs running on all-purpose compute. See <a href="https://docs.databricks.com/aws/en/admin/system-tables/billing">Billable usage reference</a>.</p>
<p>Several notebooks and jobs can use the same cluster at once. You can see the cluster’s total usage, but assigning an exact share to each workload may require estimates.</p>
<img src="/blog/databricks-all-purpose-vs-jobs-compute/fig-5.svg" alt="Notebook A, Notebook B, Job 17, Job 42 and an analyst query all feed one all-purpose cluster that produces a single total cluster cost. On the right, Job 17, Job 42 and a SQL warehouse each carry their own cost line, because Jobs compute and serverless jobs include job IDs in billing usage." style="display:block;margin:0 auto" />
<p><em>Figure 5. Shared cluster costs may need to be allocated. Jobs compute and serverless jobs provide billing metadata tied to the job.</em></p>
<p>Moving a production job from all-purpose to Jobs compute can therefore improve cost reporting as well as reduce unnecessary running time.</p>
<h2>How to find Databricks jobs running on all-purpose compute</h2>
<p>Start by identifying jobs whose compute choice needs review. Then decide whether to move them, resize them, or retain their current configuration. This query adapts the <a href="https://docs.databricks.com/aws/en/admin/system-tables/jobs#find-jobs-running-on-all-purpose-compute">Databricks example</a> to list distinct job and cluster combinations used in the past 30 days. It includes workspace and cluster IDs so the results are easier to investigate.</p>
<pre><code class="language-sql">WITH recent AS (
  SELECT
    workspace_id,
    job_id,
    EXPLODE(compute_ids) AS cluster_id
  FROM system.lakeflow.job_task_run_timeline
  WHERE period_start_time &gt;= CURRENT_DATE() - INTERVAL 30 DAY
),
clusters AS (
  SELECT *
  FROM system.compute.clusters
  QUALIFY ROW_NUMBER() OVER (
    PARTITION BY workspace_id, cluster_id
    ORDER BY change_time DESC
  ) = 1
)
SELECT DISTINCT
  r.workspace_id,
  r.job_id,
  r.cluster_id,
  c.cluster_name,
  c.owned_by
FROM recent r
JOIN clusters c
  USING (workspace_id, cluster_id)
WHERE c.cluster_source IN ('UI', 'API');</code></pre>
<p>Treat the results as a review list. Some jobs may have a valid reason to use all-purpose compute. Use the cluster ID to investigate its billing usage and activity. Cluster-level usage does not establish the exact cost of each job sharing that cluster.</p>
<h2>What platform teams should monitor on Databricks</h2>
<table>
<thead>
<tr><th>Signal</th><th>What to check</th></tr>
</thead>
<tbody>
<tr><td>Production jobs on all-purpose compute</td><td>Whether the job still needs that environment or retained it from development.</td></tr>
<tr><td>Cluster running time compared with command activity</td><td>Whether long gaps support active development or are avoidable.</td></tr>
<tr><td>Auto-termination settings by team</td><td>Whether timeouts fit the team’s working patterns.</td></tr>
<tr><td>All-purpose spending that cannot be assigned to individual jobs</td><td>Whether shared compute is making cost reporting difficult.</td></tr>
<tr><td>Newly scheduled notebooks</td><td>Whether someone reviewed the compute choice before deployment.</td></tr>
</tbody>
</table>
<h2>Make the compute selection part of the deployment</h2>
<p>Very short timeouts and strict cluster-size limits can make development slower. A more useful policy is to review compute when a workload becomes scheduled or repeatable.</p>
<img src="/blog/databricks-all-purpose-vs-jobs-compute/fig-6.svg" alt="Develop and Test run on interactive compute. At Schedule, a compute review branches to job compute, serverless or classic Jobs, or to keeping all-purpose compute with a recorded reason. A checklist asks whether someone is actively using the notebook, whether it runs automatically, how much startup delay is acceptable, and whether it needs classic-only features." style="display:block;margin:0 auto" />
<p><em>Figure 6. Add a compute review when a notebook is scheduled for regular execution.</em></p>
<p>Ask four questions:</p>
<ol>
<li><p>Is someone actively running commands and waiting for results?</p>
</li>
<li><p>Will the workload run on a schedule or another repeatable trigger?</p>
</li>
<li><p>How much startup delay can it tolerate while meeting its deadline?</p>
</li>
<li><p>Does it need a feature available only on classic compute?</p>
</li>
</ol>
<p>Use the answers to choose serverless jobs, classic Jobs compute, a SQL warehouse, or an all-purpose environment with a documented reason. A requirement for classic compute does not automatically require all-purpose compute. A scheduled job may be able to use classic Jobs compute.</p>
<img src="/blog/databricks-all-purpose-vs-jobs-compute/fig-7.svg" alt="Development needs such as quick reruns, shared access, capacity for experiments and flexible configuration feed a deployment review of interaction, frequency, startup delay and required features. The review leads to Classic Jobs compute, Serverless Jobs, a SQL warehouse, or all-purpose compute with a documented reason." style="display:block;margin:0 auto" />
<p><em>Figure 7. Choose compute based on the workload’s interaction, schedule, startup, and compatibility requirements.</em></p>
<h2>Why compute reviews need automation across many workspaces</h2>
<p>A manual review can catch a few scheduled notebooks using development clusters. Across hundreds of workspaces, configurations and usage patterns change too often to rely on occasional checks. Automated cost reviews should identify the workload and how it runs, flag compute choices that need checking, and then assess sizing.</p>
<p>For Altimate, this means using Discover to surface workloads whose compute needs reviewing, followed by Auto Tune for workloads that need sizing changes.</p>
<img src="/blog/databricks-all-purpose-vs-jobs-compute/fig-8.webp" alt="Altimate Auto Tune settings for an all-purpose Databricks cluster, showing potential savings of $1.4K to $2.01K per month. Autoscale is proposed to change from 2 to 8 workers to 1 to 8 workers, and auto-termination from 120 minutes to 15 minutes. Right sizing is still learning the cluster. Backoff settings roll back a change when cold starts exceed 150% of the pre-tune rate." style="display:block;margin:0 auto" />
<p>For example, a recommendation to downsize a shared cluster should also consider whether its scheduled jobs belong on separate Jobs compute. Moving those jobs may change the capacity the shared cluster needs.</p>
<h2>What should stay on interactive compute?</h2>
<p>Interactive compute remains useful for exploratory analysis, notebook development, iterative debugging, collaborative investigations, and data-science experiments. Frequent reruns can justify keeping an environment available. Some development workflows also need capabilities available only on classic compute.</p>
<p>Evaluate that spending against the work it supports. Keeping a cluster running between experiments can be useful. Keeping it running between daily batch jobs needs a separate justification.</p>
<h2>What to check before you schedule the next notebook</h2>
<p>Check where it will run, how quickly it must start, when its compute will stop, and how its costs will be tracked. That review can uncover costs that cluster sizing alone will miss. Once the compute choice fits the workload, tune its size and settings.</p>
<p>Additional implementation references: <a href="https://docs.databricks.com/aws/en/admin/usage/system-tables">Monitor costs using system tables</a>, <a href="https://docs.databricks.com/aws/en/admin/system-tables/serverless-billing">Monitor serverless compute costs</a>.</p>
<h2>Frequently asked questions</h2>
<h3>What is the difference between all-purpose compute and Jobs compute?</h3>
<p>All-purpose and Jobs compute differ in when they stop billing. Jobs compute terminates after the run completes. All-purpose compute keeps running until its inactivity timeout expires, and several people or jobs can share it at once.</p>
<h3>Should a scheduled notebook run on a Databricks job cluster or an all-purpose cluster?</h3>
<p>A Databricks job cluster or an all-purpose cluster can both run a scheduled notebook, but only the job cluster stops when the run ends. Databricks recommends serverless compute for most supported job workloads, and Jobs compute when the job needs classic compute. Keep a scheduled job on all-purpose compute only for a documented reason, such as frequent, short runs where startup delays matter.</p>
<h3>How long can auto-termination keep an idle cluster running?</h3>
<p>The inactivity timeout can be set from 10 to 10,000 minutes, and it counts from the moment the cluster's tracked commands finish. A new command resets it. With a 60-minute timeout, four five-minute commands spread across a morning keep the cluster running all morning.</p>
<h3>Why can't I see the cost of a job that runs on all-purpose compute?</h3>
<p>The <code>system.billing.usage</code> table fills <code>usage_metadata.job_id</code> for serverless jobs and for jobs on Jobs compute, but not for jobs on all-purpose compute. When several workloads share one all-purpose cluster, you see the cluster's total usage and have to estimate each job's share.</p>
]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/databricks-all-purpose-vs-jobs-compute/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>How the Databricks semantic layer and Genie Ontology work</title>
    <link>https://altimate.ai/blog/databricks-semantic-layer-genie-ontology</link>
    <guid isPermaLink="true">https://altimate.ai/blog/databricks-semantic-layer-genie-ontology</guid>
    <pubDate>Fri, 18 Sep 2026 09:00:00 GMT</pubDate>
    <dc:creator>Altimate AI Engineering</dc:creator>
    <category>Databricks</category>
    <category>Databricks Genie</category>
    <category>ontology</category>
    <category>semantic layer</category>
    <category>AI Agents</category>
    <category>Metric Views</category>
    <description>The Databricks semantic layer has two halves: what your team models in Unity Catalog, and what Genie infers from how people use the estate. Genie Ontology is how Databricks joins them at runtime.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/databricks-semantic-layer-genie-ontology/cover.jpg" alt="How the Databricks semantic layer and Genie Ontology work" /></p>
<p><strong>ENTERPRISE CONTEXT · TECHNICAL DEEP DIVE</strong></p>
<blockquote><p>The Databricks semantic layer has two halves: what your team models in Unity Catalog, and what Genie infers from how people use the estate. Genie Ontology is how Databricks joins them at runtime.</p></blockquote>
<h2>What is the Databricks semantic layer?</h2>
<p>The Databricks semantic layer is the set of business meanings that sits between your tables and whoever queries them, whether that is a person or an agent. It names the metrics you report on, the dimensions you slice them by, the entities they belong to, and the joins that are valid between them. Unity Catalog holds the part your team defines deliberately, and Genie Ontology adds a second part that Databricks infers from how the estate is used.</p>
<p>Say someone asks for net revenue last quarter. The semantic layer part is the definition Finance published, which is gross amount minus refunds, taken from the orders table and joined to customers on customer_id. The ontology part is what Genie has noticed around that definition, such as which dashboard people actually open for revenue, that revenue questions should go to the curated Finance agent, and that a lead only counts once a demo is booked. Answering the question needs both, because the definition produces the number and the surrounding context decides whose definition to use and who may see the result.</p>
<p>So, the two halves answer different questions. Modeled semantics say what your company has agreed a term means. Inferred context says what people do with that term in practice, which is often not the same answer. Genie Ontology keeps both and resolves between them at the moment an agent asks.</p>
<h2>What came before the Databricks semantic layer?</h2>
<p>In 1970, Edgar Codd proposed <a href="https://en.wikipedia.org/wiki/Relational_model">the relational model</a> because users should not have to know how data is physically stored to work with it. The abstraction was simple and durable: represent facts as relations, expose a small set of operations, and let the database worry about the machinery underneath. That solved an enormous problem, but not the next one, which is what the data means to the business.</p>
<p>A data row can tell you that the account Acme generated $1.2 million. It cannot tell you whether the company considers that account “enterprise,” whether Finance and Sales use the same definition of revenue, whether the churn policy applies to it, or whether a particular dashboard should be trusted over another. So the industry kept adding representations of the facts.</p>
<img src="/blog/databricks-semantic-layer-genie-ontology/representations-of-facts.svg" alt="A five-step timeline of how data representation evolved, each step labelled with the question it answered. The relational model in the 1970s handled rows, columns and tuples, and asked what facts exist. RDF and OWL across the 1990s and 2000s added triples, classes and relationships, and asked how facts relate. Semantic layers and knowledge graphs in the 2010s added metrics, dimensions and business logic, and asked what the business means. Retrieval and RAG in the 2020s added embeddings, chunks and search, and asked what is relevant right now. Runtime context for agents, the step labelled Now, covers plans, tools, permissions and change, and asks whether this agent should trust this now.">
<p>RDF reduced knowledge to subject-predicate-object triples. OWL added formal classes, properties, and logical semantics. Knowledge graphs made connected entities practical at a large scale. Semantic layers narrowed the problem to business concepts such as metrics, dimensions, entities, and valid joins. More recently, retrieval systems stopped trying to model everything in advance and instead assembled relevant context when a question arrived.</p>
<p>RDF, OWL, knowledge graphs, semantic layers and retrieval systems are not interchangeable, and they share a recurring ambition: put enough structure around raw facts that software can use them without carrying the entire organization inside the application. Capable AI agents change who consumes that structure, which is what turns a reporting semantic layer into a semantic layer for AI.</p>
<h2>Why does an AI agent need more than a metric definition?</h2>
<p>A dashboard needs a metric definition. An AI agent needs the metric, the right source, the valid join path, the meaning of company-specific terms, the user’s permissions, the relevant historical work, and some basis for deciding <a href="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer">what to trust when those sources disagree</a>. Then it may need to act on that result. A semantic layer for AI has to carry all of that, not just the metric.</p>
<p>That is why the market is converging on several different representations of roughly the same organizational problem.</p>
<img src="/blog/databricks-semantic-layer-genie-ontology/semantic-layer-approaches.svg" alt="Five approaches to modelling business meaning, arranged on an axis running from mostly authored ahead of time on the left to more assembled at runtime on the right. Semantic layers from dbt, LookML and Snowflake carry explicit metrics, dimensions, and entities with joins. RDF and graph systems from W3C carry explicit entities, relationships and classes. Palantir's operational ontology adds objects, links, and actions with writeback. Retrieval and RAG systems retrieve documents, chunks and similarity context. Genie Ontology from Databricks sits furthest right, combining governed semantics, inferred snippets and authority with ACLs, and retrieving and ranking context when an agent asks.">
<p><em>Snowflake Semantic Views explicitly model logical tables, metrics, dimensions and relationships. dbt MetricFlow builds a semantic graph from models, entities and metrics. Palantir’s Ontology adds object types, link types and action types, including writeback. Genie’s current design is more hybrid: explicit Unity Catalog semantics plus inferred context assembled from platform activity.</em></p>
<p>This backdrop makes Databricks’ choice of the word <em>ontology</em> more interesting. The company is not merely renaming a semantic layer. It is trying to build a broader context system from the activity the data platform already records.</p>
<h2>How does Genie Ontology combine modeled and inferred context?</h2>
<p>Databricks describes Genie Ontology as a unified context layer with two inputs, which makes it the company’s answer to the Databricks semantic layer question.</p>
<p>The first is <strong>Unity Catalog semantics</strong>: context people define and govern deliberately. Metric Views, Domains and Pages belong here. Pages can define a business concept, attach sources and related assets, and become the preferred context when Genie encounters that concept.</p>
<p>The second is <strong>inferred context</strong>: snippets Genie automatically extracts and maintains from existing assets and usage, including Metric Views, dashboards, SQL queries, and Genie Agents. Databricks’ docs give <a href="https://docs.databricks.com/aws/en/genie/genie-ontology">examples</a> such as an “active user” definition, a routing rule that revenue questions should use a curated finance agent, or a business rule that a lead only counts after a demo is booked.</p>
<p><strong>Databricks Metric View</strong></p>
<pre><code class="language-yaml">version: 1.1
source: prod.finance.orders

joins:
  - name: customer
    source: prod.crm.customers
    'on': source.customer_id = customer.customer_id

fields:
  - name: customer_segment
    expr: customer.segment

measures:
  - name: net_revenue
    expr: SUM(source.gross_amount - source.refunds)
    comment: "Canonical Finance definition of net revenue"
</code></pre>
<p><em>This example uses the documented Databricks Metric Views YAML shape. Databricks supports sources, joins, fields, measures, filters and additional metadata in Metric View definitions.</em></p>
<p>The modeled layer tells Genie, “this is what we mean.” The inferred layer tells it, “this is how people actually use the estate.”</p>
<p>Those two signals do not always agree.</p>
<p>Databricks assigns inferred snippets an authority score based on where they came from, usage and freshness. Its launch post describes a PageRank-like ranking process that can also consider the authority of the author and connections to certified or widely used assets. At query time, Genie ranks relevant snippets, resolves conflicts, filters them through Unity Catalog permissions and uses the selected context to answer.</p>
<img src="/blog/databricks-semantic-layer-genie-ontology/context-selection-flow.svg" alt="A left-to-right flow showing how Genie answers a question. A user or agent submits a business question. Two context sources feed ontology retrieval: human-modeled context covering Metric Views, Pages, Domains and certification, and inferred context covering SQL queries, dashboards, Genie Agents, and usage with freshness. Ontology retrieval assembles candidate snippets and filters them by relevance, authority score and a permission gate. The selected context then routes or plans, choosing the agent, data asset or tool that should answer; executes SQL, Python or a tool call to compute rather than guess; and returns an answer with citations, leaving the evidence visible to the user.">
<p><em>The exact internal algorithm is not public. This figure reflects the product behavior that Databricks documents: retrieve candidate context, rank snippets by authority, enforce permissions, route or execute work, then return citations.</em></p>
<p>In practice, Genie behaves less like a static knowledge graph and more like a context-selection system.</p>
<h2>Can you trace why an agent chose one definition over another?</h2>
<p>Data engineers already trace a number backward when it looks wrong:<br/>dashboard → semantic model → transformation → source table → upstream system.<br/> Each edge explains where the value came from.</p>
<p>An agent introduces another chain above that <a href="/blog/column-level-lineage-use-cases">data lineage</a>. Why did it choose the Finance Page instead of the Sales dashboard? Why did it route the question to one Genie Agent? Which snippets were considered and rejected? Which join did it decide was valid? Which SQL did it generate? Which result changed the next step?</p>
<p>Reasoning lineage is the name for that second chain. What you audit is not the model’s chain-of-thought but the trace around it: the evidence retrieved, the authority decisions, the policy checks, the tool calls, the generated code, the query results and the final citations. A Databricks semantic layer records what a term means, and none of that records why one meaning won.</p>
<img src="/blog/databricks-semantic-layer-genie-ontology/reasoning-lineage.svg" alt="Two lineage chains stacked for comparison. Classic data lineage runs source to value: CRM orders, a dbt model transform, a Metric View as the semantic step, a dashboard as the consumer, and a final value of $12.4M. Agent or reasoning lineage runs above it with six steps: retrieve, finding 8 candidates across Pages, SQL and agents; rank, where Finance wins on authority and freshness; policy, where the ACL passes and the user may see the source; plan, which selects the metric view and chooses a tool and query; execute, which runs the SQL and returns $12.4M; and return, which hands back the answer with a citation and visible evidence.">
<p><em>“Reasoning lineage” is our term, not a Databricks one. It names what the system retrieved and did, which you can check, rather than the model’s account of its own thinking, which you cannot.</em></p>
<p><strong>What an auditable agent trace would need to preserve</strong></p>
<pre><code class="language-json">{
  "question": "Net revenue for enterprise EMEA last quarter",
  "context_candidates": ["finance.page", "sales.dashboard", "query_8472"],
  "selected_context": "finance.page",
  "selection_evidence": {
    "authority": "human-modeled / published",
    "permissions": "allowed"
  },
  "tool": "sql_warehouse",
  "generated_sql_hash": "sha256:…",
  "result_artifact": "query_run_01928",
  "citations": ["finance.page", "metric_view.net_revenue"]
}
</code></pre>
<p><em>This is a conceptual trace format rather than a Databricks API schema.</em></p>
<h2>Which Databricks tools read the same semantic layer?</h2>
<p>This is where Genie Ontology becomes more than an analytics feature.</p>
<p>Genie One reads the ontology when a business user asks a question. Genie Code searches the same ontology, so a metric definition or join hint curated once can affect developer work. Databricks’ managed Genie One MCP server lets external <a href="/blog/best-mcp-servers-for-data-engineers">MCP clients</a> send questions to Genie and receive answers grounded in the ontology, with Unity Catalog permissions enforced.</p>
<p>The architecture starts to look like a shared context layer that agents read at runtime, which is a larger claim than a Databricks semantic layer usually makes.</p>
<p>Reading is already broadly supported. Writing authoritative context is much more constrained.</p>
<p>Genie automatically maintains inferred context as the underlying assets and usage change. Humans can publish and edit Pages. Genie Code can draft Pages from source material, but those drafts still go through a human publication flow. And the Genie Agent MCP server is explicitly read-only for data queries.</p>
<p>So an agent cannot, today, simply decide that it learned a new business truth, write that fact into the shared ontology, and have every future agent inherit it as authoritative context.</p>
<p>That is probably a good constraint.</p>
<img src="/blog/databricks-semantic-layer-genie-ontology/writeback-feedback-loop.svg" alt="Genie Ontology, holding modeled and inferred context, sits at the centre of a loop with four surrounding blocks. The enterprise estate of tables, queries, dashboards, Metric Views, agents and usage generates new evidence as it changes. Consumers including Genie One, Genie Code, Genie Agents and MCP clients read that context at runtime. Their actions and outputs, meaning queries, documents and workflows, change external systems and can create more estate activity. The governed write path of Pages, certification and edits runs through human review and publication, which is the only route that explicitly establishes authority.">
<p><em>The important feedback loop exists indirectly: agents and humans create artifacts and usage, which can become new inferred evidence. Directly promoting an agent’s new claim to shared organizational truth is a much harder governance problem.</em></p>
<p>If Databricks eventually lets agents write to it, the product will need stronger provenance, approval, temporal validity and rollback. Otherwise the ontology risks learning from the consequences of its own previous outputs and amplifying mistakes.</p>
<h2>What breaks a semantic layer as the business changes?</h2>
<p>Ontologies look clean in architecture diagrams because the diagram freezes the organization in time.</p>
<p>Companies do not stay still.</p>
<p>They rename metrics. They acquire businesses. Teams create local definitions because the global one is inconvenient. A source system changes grain. A dashboard remains popular after the logic underneath it becomes stale. Permissions change. New agents generate more queries and documents, which themselves become evidence for future agents.</p>
<p>The graph is not merely large. It is moving.</p>
<p>Calling ontology maintenance “NP-hard” is tempting but imprecise.</p>
<p>But the enterprise maintenance problem is difficult for an additional reason: much of the ambiguity is not computational.</p>
<p>Whether “customer” means a billing account, legal entity, workspace or product tenant is an organizational decision. Whether the new definition should replace the old one retroactively is a policy decision. Whether Sales may override Finance for pipeline reporting is a governance decision.</p>
<p>No graph algorithm settles those questions by itself.</p>
<img src="/blog/databricks-semantic-layer-genie-ontology/ontology-maintenance.svg" alt="Six pressures arranged around a centre labelled ontology state, what the company currently means. Concept drift: definitions change over time, and active customer is not static. Source and schema change: tables and grains move, and old relationships stop being valid. Org change: mergers, teams and domains turn two vocabularies into one. Conflicting authority: usage popularity can conflict with certified definitions, where Finance does not equal Sales Operations. Permission drift: who may know what changes, so context is identity-dependent. Agent feedback: AI creates new evidence, and outputs can influence future context.">
<p><em>The maintenance challenge is both algorithmic and organizational. Automatic curation reduces setup cost, but it also makes change visibility, conflict handling and rollback more important.</em></p>
<p>Maintenance is where Genie Ontology will succeed or fail.</p>
<p>Databricks has an unusually good position from which to infer context because it sees a large amount of enterprise data exhaust: catalog metadata, queries, dashboards, lineage, permissions, Metric Views, Genie Agents and developer activity. The product can start without a pristine manually designed ontology, then use explicit semantics as stronger anchors where correctness matters. The same activity already drives other automation on the platform, such as <a href="/blog/right-sizing-databricks-job-clusters-automatically">tuning a job cluster from its own run history</a>.</p>
<p>The danger is that the same automation that makes the Databricks semantic layer cheap to start can make it difficult to reason about later.</p>
<h2>Is Genie Ontology ready for production use?</h2>
<p>Not yet.</p>
<p>As of September 2026, Genie Ontology is in Public Preview. Pages are Beta. There is no public export or snapshot. Provenance is visible at answer level through citations, but there is no dedicated ontology lineage view. There is not yet a full reviewable changelog or diff of newly learned context.</p>
<table>
<thead>
<tr><th>Status</th><th>Capability</th><th>What it means today</th></tr>
</thead>
<tbody>
<tr><td>Available now</td><td>Hybrid context</td><td>Human-modeled Unity Catalog semantics plus automatically maintained inferred snippets.</td></tr>
<tr><td>Available now</td><td>Authority and ACLs</td><td>Relevant snippets are ranked, and Unity Catalog permissions gate what the user can consume.</td></tr>
<tr><td>Available now</td><td>Cross-surface reuse</td><td>Genie One and Genie Code search the same ontology, and Genie can be exposed through MCP.</td></tr>
<tr><td>Still immature</td><td>Ontology-level auditability</td><td>No public snapshot or export, dedicated relationship lineage, or full change diff today.</td></tr>
<tr><td>Still immature</td><td>Direct agent writeback</td><td>No public generic API for an agent to promote a newly learned claim into authoritative shared context.</td></tr>
<tr><td>Open question</td><td>Long-term maintenance</td><td>Can automatic curation stay correct as definitions, schemas, teams, permissions and agents change?</td></tr>
</tbody>
</table>
<p>Pages also carry a preview-era security caveat worth noticing. Databricks warns that Page data does not support customer-managed key encryption and is stored as plain text that may be replicated globally, so Pages should not contain PII, regulated data or other sensitive content.</p>
<p>Databricks has also published internal benchmark <a href="https://www.databricks.com/blog/introducing-genie-one-genie-ontology-and-genie-agents">results</a>: 84.5% first-attempt correctness on a 28-question enterprise data-analysis suite, versus 52.4% for its strongest anonymized <a href="/blog/why-ai-coding-agents-fail-at-data-engineering">general-purpose coding-agent</a> comparator, with roughly half the latency.</p>
<p>It is an encouraging result, but still a small vendor-run benchmark. The same caveat applies to <a href="/benchmarks/ade-bench">ADE-Bench</a>, which we run ourselves.</p>
<p>The more consequential test is what happens after eighteen months of production use, when the ontology has absorbed thousands of new assets, stale definitions, reorganizations, permission changes and agent-generated artifacts. Success will depend less on whether Genie can build this semantic layer than on whether it can keep it true as the organization changes.</p>
<blockquote><p>Databricks’ bet is that the platform now contains enough behavioral evidence to keep an ontology current without requiring an enterprise to model everything manually.</p></blockquote>
<p><strong>Can Databricks make an enterprise ontology that is not only useful when it is created, but inspectable, governable and correct, in near real time, while the enterprise keeps changing?</strong></p>
<h2>How does a Genie space read the semantic layer?</h2>
<p>Databricks renamed Genie spaces to Genie Agents, according to its <a href="https://docs.databricks.com/aws/en/genie/best-practices">Genie best practices</a> page. A Genie Agent answers from the data sources you add to it, up to 50 tables, views or metric views. It uses Unity Catalog column names and descriptions to generate responses. Metric views suit it well because they pre-define metrics, dimensions and aggregations. Example SQL queries let Genie match a question to a verified query.</p>
<h2>Frequently asked questions</h2>
<h3>Is the Databricks semantic layer the same as Unity Catalog Metric Views?</h3>
<p>Databricks Metric Views are one part of it. They are where a team writes a metric down deliberately, with its source, joins, fields and measures, in the YAML shape shown above. Genie Ontology also covers Domains and Pages, and adds the inferred half that Genie maintains from dashboards, SQL queries, Genie Agents and usage. Metric Views are the modeled anchor rather than the whole layer.</p>
<h3>Can an AI agent write new definitions into the Databricks semantic layer?</h3>
<p>Not into the authoritative part. Genie maintains inferred context automatically as assets and usage change, and Genie Code can draft Pages from source material, but those drafts still go through a human publication flow. The Genie Agent MCP server is read-only for data queries. An agent cannot decide it has learned a new business truth and have every future agent inherit it as authoritative context.</p>
<h3>How does it differ from dbt MetricFlow or Snowflake Semantic Views?</h3>
<p>Those two model meaning ahead of time. dbt MetricFlow builds a semantic graph from models, entities and metrics, and Snowflake Semantic Views model logical tables, metrics, dimensions and relationships. Genie Ontology is more hybrid, pairing explicit Unity Catalog semantics with context assembled from platform activity, then ranking the candidates by authority at the moment a question arrives.</p>
<hr />
<p>Altimate Code puts a <a href="/blog/deterministic-tooling-vs-llm-only-data-agents">deterministic tool layer</a> under the model and returns a signed verdict with the evidence it used on every dbt pull request, so the retrieval, the checks and the generated SQL stay inspectable. Read what <a href="/products/altimate-code">Altimate Code</a> does, or how it runs against <a href="/use-cases/altimate-for-databricks">Databricks</a>.</p>
]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/databricks-semantic-layer-genie-ontology/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Right-sizing Databricks job clusters, automatically</title>
    <link>https://altimate.ai/blog/right-sizing-databricks-job-clusters-automatically</link>
    <guid isPermaLink="true">https://altimate.ai/blog/right-sizing-databricks-job-clusters-automatically</guid>
    <pubDate>Wed, 16 Sep 2026 09:00:00 GMT</pubDate>
    <dc:creator>Altimate AI Engineering</dc:creator>
    <category>Databricks</category>
    <category>databricks cost</category>
    <category>databricks compute</category>
    <category>Cost Optimization</category>
    <category>finops</category>
    <category>data-engineering</category>
    <description>Auto Tune learns from each Databricks job’s own runs, right-sizes its cluster inside the bounds you set, and reverts automatically when a run breaches them. Hundreds of jobs tuned every day, median 33% cheaper.</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/right-sizing-databricks-job-clusters-automatically/cover.jpg" alt="Right-sizing Databricks job clusters, automatically" /></p>
<blockquote><p>Altimate AI’s Auto Tune learns from each Databricks job’s metrics, converges its cluster toward its right-sized configuration within the bounds you set, and reverts and alerts whenever a run breaches them.</p></blockquote>
<h2>Why do Databricks job clusters end up oversized?</h2>
<p>Most Databricks job clusters are sized once and rarely revisited. That first spec is typically a generous one, with more memory, more cores and a bigger node than the run turns out to need, chosen with a safety margin so the job simply works. Nothing forces a second look, so they keep running on that day-one config indefinitely. We see it in the telemetry across hundreds of our customers’ job clusters: most run far below the capacity they pay for, CPU and memory sitting largely idle through each run.</p>
<p>Closing that gap by hand does not scale across hundreds of scheduled jobs, and the attempt carries real risk, because a wrong change can break a production pipeline at three in the morning.</p>
<p>What we wanted to design for at Altimate is a system that keeps every job cluster right-sized, continuously learning from each job’s runs and watching each change for a breach of the configured bounds, so resources stay matched to what it actually needs.</p>
<h2>How does Auto Tune keep Databricks job clusters right-sized?</h2>
<p>Auto Tune works as a closed loop. It observes each job’s runs for resource utilization, run times and failures, then generates a right-sizing recommendation. It applies that recommendation, measures the runs that follow for any breach of the configured bounds, and decides the next change, tightening the fit each cycle.</p>
<p>Four components carry it, and the sections below take them in this order:</p>
<ul>
<li><p><strong>Metrics Store</strong> collects the telemetry, run history and billing from every run.</p></li>
<li><p><strong>Recommendation engine</strong> turns that evidence into a proposed change.</p></li>
<li><p><strong>Apply and watch</strong> makes the change and measures what happened.</p></li>
<li><p><strong>Savings and audit history</strong> records what was kept and why.</p></li>
</ul>
<p>Auto Tune targets classic job compute, the clusters whose node types and sizes you choose. Serverless is out of scope for now.</p>
<img src="/blog/right-sizing-databricks-job-clusters-automatically/architecture.svg" alt="Architecture diagram of a closed tuning loop across two columns, the customer’s Databricks environment and Altimate AI. Five numbered steps run clockwise: Unity Catalog system tables ingest into the Metrics Store, the Metrics Store feeds the recommendation engine, the engine feeds apply and watch, the change is applied to the job configuration, and the next runs on the job clusters feed the loop. A dotted arrow back to the Metrics Store measures each run against the job’s own history, a dashed arrow reverts the job configuration if a run breaches its bounds, and a savings and audit history panel records the outcome." style="display:block;margin:0 auto" />
<p><em>The system learns from each job’s own runs, makes one change, watches the runs that follow, and lets the result decide the next one.</em></p>
<h2>What does the Metrics Store collect?</h2>
<p><em>The Metrics Store holds the telemetry, billing and history behind every decision.</em></p>
<p>Everything starts with what the workspace already records. The Metrics Store ingests the customer’s own <a href="https://docs.databricks.com/aws/en/admin/system-tables/jobs-cost">Databricks system tables</a>: per-minute node telemetry for CPU, memory, disk and network, run history and outcomes, and billing. Alongside them it keeps configuration history, so the spec a job ran on last month is still available, and the audit trail of every change Auto Tune has made.</p>
<h2>How does the recommendation engine decide a new size?</h2>
<p><em>Databricks cluster sizing runs from memory, CPU, disk and network, one change at a time.</em></p>
<p>The engine handles Databricks cluster sizing from the dimensions that decide whether a job fits its hardware: how much memory and CPU it needs, whether it needs a local disk attached and at what size and throughput, and how much network bandwidth. It turns those into concrete recommendations: the worker node family and size, the driver, and how the cluster scales, either a fixed worker count or an autoscale range.</p>
<p>One change per cycle, priced on both cost components at the customer’s negotiated DBU rate and the cloud provider’s prices.</p>
<p>A Lakeflow job whose tasks run on several clusters is tuned per cluster. Auto Tune groups the job’s runs by the cluster each set of tasks uses and recommends for each of them on its own, so a job with a small orchestration cluster and a large one for the heavy task gets the right change on each. The settings view below shows this, with a separate recommendation for each of the job’s task clusters.</p>
<p>Before a workspace enables anything, a job owner can see what is proposed for every task cluster of a job, side by side with what runs today, and choose which tasks are in scope.</p>
<img src="/blog/right-sizing-databricks-job-clusters-automatically/recommendation-ui.svg" alt="An illustration of the Auto Tune settings page for a multi-task job, with task names and figures anonymized rather than a live product screen. Task scope shows an estimated saving of 35 to 45 percent for the selected tasks. Five tasks are grouped inside two dashed cluster outlines: tasks 1, 2 and 3 share cluster A and each show a current m5d.4xlarge worker proposed down to m5d.2xlarge with the driver unchanged and an estimated saving of 40 to 50 percent; tasks 4 and 5 share cluster B and each show an r5.2xlarge worker proposed down to r5.xlarge with an estimated saving of 25 to 35 percent. A bottom bar offers reset to default, cancel, and enable Auto Tune." style="display:block;margin:0 auto" />
<p><em>What a job owner sees before enabling: tasks are grouped by the cluster they share, and every task on a cluster gets the same recommendation. This is an illustration of the settings page rather than a live product screen, with task names and figures anonymised.</em></p>
<h2>How does Auto Tune apply a change and watch the result?</h2>
<p><em>Auto Tune applies a change, watches what happens, keeps the learning, and reverts if a run regresses beyond the configured bounds.</em></p>
<img src="/blog/right-sizing-databricks-job-clusters-automatically/apply-watch-loop.svg" alt="Flow diagram of the tuning loop. Recommend a change leads to apply, then to watching the next runs, measured against the job’s own history. The outcome branches three ways: a regression reverts to the previous configuration and captures the learning before recommending again, a change that held with more headroom makes the updated config the new baseline and returns to recommending a change, and a change that held on a well-sized job holds with no change this cycle while the job stays monitored." style="display:block;margin:0 auto" />
<p><em>Inside the loop: the next runs decide whether a change is kept, converged on, or reverted.</em></p>
<p>A proposal is applied to the job configuration, and the next runs are measured against the job’s own history. If the change holds, the updated configuration becomes the new baseline. If the job has converged, no change is made this cycle and it stays monitored. If a run regresses beyond the configured bounds, the previous configuration is restored automatically and the reason is recorded.</p>
<p>The loop does not stop at the first win. A held configuration is monitored for a few days and confirmed as the new stable baseline only once it has proved itself across several runs, and each cycle then builds on the last.</p>
<p>Automatic reversion is what makes unattended tuning acceptable to a platform team: a change that does not work out is reverted and recorded, not left to compound. Auto Tune applies a change only when no run is in flight, so an in-progress run is never cancelled, and it then monitors the job every ten minutes after the change lands.</p>
<h2>What does the savings and audit history record?</h2>
<p><em>The history records the measured saving on every job, what changed, and the controls an owner keeps.</em></p>
<p>The four charts below are representative, each showing one job’s daily cost before and after enablement, measured against each job’s own history rather than a benchmark.</p>
<img src="/blog/right-sizing-databricks-job-clusters-automatically/savings-job-a.svg" alt="Bar chart headed Job A, daily cluster cost before and after tuning, marked 47% lower. A dashed line labelled tuned splits the grey bars before from the green, visibly shorter bars after." style="display:block;margin:0 auto" />
<img src="/blog/right-sizing-databricks-job-clusters-automatically/savings-job-b.svg" alt="Bar chart headed Job B, daily cluster cost before and after tuning, marked 22% lower. A dashed line labelled tuned splits the grey bars before from the green bars after, which drift gently downward." style="display:block;margin:0 auto" />
<img src="/blog/right-sizing-databricks-job-clusters-automatically/savings-job-c.svg" alt="Bar chart headed Job C, daily cluster cost before and after tuning, marked 27% lower. A dashed line labelled tuned follows one tall spike, after which the green bars settle below the earlier grey ones." style="display:block;margin:0 auto" />
<img src="/blog/right-sizing-databricks-job-clusters-automatically/savings-job-d.svg" alt="Bar chart headed Job D, daily cluster cost before and after tuning, marked 59% lower. A dashed line labelled tuned splits irregular grey bars with occasional tall spikes from green bars that step down and stay low." style="display:block;margin:0 auto" />
<table>
<thead>
<tr><th>Job</th><th>Daily cluster cost after tuning</th></tr>
</thead>
<tbody>
<tr><td>Job A</td><td>47% lower</td></tr>
<tr><td>Job B</td><td>22% lower</td></tr>
<tr><td>Job C</td><td>27% lower</td></tr>
<tr><td>Job D</td><td>59% lower</td></tr>
</tbody>
</table>
<p>Each chart is one representative job’s daily cluster cost, before and after tuning. Heights are the real daily cost, and the dashed line marks when tuning was enabled.</p>
<ul>
<li><p><strong>Hundreds of jobs</strong> tuned every day.</p></li>
<li><p>The median actively tuned job runs <strong>33% cheaper</strong>, with no regressions.</p></li>
</ul>
<p>A tenant also configures the bounds it is willing to accept, and those bounds decide how aggressively Auto Tune trades runtime for cost. Tighter bounds keep it conservative and it will only propose changes that leave runtime almost untouched. Looser ones let it go further for a larger saving.</p>
<h2>Do Lakeflow jobs cover every Databricks workload?</h2>
<h3>What about jobs Lakeflow doesn’t schedule?</h3>
<p>Plenty of Databricks work is not scheduled by Lakeflow at all. It is triggered by an external orchestrator such as Airflow or Azure Data Factory. Those jobs go through the same recommendation engine.</p>
<p>What changes is the last step. Their cluster configuration lives in the customer’s own pipelines and repositories rather than in Lakeflow, so Auto Tune cannot apply a change live. Instead it produces the recommendation, can open a pull request that updates the configuration at its source, and raises an alert when a job breaches its expected cost or runtime. The engine and evidence are the same as for Lakeflow jobs. Only the last step changes, from a live edit to a pull request the team reviews and merges, after which Auto Tune resumes watching.</p>
<h3>Databricks job cluster vs all-purpose cluster, which should run scheduled work?</h3>
<p>Scheduled work belongs on a job cluster. The Databricks job cluster vs all-purpose cluster choice is not about capability, because both run the same code, but about how each is billed and how long it stays up.</p>
<p>Interactive clusters get recommendations of their own: sizing the <a href="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill">auto-termination window</a> to how the cluster is actually used, lowering the minimum worker count on an over-provisioned autoscaling cluster, and turning autoscaling on where a fixed-size cluster sits idle.</p>
<p>More often, though, the finding is that scheduled work is living somewhere it should not. Recurring jobs, continuously running jobs and repeated one-off submissions end up on a shared all-purpose cluster because that is where someone first tried them, and they never moved. Auto Tune identifies them and recommends moving each onto its own job cluster, after which the tuning loop applies to it like any other. The all-purpose vs jobs compute split is what makes that move worth the trouble.</p>
<p>It pays because Databricks prices all-purpose vs jobs compute very differently: the DBU component on all-purpose compute runs <a href="https://www.databricks.com/product/pricing/product-pricing/instance-types">roughly 3.5 to 3.7 times the jobs-compute rate</a>.</p>
<h2>What changes when Databricks job clusters stay right-sized?</h2>
<p>The jobs nobody goes back to no longer have to drift. Right-sizing stops being a periodic project and becomes a property of the platform, running quietly in the background.</p>
<p>The real question isn’t whether your scheduled jobs have headroom. It’s how much you’d let a system take back for you. Point <a href="/use-cases/altimate-for-databricks">Auto Tune</a> at a workspace and it will answer that in your own numbers.</p>
<h2>Frequently asked questions</h2>
<h3>What happens if a tuning change makes a job slower?</h3>
<p>The configuration is restored automatically and the reason is recorded. Auto Tune measures the runs that follow each change against the job's own history, and a run that regresses beyond the bounds the workspace configured triggers the revert without anyone intervening. Those bounds are the control: tighter ones keep Auto Tune conservative and only allow changes that leave runtime almost untouched, looser ones let it trade more runtime for a larger saving.</p>
<h3>How much cheaper does a right-sized Databricks job cluster run?</h3>
<p>The median actively tuned job runs 33% cheaper, with no regressions, across hundreds of jobs tuned every day. Individual jobs vary more than the median suggests: the four representative jobs above came down by 22%, 27%, 47% and 59% on their daily cluster cost. Each figure is measured against that job's own cost before tuning rather than against a benchmark.</p>
<h3>Does Auto Tune right-size serverless compute?</h3>
<p>Not at present. Auto Tune targets classic job compute, which is the compute whose node types and sizes you choose, because right-sizing means changing those choices. Serverless bills on usage rather than on a cluster you have sized, so there is no node family, node size or worker count for the recommendation engine to change.</p>
<hr />
<h2>What are the two parts of a Databricks job’s cost?</h2>
<p><em>Two meters on every job, and right-sizing brings down both.</em></p>
<p>A Databricks job’s hourly bill has two meters. Databricks charges a <a href="/blog/understanding-databricks-compute-costs">DBU rate</a> for the compute tier, and the cloud provider charges for the infrastructure underneath it, the worker and driver machines and any storage attached to them.</p>
<p>Because Auto Tune resizes the node itself, its family and size, its disk and its network, a single change reduces both meters at once: the DBU spend and the infrastructure spend. Infrastructure is usually the larger of the two, so across the jobs tuned so far it accounts for most of the realized savings, while the DBU charge comes down alongside it.</p>
<hr />
<p><em>Savings are reported as relative shares of each job’s own prior cost. Customer names withheld.</em></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/right-sizing-databricks-job-clusters-automatically/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Beyond the Databricks Cost Calculator: 6 Cost Levers, Including Auto Termination</title>
    <link>https://altimate.ai/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill</link>
    <guid isPermaLink="true">https://altimate.ai/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill</guid>
    <pubDate>Fri, 11 Sep 2026 23:05:31 GMT</pubDate>
    <dc:creator>Sudhanshu Prajapati</dc:creator>
    <category>Databricks</category>
    <category>data-engineering</category>
    <category>Cost Optimization</category>
    <category>#apache-spark</category>
    <category>big data</category>
    <description>The official Databricks price calculator provides you information on the DBU rate times the hours you plan to run, the instance type for cloud providers, the costing of VMs (basically compute types) f</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill/cover.jpg" alt="Beyond the Databricks Cost Calculator: 6 Cost Levers, Including Auto Termination" /></p>
<p>The official <a href="https://www.databricks.com/product/pricing/product-pricing/instance-types">Databricks price calculator</a> gives you the DBU rate times the hours you plan to run. It also shows the instance type for each cloud provider. It prices the VMs, or compute types, for the kind of workloads you want to run. It also lists other basic details such as the compute options available.</p>
<p>But the cost calculator does not say which configuration parameters affect your overall costs. It also does not tell you how to set those parameters.</p>
<p>For instance, the calculator doesn't tell you if you're paying for compute hours you didn't need. It doesn't show whether your compute type charges more for identical work. It also doesn't flag a cluster still sized for a large but outdated workload that shrank a quarter ago.</p>
<p>Six configuration levers decide how much of the calculated number you pay. They are compute type, Photon, Databricks auto termination, driver sizing, job compute, and spot or reserved instances. To learn how Databricks compute costs work, read our <a href="https://altimate.ai/blog/understanding-databricks-compute-costs"><em>Understanding Databricks Compute Cost</em></a> post. That post explains the total cost of running Databricks, including cloud infrastructure and workload pricing per DBU.</p>
<p>If your team is weighing a move off Databricks because of cost, check these six levers first. Each one is a setting in your current workspace, so you can measure its effect on the bill before you plan a migration.</p>
<p>Let’s start with a very common yet underused cost lever. The few people who do use this lever often don’t use it in an optimal way.</p>
<h2>How the Databricks Pricing Calculator Estimates a Bill</h2>
<p>The Databricks pricing calculator estimates one number. People also call it the Databricks cost calculator or the DBU calculator. The estimate is the DBUs per hour, times the price per DBU, times the hours you plan to run. For example, a cluster that consumes 2 DBUs an hour at $0.55 per DBU-hour costs $1.10 an hour in DBUs.</p>
<p>On classic compute, your cloud provider bills the VMs, disks and network on a separate invoice. Serverless compute is the exception, because its DBU price already includes the VM cost. The calculator also assumes that every hour you enter does useful work. The six levers below decide how many of those hours you pay for, and at which rate.</p>
<h2>Cost Lever #1: Match Compute Type to Workload Before Anything Else</h2>
<p>Before selecting your Databricks compute type, analyze your workload requirements. Is it a bursty BI dashboard query that runs once a week? Or is it a job that runs daily for 1 hour or more? We discussed this topic in our blog post <a href="https://altimate.ai/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper"><em>Databricks Serverless vs Classic Compute: Which One Is Actually Cheaper?</em></a> That article will help you decide which workload type you should select, serverless or classic compute.</p>
<p>To summarize:</p>
<p><strong>Databricks Serverless Compute</strong> is the right call for bursty, unpredictable, or interactive work. That work includes ad hoc SQL, BI dashboards, and short jobs. In a short job, a user runs a query, looks at the result, and then the job is complete. You stop paying for startup or idle time. Scheduled ETL tasks are prime candidates for serverless job clusters.</p>
<p>Many teams leave these running on more expensive interactive compute by mistake, missing out on immediate cost savings. We will dive deeper into scheduled job optimization later.</p>
<p><strong>Databricks Classic Compute</strong> is the right call for steady workloads that you understand well enough to size deliberately. Classic wins on those workloads because spot pricing moves the bill there. Serverless doesn't expose spot pricing, because you never see the underlying VM. All-purpose Classic Compute makes sense when you don’t know the kind of workloads you will be running but it also costs you more. Whenever possible, it is better to go with a specific type of compute to save on cost.</p>
<p>Refer to the table below (taken from the <a href="https://altimate.ai/blog/understanding-databricks-compute-costs"><em>Understanding Databricks Compute Cost</em></a> blog) for more information on how to plan the workloads.</p>
<p>TABLE: HOW TO SELECT THE CORRECT DATABRICKS COMPUTE TYPE BASED ON WORKLOAD:</p>
<table>
<thead>
<tr>
<th>Workload</th>
<th>Compute</th>
<th>Why</th>
</tr>
</thead>
<tbody><tr>
<td>Interactive BI dashboards</td>
<td>Serverless SQL warehouse</td>
<td>Bursty access, cold starts hurt users, idle dominates cost</td>
</tr>
<tr>
<td>Ad hoc SQL and exploration</td>
<td>Serverless SQL warehouse</td>
<td>Unpredictable usage, so idle is the main waste</td>
</tr>
<tr>
<td>Short frequent jobs</td>
<td>Serverless jobs</td>
<td>Startup is most of the runtime</td>
</tr>
<tr>
<td>Scheduled ETL and batch</td>
<td>Job compute, classic</td>
<td>High duty cycle, fault tolerant, every classic lever applies</td>
</tr>
<tr>
<td>Streaming</td>
<td>Job compute or serverless pipelines</td>
<td><a href="/blog/databricks-streaming-tables-continuous-vs-triggered">Check triggered vs continuous</a> before anything else</td>
</tr>
<tr>
<td>ML training</td>
<td>Classic with GPU</td>
<td>Serverless GPUs exist but are narrower; check Databricks' <a href="https://docs.databricks.com/aws/en/machine-learning/ai-runtime/">current offering.</a></td>
</tr>
</tbody></table>
<h2>Cost Lever #2: Only Turn on Photon for the Workloads It Actually Accelerates</h2>
<p>Photon replaces Spark's JVM execution layer with a native C++ engine. Photon supports SQL, DataFrame API calls, ETL pipelines, and stateless streaming. It does not natively execute custom code such as Python UDFs, RDDs, or Dataset APIs. Photon hands those parts of the query back to standard Spark when a workload hits these operations.</p>
<table>
<thead>
<tr>
<th>Aspect</th>
<th>Photon (native C++ engine)</th>
<th>Standard Spark (JVM)</th>
</tr>
</thead>
<tbody><tr>
<td>Handles</td>
<td>SQL, DataFrame API calls, ETL pipelines, stateless streaming</td>
<td>Custom code: Python UDFs, RDDs, Dataset APIs</td>
</tr>
<tr>
<td>Execution model</td>
<td>Replaces the JVM execution layer for supported operations</td>
<td>Falls back to execute the parts Photon can't</td>
</tr>
<tr>
<td>Trigger for fallback</td>
<td>N/A</td>
<td>Whenever a query hits an unsupported operation, Photon hands that part back to Spark</td>
</tr>
</tbody></table>
<h3>Where Photon Will Run (is this thing on?)</h3>
<p>Most folks enable Photon by default during the set-up phase on classic all-purpose compute, job compute, and classic pipelines. Photon is always on for serverless and every SQL warehouse. So before deciding whether to turn on Photon, check whether it already is on by default. The exception is compute provisioned through the Clusters or Jobs API, which needs <code>runtime_engine</code> set to <code>PHOTON</code> explicitly.</p>
<p>Photon does nothing for GPU training or vector search. On GPU instance types you can't even enable it.</p>
<h3>Understanding Databricks Photon Pricing</h3>
<p>Photon instances cost more DBUs than standard runtime instances, so make sure the extra speed justifies the price. Workloads dominated by Python UDFs, RDDs, Dataset APIs, or other unsupported operations may spend much of their time in standard Spark even with Photon enabled. Queries under two seconds see little benefit, because query planning takes most of that time.</p>
<p>Check instead of guessing. In the Spark UI's SQL/DataFrame, Photon operators are orange, whereas Spark operators are blue. The query profile reports what percentage of task time ran in Photon.</p>
<p>One caveat before disabling it anywhere: predictive I/O and dynamic file pruning in MERGE, UPDATE, and DELETE all require Photon.</p>
<p>Run the analysis both ways to improve speed and cut costs, then act on the results:</p>
<ul>
<li><p><strong>Disable Photon:</strong> Identify UDF-heavy jobs where Photon is enabled but gives zero acceleration. Disable Photon on those jobs.</p>
</li>
<li><p><strong>Enable Photon:</strong> Identify API-provisioned clusters running SQL workloads that never had Photon enabled. Turn Photon on for those clusters.</p>
</li>
<li><p><strong>No Action:</strong> Leave MERGE-heavy pipelines alone.</p>
</li>
</ul>
<h2>Cost Lever #3: Set Databricks Auto Termination Just Below the Idle Gap</h2>
<p>Databricks auto termination helps control idle compute costs. A timeout set too high wastes money. A timeout set too low can cause cold start latency or workload failures. Idle cost matters most on all-purpose compute and SQL warehouses, where you pay for the resource while it sits running and idle. Serverless notebooks and jobs bill on usage, so idle time is not a factor.</p>
<p>Teams across time zones can also benefit from tighter timeouts during off hours, when long gaps between handoffs can leave clusters running unused.</p>
<p>You want to set auto-termination just below the idle gap you want to catch. Check how busy the cluster is, not only the timeout value. Auto termination only triggers after the configured period of inactivity. For example, take a cluster with a 60 min timeout that runs for 10 minutes at the top of every hour. That cluster never reaches the 60 min gap, so it stays running. You effectively pay for six times the compute you need, even though the setting worked as configured. A healthy cluster spends well over 50% of its running time doing actual work. A cluster busy for under 25% of its running time is a serious savings opportunity.</p>
<img src="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill/ff8596a6-0f72-4944-81e1-3217ca197d01.png" alt="Timeline diagram titled Why the 60-Minute Timeout Never Fires: a 10-minute job runs at the top of each hour across a 180-minute window, leaving three 50-minute idle gaps where the cluster still bills, because the next job always starts before the 60-minute idle clock completes." style="display:block;margin:0 auto" />

<p>That does not mean shorter inactivity timeouts are always better. If idle gaps are under 10 minutes (the minimum Databricks allows for classic compute auto termination), lowering the timeout will not help much.</p>
<p>Classic clusters also take three to eight minutes to start, as we typically observe. The start time varies by cloud, node type, and whether a pool is in play. So even slightly longer gaps may not justify cycling classic clusters. Weigh the cold start and latency costs before you tighten the timeout on unpredictable workloads, particularly on all-purpose compute and serverless. Aim for the timeout that minimizes idle spend without disrupting workloads.</p>
<p>Use these rules of thumb to pick a Databricks auto termination setting for each workload shape:</p>
<p>TABLE: RULE OF THUMB GUIDANCE ON PICKING DATABRICKS AUTO-TERMINATE PERIODS</p>
<table>
<thead>
<tr>
<th>Workload shape</th>
<th>What you'd see in the data</th>
<th>Prescription</th>
</tr>
</thead>
<tbody><tr>
<td>Ad-hoc notebook exploration, 1-2 analysts</td>
<td>Gaps of 5-20 min between commands, cluster up all day</td>
<td><strong>15-20 min.</strong> Below 15 mins you pay the 3-8 min restart more often than you save.</td>
</tr>
<tr>
<td>Shared dev cluster, one time zone</td>
<td>Short gaps 9-6, then dead overnight</td>
<td><strong>20-30 min + a scheduled terminate at end of day.</strong> The timeout handles the daytime tail; only a schedule handles the night.</td>
</tr>
<tr>
<td>Team split across time zones</td>
<td>Cluster up 18-20 hrs, never idle for 30 min straight</td>
<td><strong>Don't lower the timeout: it will never fire.</strong> Split into per-region clusters, or move the workload to a serverless SQL warehouse.</td>
</tr>
<tr>
<td>Scheduled batch running on all-purpose compute (our 10-min-per-hour example)</td>
<td>Regular short bursts, gaps shorter than the timeout</td>
<td><strong>Wrong lever.</strong> Move to job compute, which terminates on completion, so zero idle time. Timeout tuning caps saving at ~50 min/hr; job compute captures the whole thing.</td>
</tr>
<tr>
<td>Frequent short jobs (every 15-60 min) on job compute</td>
<td>Paying 3-8 min startup on every run</td>
<td><strong>Instance pool</strong> with Min Idle = 0. Set idle-instance auto-termination just above the gap. Databricks' own example is 20 min for hourly jobs.</td>
</tr>
<tr>
<td>BI dashboards on a <strong>serverless</strong> SQL warehouse</td>
<td>Queries clustered in business hours</td>
<td><strong>Auto Stop 10 min</strong> (the default). Serverless restarts in seconds, so there's no reason to run higher. UI floor is 5 min; the API goes to 1 min. This is a good approach for a warehouse serving a single scheduled refresh.</td>
</tr>
<tr>
<td>BI on a <strong>pro/classic</strong> SQL warehouse</td>
<td>Same pattern, 3-8 min cold start</td>
<td>Default is 45 min. <strong>Cut to 20-30.</strong> If you're tempted to go lower, that's the signal to move to serverless, not to keep tightening.</td>
</tr>
<tr>
<td>Structured Streaming using DStreams</td>
<td>Continuous</td>
<td><strong>Set to 0 (no auto-termination).</strong> Databricks doesn't report DStream activity, so an auto-terminating cluster can be killed mid-run.</td>
</tr>
<tr>
<td>Long single-command ML training</td>
<td>One 4-hour cell, no other activity</td>
<td><strong>10-15 min is safe.</strong> The clock measures time since the last command <em>ran</em>, and a running command counts as activity.</td>
</tr>
</tbody></table>
<h3>Measuring Idle Share</h3>
<p><strong>Idle share = running minutes with no work / total running minutes.</strong></p>
<p>Plotted across those workload shapes, the percentages spread wider than most teams expect.</p>
<img src="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill/a3dec687-a523-4c53-8657-9fb3c4473a0c.png" alt="Bar chart of typical 30-day idle share by workload shape on a Databricks cluster: ad-hoc notebooks 88% and shared dev in one time zone 71% call for tuning the timeout; batch jobs on all-purpose compute 83% and shared dev across three time zones 57% call for changing the compute type; DStream streaming 41%, short jobs on job compute with a pool 22%, and ML training 12% are left alone. Idle is driver CPU below 5% in system.compute.node_timeline." style="display:block;margin:0 auto" />

<p><em>The idle share across the workload shaped in the table above is based on a 30-day</em> benchmark. <em>The percentage alone doesn't tell you the fix. The top two bars waste a similar share of their running time. But one is a timeout problem and the other is a wrong-compute-type problem. SQL warehouses don't appear because of the</em> <code>system.compute.*</code> <em>doesn't cover them.</em></p>
<p>Streaming shows 41% idle <em>even though the job is live the whole time</em>. That happens because the gaps between micro-batches look like idle minutes to a CPU-based measure. And the query below filters on the driver node. So a cluster with a thin driver and busy executors will report a higher idle share than it deserves. Always check the shape of the workload before you act on the number.</p>
<p>To find Databricks idle clusters yourself, run this query over the last 30 days. It returns one row per cluster name.</p>
<pre><code class="language-sql">SELECT c.cluster_name,
       COUNT(*) AS running_minutes,
       ROUND(100 * SUM(CASE WHEN t.cpu_user_percent + t.cpu_system_percent &lt; 5
                            THEN 1 ELSE 0 END) / COUNT(*), 1) AS pct_idle
FROM system.compute.node_timeline t
JOIN (SELECT DISTINCT cluster_id, cluster_name FROM system.compute.clusters) c
  USING (cluster_id)
WHERE t.start_time &gt;= current_date() - INTERVAL 30 DAYS
  AND t.driver
GROUP BY 1
ORDER BY running_minutes DESC;
</code></pre>
<p>Note: <code>system.compute.*</code> excludes SQL warehouses and serverless. Those go through query history and billing tables instead.</p>
<img src="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill/182422ea-a41c-4f81-bc04-c23301067583.png" alt="A histogram of recoverable Databricks idle spend by workload shape" style="display:block;margin:0 auto" />

<p><em>Recoverable idle spend comes from the same</em> benchmark. <em>We priced a five-node all-purpose cluster at $3.20/hr all-in (DBU + EC2). Ad-hoc notebooks have the highest idle share but only the third-largest bill. That is because a cluster that is up ten hours a day can only waste ten hours a day. Streaming and long training show $0. They still log idle minutes, but there is nothing to reclaim.</em></p>
<p>This is why idle percentage is a triage signal rather than a priority list. Sort your own query output by <code>running_minutes * pct_idle</code> instead of by <code>pct_idle</code>. The clusters worth fixing first then move to the top of the list.</p>
<p>Finally, constrain <code>autotermination_minutes</code> in a compute policy (range with a max, or fixed + hidden). Then audit for the value <code>0</code>, which means "never terminate" and leaves idle clusters running until someone stops them.</p>
<h2>Cost Lever #4: Size the Driver Independently of the Workers</h2>
<p>Sizing the driver is different from tuning the autoscaling range for your worker pool. This lever is about the <em>driver</em> specifically. Almost nobody touches the driver setting because Databricks sets the driver node type to match the worker node type by default. The <a href="https://docs.databricks.com/aws/en/compute/configure">Databricks compute configuration docs</a> say: "<em>The default value of the driver node type is the same as the worker node type</em>".</p>
<p>But that default can be wrong in both directions:</p>
<ul>
<li><p>Databricks recommends a larger driver when you pull large result sets back using <code>.collect()</code>, or when multiple notebooks share the same cluster.</p>
</li>
<li><p>On the other hand, standard ETL jobs that only transform and write data rarely need large drivers. For those jobs, the default setting forces you to pay for an oversized driver that sits mostly idle.</p>
</li>
</ul>
<p>Always size the driver to match what your specific workload requires rather than trusting the default.</p>
<h2>Cost Lever #5: Move Scheduled Databricks Workloads Off All-purpose Clusters</h2>
<p>Running production schedules on all-purpose clusters often looks like a scheduling or efficiency issue. But <strong>the rate difference</strong> is what drives the high bill. Databricks job compute is typically two to three times cheaper than all-purpose compute. That ratio is a rule-of-thumb. Your actual savings depend on how long the original cluster sat idle. Savings also depend on whether DBUs or raw cloud infrastructure made up the bulk of your costs.</p>
<p>Migrating scheduled workloads off all-purpose clusters onto job compute changes how resources behave. An all-purpose cluster stays warm and ready between runs, whereas a job cluster spins up fresh and shuts down every time. For daily batch runs, accepting that brief cold start is well worth the cost savings. For high-frequency jobs running every few minutes, you have to weigh the startup overhead against the lower compute rates.</p>
<h3>Why is My Databricks Production Job Still on an All-purpose Cluster?</h3>
<p>Development teams often start their work on an all-purpose cluster because development is interactive by nature. They run a cell, look at the output, change something, and run it again.</p>
<blockquote>
<p>Nobody <em>decided</em> production should run on an all-purpose cluster. Production just <em>inherited a decision</em> made in development</p>
</blockquote>
<p>Once the things get approved and signed off, they get promoted to a schedule. And the pipeline code that lands in the main branch still points at the same cluster ID or policy the team wrote it against. That happens because nobody reviewed the compute config when promoting the branch. Nobody <em>decided</em> production should run on an all-purpose cluster. Production just <em>inherited a decision</em> made in development, the same way the driver inherited the worker's size in the last lever.</p>
<p>Auto termination helps here (see lever 3) but doesn't fix it. It cuts the idle-time waste on that cluster. It doesn't move the job to the compute type that's actually cheaper for the work it's now doing on a schedule.</p>
<p>This is hard to catch by scanning dashboards, because a job on the wrong compute type looks completely healthy. Finding it manually means joining <code>system.billing.usage</code> against <code>system.lakeflow.job_task_run_timeline</code> and asking which production jobs still show up against an all-purpose SKU.</p>
<p>Even this join can't attribute the cost accurately. Databricks says precise cost accounting for jobs sharing all-purpose compute isn't possible with full accuracy, because several workloads draw on the same cluster at once. That accuracy limit is itself an argument for moving the job rather than pricing it after the fact.</p>
<h2>Cost Lever #6: Use Spot or Reserved Instances</h2>
<p>Spot instances can significantly cut Databricks compute costs. But the cloud provider can reclaim Spot instances, so use them for worker nodes, not the driver. If the provider reclaims a Spot worker, Spark can retry its tasks elsewhere. If the provider reclaims the driver, the entire job fails because the driver coordinates the cluster.</p>
<blockquote>
<p>Keep one rule: use spot instances only for worker nodes, and keep your driver node on standard on-demand compute.</p>
</blockquote>
<p>On AWS, use fleet instance types so Databricks can choose from multiple instance types based on availability and price. Do not rely on a single instance type, because that type may not be available when you need it.</p>
<p>For predictable workloads, Reserved Instances (RIs) have huge CUDs (Committed Use Discounts) and can provide significant savings without Spot's interruption risk. Use Spot when your workload can tolerate worker replacement. Use RIs when you need consistent capacity and predictable savings.</p>
<p>Both Spot and RIs reduce the cloud VM cost, not DBUs. So Spot and RIs are more impactful for job compute, where infrastructure is a larger share of the bill. Spot and RIs are less impactful for all-purpose compute, where DBUs typically are a larger share of the total bill. Know which area of the bill you're attacking before you decide to go for spot instances or RIs.</p>
<h3>When Databricks Spot Compute is the wrong call,</h3>
<p>Spot is good where interruption is tolerable: retry-friendly batch ETL, checkpointed pipelines, and fault-tolerant model training. Conversely, a low-latency dashboard query or an SLA-bound job is the wrong place to try your first spot rollout.</p>
<h2>Databricks Auto Tune: Put Optimization on Autopilot</h2>
<p>Now that we have seen all 6 levers, the work comes down to a cost reduction sprint within the team. That sprint gets each lever set to its optimum position. However, getting the levers right once doesn’t guarantee value over time. You need to adjust these levers every now and then, as the demands and requirements change. Constantly keeping the levers in check requires time and effort.</p>
<p>The <a href="https://altimate.ai/platform">Altimate Platform</a> provides precisely such a feature called <strong>Auto Tune</strong>. Auto Tune automatically sets all six levers we discussed, with safe configuration backoff, and goes well beyond Databrick’s <a href="/blog/databricks-predictive-optimization">Predictive Optimization</a>.</p>
<h3>How Altimate Auto Tune Automatically Pulls Levers</h3>
<p>Auto Tune analyzes how each SQL warehouse, cluster job, and other workloads are <em>actually</em> used. Including CPU, memory, and worker utilization across recent runs, and then right-sizing things such as</p>
<ul>
<li><p><strong>Worker instance type</strong>: moving workers to a cheaper, better-fitting family if the current one is over-provisioned.</p>
</li>
<li><p><strong>Driver instance type</strong>: right-sized as per need from historic data, since drivers are frequently much larger than the workload requires.</p>
</li>
<li><p><strong>Worker count / autoscaling bounds</strong>: tightens a fixed count or the min-max range so the cluster never runs more workers than the job needs.</p>
</li>
</ul>
<p>Auto Tune only changes <strong>the configuration</strong> and never touches the code, schedule, tasks, libraries, and tags. The diagram below gives you a quick overview of how Auto Tune works:</p>
<img src="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill/7fbf5a00-e297-4112-8991-929c94a445a6.png" alt="Auto Tune flow diagram: snapshot the full cluster config as an audit record and rollback source, apply the new auto-stop or size with all other fields carried forward, verify the config by reading it back, then monitor p95 latency against the week before. If performance holds, savings accrue; if latency hits 1.5x baseline with a seconds-level increase, Auto Tune backs off and restores the snapshot exactly." style="display:block;margin:0 auto" />

<p>For more information on how you can save more with the Altimate Platform, see <a href="https://altimate.ai/use-cases/altimate-for-databricks">Databricks Cost Optimization</a>.</p>
<p>The use cases and screenshots below show the levers we discussed in action, providing real cost savings. The Auto Tune settings page shows how Auto Tune proposes the correct family and instance type by observing the workload and requirements. Auto Tune then gives you cost-saving options if you choose that setting.</p>
<img src="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill/c71eece5-c27e-48db-a5cc-91e7f3c9301b.png" alt="A screenshot of the Altimate UI, a platform that provides cost intelligence and governance for modern data teams. Altimate analyzes actual workload behavior to detect when a job is running on the suboptimal compute family. It provides you with visibility into where the mismatch exists so you can trust a system recommendation and decisions." style="display:block;margin:0 auto" />

<p><em>A screenshot of the Altimate UI, a platform that provides cost intelligence and governance for modern data teams. Altimate analyzes actual workload behavior to detect when a job is running on the suboptimal compute family. Altimate shows you where the mismatch</em> exists, so you can trust the system's recommendations <em>and decisions.</em></p>
<p>We previously discussed <a href="#why-is-my-databricks-production-job-still-on-an-all-purpose-cluster">how Databricks production jobs sometimes keep on running on an all-purpose cluster</a>. We often miss those jobs because they work just fine. They just cost way more than they should.</p>
<p>This issue becomes immediately visible with Altimate’s “discover” tab:</p>
<img src="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill/7c3c2bf1-d62d-4400-9d45-629674e3208b.png" alt="The Discover page in the Altimate.ai enterprise platform runs a version of that same join continuously and surfaces exactly this pattern: a job still running on an interactive cluster long after the workload stopped being interactive, flagged with the switch to make and the same accuracy limit attached. You can read more about in Understanding Databricks Compute Cost blog post." style="display:block;margin:0 auto" />

<p><em>The Discover page in the Altimate.ai enterprise platform continuously runs a version of that join. The join matches system.billing.usage against system.lakeflow.job_task_run_timeline. Discover surfaces exactly this pattern: a job still running on an interactive cluster long after the workload stopped being interactive. Discover flags the job with the switch to make and attaches the same accuracy limit.</em></p>
<p>Further information on the Altimate Platform can be found in <a href="https://altimate.ai/use-cases/altimate-for-databricks">Databricks Cost Optimization</a>, or if you use Snowflake, read <a href="https://altimate.ai/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses">Adaptive Compute vs. Altimate AI Auto Tune Optimization</a></p>
<p>If you want to explore Altimate, you can <a href="https://calendly.com/d/cvq6-s45-kqq/altimate-ai-for-databricks-overview">book some time with the team here</a>.</p>
<h2>Which Half of the Databricks Bill Each Lever Changes</h2>
<p>The Databricks price calculator shows none of the six levers. Each lever is a configuration decision rather than a billing rate. Compute type, Photon, and job compute change the DBU half of the bill. Spot workers change only the cloud infrastructure half, and driver size mostly changes that half too. Databricks auto termination changes both halves.</p>
<p><em><strong>Note on the savings column below:</strong></em> <em>ranges are directional and apply to the workload not to your whole bill. Treat them the way we treated the auto-terminate example: useful for prioritizing, but not a quote. In our experience, teams that work through all six typically land in the 20-35% range on total Databricks compute spend.</em></p>
<table>
<thead>
<tr>
<th>Lever</th>
<th>Setting to change</th>
<th>What you give up</th>
<th>Which half of the bill is improved (DBU or Infra)</th>
<th>Typical savings (directional, on the affected workload)</th>
</tr>
</thead>
<tbody><tr>
<td>1) Match compute type to workload</td>
<td>Serverless or classic, per workload shape</td>
<td>Spot pricing, on anything you move to serverless</td>
<td>DBU</td>
<td>50-75% of a bursty cluster's cost when utilization was under 25%</td>
</tr>
<tr>
<td>2) Turn on Photon where it applies</td>
<td>Photon toggle on the cluster or warehouse</td>
<td>Nothing if it's out of scope, but you pay the higher Photon rate for no speedup</td>
<td>DBU</td>
<td>Turning Photon off where it adds no value -&gt; up to roughly half that job's DBU line on classic compute.</td>
</tr>
<tr>
<td>3) Tighten auto-termination</td>
<td>Auto-terminate minutes</td>
<td>Cold-start waits, and the risk people leave clusters up to avoid them</td>
<td>Both</td>
<td>20-40% of classic compute spend</td>
</tr>
<tr>
<td>4) Size the driver for its job</td>
<td>Driver node type, unpinned from the worker type</td>
<td>A bigger driver costs more; too small and .collect() fails the job</td>
<td>Infrastructure, mostly</td>
<td>Single-digit % of that cluster's infra bill</td>
</tr>
<tr>
<td>5) Move scheduled work to job compute</td>
<td>Cluster type on the job definition</td>
<td>The warm interactive session the notebook was developed against</td>
<td>DBU</td>
<td>40-60% off that job's total cost.</td>
</tr>
<tr>
<td>6) Spot workers, on-demand driver</td>
<td>Spot for workers, Fleet types on AWS, driver stays on-demand</td>
<td>Interruption tolerance, so not for SLA-bound work</td>
<td>Infrastructure only</td>
<td>60-90% off the workers' VM price (DBUs unchanged)</td>
</tr>
</tbody></table>
<p>For the two-bill split and the system tables behind all six, see our blog post, <a href="https://altimate.ai/blog/understanding-databricks-compute-costs">Understanding Databricks Compute Costs</a>.</p>
<h2>Frequently Asked Questions</h2>
<h3>Is the Databricks Pricing Calculator Accurate?</h3>
<p>The Databricks pricing calculator is accurate for the configuration and the hours you enter. It cannot see idle time, an oversized driver or a scheduled job left on all-purpose compute. Those settings change the real bill, and levers 3, 4 and 5 cover them.</p>
<h3>What Databricks Auto Termination Setting Should I Use?</h3>
<p>The right Databricks auto termination setting depends on the workload shape. Ad hoc notebook clusters work well at 15 to 20 minutes. Shared dev clusters in one time zone need 20 to 30 minutes plus a scheduled terminate when the workday ends. A pro or classic SQL warehouse defaults to 45 minutes, so cut it to 20 to 30. A serverless SQL warehouse can stay at its 10-minute default. Set Structured Streaming clusters that use DStreams to 0, because Databricks does not report DStream activity. A cluster shared across time zones never idles for 30 minutes straight, so split it per region or move the workload to serverless.</p>
<h3>Why Does My Databricks Cluster Keep Running With Auto Termination On?</h3>
<p>Databricks auto termination only fires after a full period with no activity. Take a cluster with a 60-minute timeout that runs a 10-minute job at the top of every hour. It never sits idle for 60 minutes, so it never terminates. Move that schedule to job compute, which terminates when each run completes.</p>
<h3>How Do I Find Databricks Idle Clusters?</h3>
<p>To find Databricks idle clusters, query <code>system.compute.node_timeline</code> and count the running minutes where driver CPU stays below 5%, as the SQL in lever 3 does. Sort the result by <code>running_minutes * pct_idle</code> so the clusters with the most idle minutes come first. The query reads the driver only, so a thin driver with busy executors shows more idle time than it has. The <code>system.compute.*</code> tables do not cover SQL warehouses or serverless compute.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Databricks Serverless vs Classic Compute: Which One Is Actually Cheaper?</title>
    <link>https://altimate.ai/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper</link>
    <guid isPermaLink="true">https://altimate.ai/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper</guid>
    <pubDate>Fri, 04 Sep 2026 15:02:03 GMT</pubDate>
    <dc:creator>Saurabh Arora</dc:creator>
    <dc:creator>Sudhanshu Prajapati</dc:creator>
    <category>databricks cost</category>
    <category>databricks serverless</category>
    <category>databricks compute</category>
    <category>Databricks</category>
    <description>Whenever somebody mentions serverless, two things come to mind: it should be cheaper than normal resources and no infrastructure management, right? This is certainly what has been claimed both from Da</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper/cover.jpg" alt="Databricks Serverless vs Classic Compute: Which One Is Actually Cheaper?" /></p>
<p>Whenever somebody mentions <em>serverless</em>, two things come to mind: it should be cheaper than normal resources and no infrastructure management, right? This is certainly what has been claimed both from Databricks and from several (potentially sponsored) case studies.</p>
<p>But it is still a very debatable topic.</p>
<p>In this blog post, I will be dissecting <strong>Databricks Serverless</strong>, which was initially introduced in 2017 for Apache Spark. Today, almost every offering in Databricks has a serverless option. This hosting option has gained a lot of interest.</p>
<p>So, let’s look at:</p>
<ul>
<li><p>What Databricks Serverless is, exactly</p>
</li>
<li><p>Compare the cost of Databricks serverless vs classic compute</p>
</li>
<li><p>Under which circumstances should you pick one over the other</p>
</li>
</ul>
<p>But first, let’s talk first about serverless in general.</p>
<h2>What is Serverless Compute? And Why Might You Use It?</h2>
<p>In simple terms, serverless compute means you run your workloads on third-party infrastructure without managing anything yourself. The managed service does the infrastructure work for you.</p>
<p>Think of serverless compute as a flexible, on-demand service. You use it for the exact time you need and pay only for that period. You do not maintain hardware or handle backend upkeep costs.</p>
<p>Just like any on-demand service, serverless compute has fair-use rules and boundaries. The provider guarantees fast access and manages capacity behind the scenes. The provider still applies operational limits.</p>
<p>Databricks provides multiple types of serverless compute. Below are the key serverless compute types:</p>
<ul>
<li><p><strong>Serverless SQL Warehouses</strong>: On-demand elastic compute for running SQL queries from the SQL editor, dashboards, and BI tools. Warehouses start in seconds and scale automatically with demand, so there's no sizing decision and no idle cluster sitting around. Billed per DBU-second on its own serverless SQL SKU.</p>
</li>
<li><p><strong>Serverless All Purpose Compute:</strong> This serverless compute removes the need to manage the underlying cluster infrastructure. It scales compute resources automatically based on workload demand. It suits interactive development, notebooks, and ad hoc analysis. Pick it for that work when fast startup and less cluster management matter more than cost.</p>
</li>
<li><p><strong>Serverless Jobs Compute</strong> Compute for scheduled and triggered jobs (what used to be Workflows). Databricks provisions compute for every run and scales it to match the workload, with smart retries and cloud failover built in. It supports notebook, Python script, dbt, Python wheel, and JAR tasks. With serverless Jobs Compute, Photon and autoscaling are always on.</p>
</li>
<li><p><strong>Serverless Spark Declarative Pipelines:</strong> The compute behind Lakeflow Spark Declarative Pipelines. You define the transformation logic and Databricks runs the pipeline without you configuring or deploying any infrastructure. It’s a good fit for <a href="/blog/databricks-streaming-tables-continuous-vs-triggered">streaming and incremental ETL</a> where cluster sizing is hard to predict.</p>
</li>
<li><p><strong>Serverless GPU compute:</strong> Still in beta and aimed at deep learning: training and fine-tuning custom models without managing GPU fleets or drivers. It runs on A10s for smaller work and H100s (8 GPUs per node) for large interactive or distributed training.</p>
</li>
</ul>
<h2>Standard vs. Performance-Optimized vs. Serverless Compute</h2>
<p>Let’s compare three things:</p>
<ul>
<li><p><strong>Standard Databricks Compute</strong> means any instance type with little effort spent to optimize performance.</p>
</li>
<li><p><strong>Performance-optimized compute</strong> refers to an instance family and configuration suited to the kind of workload you want to run. An example is a scheduled long-running job that runs every Monday morning.</p>
</li>
<li><p><strong>Serverless compute</strong>, where you don’t need to think about what instance family or thing you’re using.</p>
</li>
</ul>
<p>Here's how the three stack up.</p>
<table>
<thead>
<tr>
<th></th>
<th>Standard (classic)</th>
<th>Performance-optimized (classic)</th>
<th>Serverless</th>
</tr>
</thead>
<tbody><tr>
<td>Best fit for</td>
<td>Anything where nobody has looked at the bill yet</td>
<td>Steady, predictable jobs whose shape you already know</td>
<td>Bursty, unpredictable, or interactive work</td>
</tr>
<tr>
<td>What you configure</td>
<td>A generic instance type and cluster size</td>
<td>Instance family, node type, and autoscale range chosen for the workload</td>
<td>Nothing. Databricks chooses and scales it per run</td>
</tr>
<tr>
<td>Startup time</td>
<td>Minutes per cluster start (zero once running, billed while idle)</td>
<td>Minutes, same as standard</td>
<td>Seconds</td>
</tr>
<tr>
<td>Billed for</td>
<td>DBUs plus the underlying cloud VM, for however long the cluster is up</td>
<td>Same as Standard, but sized to cut waste</td>
<td>DBUs only, at a higher per-DBU rate, for the seconds the job actually runs</td>
</tr>
<tr>
<td>Who tunes it</td>
<td>You, once, when the cluster policy is set</td>
<td>You, per workload, based on profiling the job</td>
<td>Databricks, automatically, on every run</td>
</tr>
</tbody></table>
<h2>Databricks Serverless Performance Optimized vs Standard Mode</h2>
<p>Serverless jobs use the same two words for a different setting. The <strong>Performance optimized</strong> toggle on a job's details page picks the serverless performance mode.</p>
<ul>
<li><p><strong>Performance optimized on</strong> starts and runs the job faster. Databricks designs this mode for time-sensitive work.</p>
</li>
<li><p><strong>Performance optimized off</strong> runs the job in standard performance mode. It uses less compute, and startup can take 4 to 6 minutes.</p>
</li>
</ul>
<p>Both modes bill the same SKU, but standard mode consumes fewer DBUs. So standard mode costs less for any job that can wait for its start. The toggle changes only the serverless tasks in a job. The <a href="https://docs.databricks.com/aws/en/jobs/run-serverless-jobs">Databricks serverless jobs documentation</a> describes both modes.</p>
<h2>Should you use Databricks Serverless Compute?</h2>
<p>There are two main reasons to choose serverless.</p>
<p>First, you skip routine maintenance and do not provision capacity up front. So your team focuses on building pipelines instead of managing machines.</p>
<p>Second, resources start in seconds instead of minutes, which removes long wait times and stops you from paying for idle compute.</p>
<p>Serverless tends to be the right call when:</p>
<ul>
<li><p>You want zero cluster management, with no configs to write and no sizing to tune. You want startup in seconds rather than minutes.</p>
</li>
<li><p>The workload is spiky, interactive, or unpredictable. Examples are ad hoc SQL, BI dashboards, notebooks, or short jobs.</p>
</li>
<li><p>You are paying for idle time on classic clusters today and want to get rid of it.</p>
</li>
<li><p>Iteration speed matters more to you than fine-grained cost control.</p>
</li>
</ul>
<p><a href="https://altimate.ai/blog/understanding-databricks-compute-costs">Cost-wise</a>, Databricks serverless carries a higher per-DBU rate than classic compute. In exchange, you pay only for the seconds a job runs. Classic is cheaper per DBU. But you pay for however long the cluster stays up, including idle time. You also carry cloud VM costs separately. The share of billed time spent doing work decides which option costs less, more than the list price does.</p>
<p>In our benchmark of Databricks serverless vs classic compute, serverless didn’t require much cluster-management work and delivered the shortest runtime. However, the trade-off is price. The serverless run costs <strong>$8.90</strong> after a 6% effective-rate discount. The least-expensive on-demand configuration costs <strong>$3.33</strong>. The least-expensive spot configuration costs <strong>$2.32</strong>. The serverless premium is <strong>2.7x</strong> over on-demand and <strong>3.8x</strong> over spot.</p>
<img src="/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper/5c3ed8b1-3aa5-4dfa-9057-544ba41ce53d.png" alt="Cost per TPC-DS run" style="display:block;margin:0 auto" />

<h2>Benchmark setup</h2>
<p>Below is benchmark setup we used in our comparison:</p>
<ul>
<li><p><strong>Workload:</strong> TPC-DS at scale factor 1,000 - approximately a 1 TB decision-support dataset under the <a href="https://www.tpc.org/tpc_documents_current_versions/pdf/tpc-ds_v1.4.0.pdf">TPC scaling model</a>.</p>
</li>
<li><p><strong>Serverless:</strong> default platform settings.</p>
</li>
<li><p><strong>Classic compute:</strong> <code>m6id.xlarge</code>, <code>c5d.xlarge</code>, and <code>r6id.xlarge</code> workers, each tested with on-demand and spot capacity.</p>
</li>
<li><p><strong>Cluster policy:</strong> autoscaling from 4 to 12 workers; <code>m6id.large</code> on-demand driver; Databricks Runtime 14.3 LTS with Spark 3.5.0.</p>
</li>
<li><p><strong>Sampling:</strong> three paired runs per day 06:00, 14:00, and 22:00 for 21 days, giving 63 observations per worker type. Serverless and classic jobs were launched concurrently to reduce time-of-day bias.</p>
</li>
<li><p><strong>Primary measures:</strong> effective cost per successful run and end-to-end elapsed time. Runs should use the same region, table snapshot, file layout, query set, and cache policy. Retries and spot reclamations belong in the cost of the completed run.</p>
</li>
</ul>
<p>The two compute models require different accounting.</p>
<p>For classic compute, integrate driver and worker uptime across autoscaling events. Then add both infrastructure and DBU charges:</p>
<pre><code>classic cost = Σ(worker-seconds × [VM rate + DBU rate]) + driver + storage + retry overhead</code></pre>
<p>For serverless, we used metered DBUs at the effective contracted rate. Databricks selects the worker shape and scaling policy for serverless. So this benchmark is a platform-mode comparison rather than an instance-for-instance test. <strong>Default serverless settings may also differ in Photon use and execution-engine behavior. Check query plans and cache state before you attribute the runtime gap solely to elasticity</strong>.</p>
<h2>Benchmark Results for Serverless and Classic Compute</h2>
<img src="/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper/ddd13845-855a-4c9a-9eb3-327ce913cf6d.png" alt="Average runtime by compute option" style="display:block;margin:0 auto" />

<p>Serverless finishes about <strong>5 minutes sooner than on-demand</strong> and <strong>21 minutes sooner than spot</strong>. But the additional spend is <strong>$5.57</strong> and <strong>$6.58</strong> per run, compared with the cheapest option in each class. Put differently, the cost premium is roughly <strong>$1.11 in additional cost per minute saved</strong> vs on-demand and <strong>$0.31 per minute saved</strong> vs spot.</p>
<p>Latency-sensitive pipelines may justify the serverless premium. Serverless gives those pipelines tighter completion windows, faster scale-up, and lower operational load. Classic compute remains the stronger cost choice for scheduled workloads with slack in the service-level objective. Classic saves the most when you tune worker families, Photon, shuffle storage, and autoscaling bounds to the query mix. So weigh each decision against the value of a minute saved, rather than cost or runtime in isolation.</p>
<p><a href="https://qubika.com/blog/databricks-cost-series-part-2-serverless-vs-classic/">Qubika</a> reports the same job swinging from 30% cheaper to 2x more expensive on serverless, depending on the workload. Qubika concludes that you should benchmark your own jobs rather than trust a fixed ratio either way.</p>
<p>The cheaper choice between Databricks serverless and classic compute depends on how long and how often your job runs.</p>
<p>Serverless removes startup and idle overhead, which dominates short jobs. A 4-minute job that previously consumed 12 minutes of cluster time now consumes 4. The longer the job runs, the smaller the startup and idle overhead becomes as a share of the total. On longer jobs, classic compute's lower per-DBU rate starts to win on its own.</p>
<p>The rough break-even is around 30 minutes of runtime. Below that, serverless is usually cheaper before you even account for the operational savings. Above that, classic wins unless serverless is delivering a 30 to 60% speedup that classic cannot match.</p>
<p>That provides you three ways to decide what to go for once you know a job's typical run duration and how steady its schedule is:</p>
<ul>
<li><p><strong>Choose serverless</strong> for jobs that run under 30 minutes. Serverless also fits an unpredictable or interactive schedule, such as ad hoc SQL or BI dashboards. Pick serverless when you don’t want infrastructure management or cluster spin-up. With serverless, you also get no separate bill for cloud resource usage.</p>
</li>
<li><p><strong>Choose Classic</strong> for jobs that run long and steady. You can size the cluster once and push the cost down further with spot instances or committed-use discounts. Classic also gives you finer control over the cost. Classic also needs more of your own monitoring and debugging.</p>
</li>
<li><p><strong>Run a hybrid</strong>, which is where most shops end up. Use serverless for ad hoc and interactive work. Use classic job clusters for the long, predictable ETL that runs the same way every night.</p>
</li>
</ul>
<img src="/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper/6d113282-a7f0-45f2-a9c2-40ab5af7bff5.svg" alt="Decision flow: choosing serverless or classic compute for a workload" style="display:block;margin:0 auto" />

<h2>When to Keep Classic Databricks Compute</h2>
<p>You can optimize classic compute to a certain extent with spot instances, committed-use discounts, and right-sizing the cluster once. Classic compute also remains the better choice outright in a few concrete situations:</p>
<ul>
<li><p>You need custom configuration. Examples are a specific instance type, GPUs, init scripts, OS-level libraries, or nonstandard Spark configs.</p>
</li>
<li><p>The workload is long-running and steady. A steady workload lets you use spot instances or reserved and committed-use discounts. Spot instances and those discounts push the cost well below what serverless would charge for the same hours.</p>
</li>
<li><p>You have strict networking requirements, such as a workload that has to run inside your own VPC or VNet.</p>
</li>
<li><p>You are running heavy ML training or another specialized workload that serverless does not fully support yet. The Databricks serverless GPU offering is in beta as of now.</p>
</li>
</ul>
<h2>How to Decide Between Serverless and Classic for Each Job</h2>
<p>Neither Databricks compute option is cheaper in every case. Choosing between Databricks serverless and classic compute comes down to each job's runtime and how steady its schedule is. Pull up your longest-running and shortest-running jobs and check where they fall against the 30-minute break-even. For the other levers that cut the bill, such as spot workers, Photon, and auto termination, read <a href="https://altimate.ai/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill">Beyond the Databricks Cost Calculator</a>.</p>
<h2>Frequently Asked Questions</h2>
<h3>Is Databricks Serverless Cheaper Than Classic Compute?</h3>
<p>The answer depends on job runtime. Serverless removes startup and idle time. That overhead dominates short jobs, so serverless usually wins below about 30 minutes of runtime. Above that, the lower per-DBU rate of classic compute usually wins, unless serverless runs the job 30 to 60% faster.</p>
<h3>How Much Did Serverless Cost in the TPC-DS Benchmark?</h3>
<p>Serverless cost $8.90 per successful TPC-DS run at scale factor 1,000, after a 6% effective-rate discount. The cheapest on-demand classic configuration cost $3.33, and the cheapest spot configuration cost $2.32. Serverless finished about 5 minutes sooner than on-demand and 21 minutes sooner than spot.</p>
<h3>When Should You Keep Classic Databricks Compute?</h3>
<p>Keep classic compute when you need a specific instance type, GPUs, init scripts, OS-level libraries, or nonstandard Spark configs. Classic compute also costs less for long, steady workloads that can use spot instances or committed-use discounts. Workloads that must run inside your own VPC or VNet also need classic compute. Heavy ML training stays on classic compute while serverless GPU compute is in beta.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/databricks-serverless-vs-classic-compute-which-one-is-actually-cheaper/cover.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Understanding Databricks DBU and Compute Costs</title>
    <link>https://altimate.ai/blog/understanding-databricks-compute-costs</link>
    <guid isPermaLink="true">https://altimate.ai/blog/understanding-databricks-compute-costs</guid>
    <pubDate>Wed, 19 Aug 2026 14:06:15 GMT</pubDate>
    <dc:creator>Saurabh Arora</dc:creator>
    <category>Databricks</category>
    <category>altimateAI</category>
    <category>finops</category>
    <description>There is so much around Databricks cost optimization techniques, strategies, approaches, what to do, what not to do, and many guides from authors, even official sources from Databricks. All of those c</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/understanding-databricks-compute-costs/99cb0dd4-1cf6-4536-81c5-ce9954e222f8.jpg" alt="Understanding Databricks DBU and Compute Costs" /></p>
<p>Authors and Databricks itself publish many guides on Databricks cost optimization. They cover techniques, strategies, approaches, and what to do and not do. The guides converge on the same checklist: turn on auto-termination, use job clusters, try spot instances, enable Photon...</p>
<p>None of that is wrong. The problem is that it assumes you already know where your money is going, and most teams don't.</p>
<p>We still need to make sense of how Databricks compute actually works. What decides your Databricks bill when you get billed for the usage in a month? It sounds easier to just say, "Hey, you’ve used 300 DBU. The DBU rate is $0.40 per DBU. That means 300 DBU times $0.40 = $120, right?"</p>
<p>But then you might be wondering about that DBU 300; is that the only cost you need to take into account? What did it cost to keep the compute running that consumed those DBUs? And if someone asked you what the marketing team's dashboards cost last month, or how much of that was compute sitting idle, could you answer?</p>
<h2>What Is a Databricks DBU?</h2>
<p>A DBU, or Databricks Unit, is the unit Databricks uses to bill compute. Each instance type consumes a set number of DBUs per hour, and each DBU has a price. Your DBU cost is the DBUs you consume times the price per DBU.</p>
<p>In mid-2026, all-purpose compute on a standard runtime costs around $0.55 per DBU-hour. So an instance rated at 0.5 DBU per hour costs about $0.28 an hour in DBUs. On classic compute, that DBU charge is only one of two bills, as the next section shows.</p>
<h2>How Databricks DBU Cost and Cloud Infrastructure Cost Add Up</h2>
<p>The Lakehouse model stores data once in <a href="https://opendataformats.org/">open formats</a> and brings compute engines to that data, instead of copying it into a separate warehouse for analysis. That is one of the core economic principles behind the Databricks model.</p>
<p>To understand how this affects your Databricks billing, see how Databricks decouples three core layers:</p>
<ol>
<li><p>Storage: Holds the data indefinitely in open formats at raw cloud storage rates.</p>
</li>
<li><p>Governance: Controls access and security across the entire data estate via Unity Catalog.</p>
</li>
<li><p>Compute: Executes work against the stored data on demand.</p>
</li>
</ol>
<h3>The Databricks Compute layer</h3>
<p>Databricks compute is the execution layer. It is where queries run, notebooks execute, jobs transform data, and machine learning workflows consume governed datasets and turn them into outputs. In the Databricks operating model, storage preserves data and governance defines who can use it, but compute is where value is actually created.</p>
<h3>What Compute Types Does Databricks Offer?</h3>
<p>Databricks offers three types of compute:</p>
<ul>
<li><p><strong>Serverless Compute</strong>: Fully managed compute that is available instantly. Databricks handles cluster provisioning, scaling, and maintenance.</p>
</li>
<li><p><strong>Classic Compute</strong>: Compute clusters provisioned directly in your cloud account, giving you full control over node types and configurations.</p>
</li>
<li><p><strong>SQL Warehouses</strong>: Specialized compute optimized specifically for SQL queries, BI dashboards, and data warehousing workloads.</p>
</li>
</ul>
<p>Separating storage and compute does not remove their costs. The costs become visible, more distributed, and more operational. So the total Databricks cost becomes a <strong>two-bill problem</strong>.</p>
<p>The first bill is <strong>platform cost,</strong> where you pay for the Databricks platform in DBUs.</p>
<p>A DBU, or <em>Databricks Unit</em>, is Databricks’ billing unit for compute consumption. A DBU measures compute power consumed over time. Databricks tracks your bill by compute SKU, usage type, and workload category instead of a single flat "cluster cost". For example, in mid-2026 an all-purpose compute cluster typically costs around $0.55 per DBU-hour for a standard runtime.</p>
<p>The second bill comes from <strong>your cloud provider</strong>. That bill covers the infrastructure cost: virtual machines, disks, and associated network costs. Serverless compute is the one major exception. Its Databricks DBU charge already includes the virtual machine cost, because Databricks manages that compute itself.</p>
<p>Now go back to the $120 calculation from the intro. That $120 is not the total cost. DBUs are only the Databricks half. The EC2 or VM hours, the disks, the NAT gateway, and the cross-zone traffic arrive on a separate invoice. You don’t see that invoice on the Databricks console. This split is why two common cost conversations go sideways:</p>
<ol>
<li><p>A team cuts its Databricks DBU cost by 20% and wonders why the total bill barely moved. The infrastructure half didn't change.</p>
</li>
<li><p>A team compares the serverless DBU rate against the classic DBU rate and concludes serverless costs several times more. But serverless includes the VM whereas Classic doesn't.</p>
</li>
</ol>
<img src="/blog/understanding-databricks-compute-costs/5f4fc6af-b568-45f6-9a22-987990f81280.png" alt="Diagram titled &quot;Solving the two-bill problem,&quot; contrasting the traditional split of a Databricks invoice for DBUs plus a separate cloud provider invoice for VMs, disks, and networking against the serverless exception, where infrastructure costs are bundled into one consolidated DBU invoice." style="display:block;margin:0 auto" />

<p>Your Databricks DBU cost covers only half of what you pay. The other half is the infrastructure you kept running to consume those DBUs.</p>
<h2>Start With Databricks System Tables and Know Their Gaps</h2>
<p>To understand usages, Databricks system tables are the right place to start, and most teams underuse them. Four tables matter most for compute cost, plus one more if you run SQL warehouses:</p>
<table>
<thead>
<tr>
<th>Table</th>
<th>What it gives you</th>
</tr>
</thead>
<tbody><tr>
<td><code>system.billing.usage</code></td>
<td>DBU quantities, SKU names, and a <code>usage_metadata</code> struct with <code>cluster_id</code>, <code>warehouse_id</code>, <code>job_id</code>, and <code>job_run_id</code>, plus custom tags and the identity that ran the workload</td>
</tr>
<tr>
<td><code>system.billing.list_prices</code></td>
<td>List prices per SKU over time, so you can turn DBUs into dollars</td>
</tr>
<tr>
<td><code>system.compute.clusters</code></td>
<td>Cluster configuration history, so you see what a cluster looked like when it ran</td>
</tr>
<tr>
<td><code>system.compute.node_timeline</code></td>
<td>Per-minute CPU and memory per node.</td>
</tr>
</tbody></table>
<p>Add <code>system.query.history</code> if you run SQL warehouses, because it records how long queries spent waiting for compute.</p>
<p>To see Databricks DBU cost in dollars, join <code>system.billing.usage</code> to <code>system.billing.list_prices</code> on the SKU name and the period each price was in effect. This query is adapted from the Databricks <a href="https://docs.databricks.com/aws/en/admin/usage/system-tables">billing sample queries</a> and returns usage and list cost per SKU for the last 30 days:</p>
<pre><code class="language-sql">SELECT usage.sku_name,
       usage.usage_unit,
       SUM(usage.usage_quantity) AS quantity,
       SUM(usage.usage_quantity * list_prices.pricing.effective_list.default) AS list_cost
FROM system.billing.usage
JOIN system.billing.list_prices
  ON list_prices.sku_name = usage.sku_name
WHERE usage.usage_end_time &gt;= list_prices.price_start_time
  AND (list_prices.price_end_time IS NULL OR usage.usage_end_time &lt; list_prices.price_end_time)
  AND usage.usage_date &gt;= current_date() - INTERVAL 30 DAYS
GROUP BY usage.sku_name, usage.usage_unit
ORDER BY list_cost DESC;
</code></pre>
<p>The result uses list prices and does not reflect any negotiated discount.</p>
<p>Before writing anything custom, you can import Databricks' <a href="https://docs.databricks.com/aws/en/admin/system-tables/jobs-cost">Lakeflow observability dashboard</a>. It ships as JSON you drop into your workspace, and the page publishes the SQL behind every tile.</p>
<p>Note - if you use the Lakeflow observability dashboard, be aware that <code>usage_metadata.job_id</code> is only populated for jobs on job compute or serverless. So filtering billing usage for an all-purpose SKU where <code>job_id</code> is not null returns nothing at all. The empty result only means the filter never had rows to match. To actually find jobs running on all-purpose clusters, you have to go through <code>job_task_run_timeline</code> joined against <code>compute.clusters</code>, and Databricks <a href="https://docs.databricks.com/aws/en/admin/system-tables/jobs">publishes that query</a>.</p>
<p><em>None of these Databricks system tables contains a single dollar of cloud infrastructure cost</em>. To get a total bill, you join Databricks usage against your cloud provider's cost and usage report based on resource tags. Databricks does propagate cluster tags.</p>
<img src="/blog/understanding-databricks-compute-costs/76a18c3c-79d5-44cd-bcad-04ef6e4e7c87.png" alt="Altimate AI Current State view of Databricks costs for Jul 6 to Aug 3, 2026, totaling $49.51K, broken into SQL Warehouse $22.27K, Clusters $20.95K, Lakehouse $3.36K, AI/ML $2.12K, and Platform $801, shown as a daily stacked bar chart of spend by SKU type." style="display:block;margin:0 auto" />

<p><em>Altimate's Clusters and SQL Warehouses views stitch both halves together and attribute the result down to cluster, warehouse, job, and team. You can read one number per workload instead of reconciling two exports by hand.</em></p>
<h2>Where your compute money goes</h2>
<p>Once you start thinking in terms of two bills, the next step is understanding what usually drives the cost. For most teams, Databricks DBU cost and cloud cost go into a familiar set of buckets:</p>
<table>
<thead>
<tr>
<th>Where the money goes</th>
<th>Which bill it contributes to</th>
<th>What to look at first</th>
</tr>
</thead>
<tbody><tr>
<td>Idle time on interactive compute</td>
<td>Both</td>
<td>Cluster uptime against query time</td>
</tr>
<tr>
<td>The wrong compute type for the workload</td>
<td>Databricks (DBU)</td>
<td>All-purpose SKUs running scheduled jobs</td>
</tr>
<tr>
<td>Oversizing</td>
<td>Both</td>
<td>Node utilization in system.compute.node_timeline</td>
</tr>
<tr>
<td>Loose or poorly bounded autoscaling</td>
<td>Both</td>
<td>The minimum you always pay, and how long max is held</td>
</tr>
<tr>
<td>Long-running interactive resources that nobody turns off</td>
<td>Both</td>
<td>Auto-termination settings</td>
</tr>
<tr>
<td>Streaming patterns that run 24*7 when the business requirement does not actually need 24*7 freshness</td>
<td>Both</td>
<td>Trigger mode against the business requirement</td>
</tr>
<tr>
<td>Infrastructure side effects such as networking, egress, or duplicated data movement</td>
<td>Cloud only</td>
<td>Your cloud cost and usage report, by tag</td>
</tr>
</tbody></table>
<p>Workloads drift, so revisit the table above on a regular schedule, not only after a bill shock prompts a one-time sprint.</p>
<p>Despite all the efforts, a pipeline can be on the wrong SKU, oversized, and idle half the time, all at once. That pipeline will look completely healthy on every alert you have unless you have visibility at that granular level.</p>
<h3>When Serverless Helps, and When It Doesn't</h3>
<p>As we discussed earlier, serverless compute is good for bursty workloads such as BI. BI workloads often come in bursts. A user refreshes a dashboard, runs a query, inspects results, then goes idle. In non-serverless warehouses, startup time is long enough that teams often leave resources running to avoid waiting. Serverless can help change this trade-off because it can start and scales in seconds and can terminate idle compute sooner than all-purpose/classic compute.</p>
<p>What you give up is control. No picking instance families, no spot strategy, no pool tuning. That's fine when your problem is startup delay and idle waste. It hurts when your problem needs precise control over the infrastructure underneath the workload.</p>
<p>So skip "is serverless cheaper?" and ask what kind of waste we are trying to eliminate. Serverless is often the best choice at its premium price when the waste comes from slow startups, bursty access, and long idle windows.</p>
<p>Classic compute can cost less when the workload is steady, predictable, and suited to deliberate sizing and cloud cost engineering. That is especially true when teams know their workload shape well enough to right-size aggressively. Those teams can also use cloud primitives that serverless does not expose in the same way.</p>
<p>This is also why visibility comes before optimization. Without data on burstiness, concurrency, and idle windows, the serverless debate turns ideological instead of operational.</p>
<h3>Idle and the Wrong Compute Type</h3>
<p>These two problems compound each other. Take a big all-purpose cluster. The work finishes fast because the instance is large. But the cluster hangs around afterward because spinning it back up is slow. You're paying double: a costlier instance, and longer idle time on top of it. All-purpose clusters are also much easier to leave running between interactions. Job compute only runs while there's a job to run.</p>
<p>"Job compute is typically 2-3x cheaper than all-purpose," says Databricks’ <a href="https://www.databricks.com/blog/chaos-control-cost-maturity-journey-databricks">cost maturity post</a>. Treat that figure as a starting range, not a rule. What you save depends on how much runtime was idle and which half of the bill dominates for that workload. Teams miss this constantly, and the pattern is always the same:</p>
<ol>
<li><p>A notebook starts on an all-purpose cluster because development is interactive.</p>
</li>
<li><p>The workflow proves useful.</p>
</li>
<li><p>It becomes production-critical.</p>
</li>
<li><p>Nobody revisits the compute type.</p>
</li>
<li><p>The company pays a production bill for a development pattern.</p>
</li>
</ol>
<p>A quick fix is auto-termination on all interactive compute resources. Add scheduled restart patterns for business-hour usage where startup delay matters. Auto-termination controls idle waste. It does not fix the underlying pattern when the workload lives on the wrong compute type.</p>
<p>It is one thing to tell every team to use job compute. It is more useful to know exactly which production pipelines still run on all-purpose clusters. You also want to know how long those clusters sit idle and what the cost delta looks like. The <code>system.billing.usage</code> and <code>compute.node_timeline</code> join from the previous section answers those questions.</p>
<img src="/blog/understanding-databricks-compute-costs/1cab7cec-a84b-4957-91bb-3287c9ddfebb.png" alt="Altimate AI Discover page for Jul 4 to Aug 3, 2026, showing $714–$742 in money savings, 3.8 hours of time savings, and 66 opportunities, above a table of opportunities such as continuous jobs running on an interactive cluster, each with resource details, savings estimates, effort rating, and assigned owner." style="display:block;margin:0 auto" />

<p><em>The Discover page in the</em> <a href="https://altimate.ai"><em>Altimate.ai</em></a> <em>enterprise platform surfaces this kind of opportunity.</em></p>
<p>In the screenshot, Discover flags a continuous job running on an interactive cluster and suggests switching it to a serverless job or a job cluster. Read more about <a href="https://altimate.ai/use-cases/altimate-for-databricks">Databricks cost optimization with Altimate</a>.</p>
<h3>Spot and Fleet Instances</h3>
<p>On classic compute, spot is still the most underused lever. Use spot instances for workloads that can tolerate interruptions. Keep the Spark driver, which is the first instance, on demand. Run the workers on spot capacity. Keep the Fleet instance types on AWS, where Databricks can choose the best-matching physical instance types by price and availability. See more in Databricks' <a href="https://docs.databricks.com/aws/en/lakehouse-architecture/cost-optimization/best-practices">guidance on choosing optimal resources</a>.</p>
<p>However, Spot is not a universal answer. It works best when the workload is fault-tolerant and when retry, checkpointing, or restart behavior makes interruption acceptable. Batch ETL, retry-friendly pipelines, and some model-training jobs are natural candidates. Low-latency or interruption-sensitive workloads are not.</p>
<p>Spot only touches the cloud bill. It does nothing to reduce Databricks DBU consumption. So on Jobs Compute, where the DBU rate is low and infrastructure is a large share, Spot moves more of the bill. On All-Purpose, where DBUs dominate, fixing the SKU matters more. Know which half you are attacking before you pick the lever.</p>
<p>Levers like these are why classic can still beat serverless on cost for stable workloads, and why it demands more operational maturity. Someone has to decide what's interruption-tolerant, enforce the driver/worker pattern, and keep it consistent.</p>
<blockquote>
<p>The cheapest Databricks configuration is usually the one whose behavior matches the workload, not the one with the lowest nominal unit rate. It also helps to know which levers that configuration actually exposes.</p>
</blockquote>
<h3>Autoscaling That Doesn't Behave How You'd Expect</h3>
<p>Most people picture autoscaling as something that tracks CPU. Databricks autoscaling does not track CPU. Databricks describes <a href="https://www.databricks.com/blog/2018/05/02/introducing-databricks-optimized-auto-scaling.html">its optimized autoscaling</a> in terms of workload behavior. Worker allocation reacts to job characteristics, mainly the backlog of pending tasks.</p>
<p>A cluster can scale up while its existing nodes sit at 30 percent CPU because the stage produced a lot of small tasks. It can also stay flat under heavy CPU load because the work is never split into enough tasks to create a backlog.</p>
<p>Which leads to five things people get wrong:</p>
<ul>
<li><p><strong>A wide min/max range is not free insurance.</strong> If you set the range to 2 to 20, a burst of small tasks pulls you toward 20. Autoscaling holds those nodes for the stage and bills you. Autoscaling did its job. The range was the decision, and the range was a guess.</p>
</li>
<li><p><strong>Your minimum is a floor you always pay.</strong> A minimum of 8 workers means you never pay for fewer than 8, including the long tail where one straggler task is finishing.</p>
</li>
<li><p><strong>Streaming does not scale back down the way batch does.</strong> A continuous stream always has work in flight. So the underutilization condition rarely holds. Databricks recommends Lakeflow pipelines with enhanced autoscaling for streaming rather than treating standard autoscaling as universal. Databricks also recommends triggered incremental patterns like AvailableNow when the business does not need 24/7 freshness. <a href="/blog/databricks-streaming-tables-continuous-vs-triggered">Whether you need 24/7 freshness</a> is usually the bigger cost question.</p>
</li>
<li><p><strong>Autoscaling does not fix oversizing.</strong> It is a range. Give it the wrong range, and it arrives at a wrong number faster.</p>
</li>
<li><p><strong>Cluster autoscaling and SQL warehouse scaling are not the same system.</strong> Conflating the two is expensive, and it is worth its own explanation below.</p>
</li>
</ul>
<h3>Warehouse size and warehouse scaling are different dials</h3>
<p>A SQL warehouse has two independent settings:</p>
<ul>
<li><p><strong>Size</strong> (2X-Small up to 4X-Large) is how much compute sits behind one cluster. Each step up doubles the <a href="https://docs.databricks.com/aws/en/compute/sql-warehouse/warehouse-behavior">worker count</a>, from 1 worker at 2X-Small to 256 at 4X-Large, and the DBU rate scales with it. A bigger size makes a single heavy query faster.</p>
</li>
<li><p><strong>Scaling</strong> (min and max clusters) is how many identical clusters sit behind the warehouse. More clusters means more queries run at once. It does nothing for the speed of any single query.</p>
</li>
</ul>
<p>To understand, let’s take an example: users say the warehouse is slow. Someone bumps the size, which doubles the rate. But the actual problem was 30 analysts hitting it at 9am and queueing. No query was compute-starved; they were waiting. The size increase does not help, so someone bumps it again. You are now paying four times the original rate for a concurrency problem that more clusters would have fixed at the original size.</p>
<p>The diagnostic is queue time in system.query.history. Significant time waiting for compute usually means scaling out, and long execution with negligible queue time means scaling up. Databricks treats a consistently non-zero queue as a sign that you need either a larger size or more clusters. Check which of the two the queue points to before you turn a dial.</p>
<h3>How to Right-Size Clusters and Warehouses</h3>
<p>"Right-sizing" is the most overused and underexplained phrase in Databricks cost conversations. Databricks' <a href="https://docs.databricks.com/aws/en/lakehouse-architecture/cost-optimization/best-practices">cost optimization best practices</a> explain it as:</p>
<blockquote>
<p>Sizing in terms of workload demands: total executor cores, total executor memory, local storage, data partitioning, computational complexity, and parallelism needs. It also recommends starting SQL warehouses at smaller sizes and scaling up only as concurrency and query complexity justify it.</p>
</blockquote>
<p>That definition splits right-sizing into several separate questions:</p>
<ul>
<li><p>Is this workload interactive SQL, scheduled ETL, ad hoc exploration, streaming, or ML?</p>
</li>
<li><p>Is it on the right compute type at all?</p>
</li>
<li><p>Is the instance family aligned with CPU, memory, shuffle, or caching needs?</p>
</li>
<li><p>Is the driver/worker balance sensible?</p>
</li>
<li><p>Is the warehouse or cluster too large for its actual concurrency pattern?</p>
</li>
<li><p>Is it too small, forcing longer runtime and creating false savings?</p>
</li>
</ul>
<p>Many teams make expensive mistakes because they treat right-sizing as downsizing.</p>
<p>But downsizing is only one possible outcome. Right-sizing can mean moving smaller or moving to a different instance family. It can mean moving a workload from all-purpose to job compute, or a bursty workload to serverless. It can also mean accepting a slightly larger resource, because the shorter runtime lowers the total cost.</p>
<p>This distinction becomes more important in mixed Databricks environments where SQL warehouses, Spark jobs, development notebooks, and streaming pipelines all coexist. A team that applies one universal sizing philosophy across all of them usually ends up mis-sizing most of them.</p>
<h2>How to pick a right family instance for jobs</h2>
<p>Instance-family choices are a bit of a cumbersome decision but the highest-impact compute decisions in Databricks cost optimization.</p>
<p>Databricks gives some simple rules of thumb in its AWS guidance:</p>
<ul>
<li><p>memory-optimized for ML, heavy shuffle, and spill-heavy workloads</p>
</li>
<li><p>compute-optimized for structured streaming and <a href="/blog/databricks-predictive-optimization">maintenance jobs</a></p>
</li>
<li><p>storage-optimized for workloads that benefit from caching, such as ad hoc or interactive analysis</p>
</li>
<li><p>general-purpose when there is no specific dominant requirement</p>
</li>
<li><p>GPU only where GPU-accelerated libraries actually justify it, per Databricks’ <a href="https://docs.databricks.com/aws/en/lakehouse-architecture/cost-optimization/best-practices">cost optimization best practices</a></p>
</li>
</ul>
<p>The same rules apply to the other cloud providers. Instance family is a cost decision as much as a performance one. A badly matched family can create waste even when the cluster size looks reasonable.</p>
<ul>
<li><p>A memory-heavy job on compute-optimized nodes may spill and run longer than necessary.</p>
</li>
<li><p>A shuffle-heavy workload on the wrong family may look “cheap” per node but cost more overall because of runtime inefficiency.</p>
</li>
<li><p>A cached interactive workload on the wrong shape can waste both time and money.</p>
</li>
</ul>
<p>To understand Databricks compute costs, count the nodes. Then ask what kind they are and whether they match your workload pattern.</p>
<img src="/blog/understanding-databricks-compute-costs/68137cf6-a424-4133-a9a1-e945b690f872.png" alt="Auto Tune Settings modal for job email-job-bi-tool, showing Auto Tune enabled for 1 of 1 tasks with automatic rollback if execution time exceeds 1.5x baseline, and a lineage graph card comparing the current driver (r5.2xlarge, $0.18/hr) to the applied proposal (r5.xlarge, $0.09/hr) with the worker type unchanged." style="display:block;margin:0 auto" />

<p><em>Altimate Auto Tune uses workload behavior to determine if the current compute family is optimal for the workload. Auto Tune shows how your current configuration and our suggested one each perform. You understand the issue before you trust Altimate’s recommendation to make a change.</em></p>
<h2>Keeping compute right-sized over time</h2>
<p>You now know what to set: the instance family, the compute type, and the autoscale range. You set all three on the cluster when you create it. Those values can go out of date within a few months, because of</p>
<ul>
<li><p>Concurrency changes</p>
</li>
<li><p>Query patterns change.</p>
</li>
<li><p>Teams change. A development environment becomes shared production infrastructure.</p>
</li>
<li><p>A job that used to be small becomes a major pipeline.</p>
</li>
<li><p>A warehouse sized for one dashboard becomes the default for ten.</p>
</li>
</ul>
<p>Right-sizing is an ongoing process. Databricks recommends regular cost audits, ongoing monitoring, tagging, budgets, dashboards, and revisiting strategies as environments scale or change. This is also where operator (FinOps) trust becomes part of the conversation.</p>
<p>As soon as you move from <em>we should size better</em> to <em>a system should help us keep sizing current,</em> the obvious questions appear:</p>
<ul>
<li><p>How much access does the system need?</p>
</li>
<li><p>What is the blast radius if it gets something wrong?</p>
</li>
<li><p>Is there an approval step?</p>
</li>
<li><p>Is there an audit trail?</p>
</li>
<li><p>Can I dry-run it first?</p>
</li>
<li><p>Can it roll back?</p>
</li>
<li><p>What does rollback restore, and what does it not restore?</p>
</li>
</ul>
<p>Rollback restores configuration. It does not restore time. If a change made a pipeline late, rollback fixes the next run. But the data that landed late stays late, and downstream jobs already read it as stale.</p>
<h3>How Altimate Auto Tune adds control</h3>
<img src="/blog/understanding-databricks-compute-costs/5be71c05-b51c-4122-925e-6d3fa1c999f4.png" alt="Flowchart of the Auto Tune safety loop: snapshot, apply, verify, then monitor performance, rolling back automatically if it regresses." style="display:block;margin:0 auto" />

<p>The rollback limit is why Auto Tune leans on scope, verification, and rollback instead of asking you to trust it. Auto Tune is two agents, one for jobs and one for SQL warehouses. Each agent gets its own guardrails.</p>
<img src="/blog/understanding-databricks-compute-costs/8dc31502-3f1e-4dc9-8803-cb7d52d7241a.png" alt="Auto Tune history log for job 'email_to_looker,' listing timestamped audit entries where Auto Tune applied, enabled, or backed off driver changes (such as r5.2xlarge to r5.xlarge and i3.2xlarge to r5.2xlarge), each attributed to the system, a service user, or a named engineer." style="display:block;margin:0 auto" />

<ul>
<li><p><strong>Snapshot, apply, verify:</strong> Every change captures the original config and applies the update. Then Auto Tune reads the config back to confirm the change took. The original is always exactly restorable.</p>
</li>
<li><p><strong>Performance monitoring with automatic backoff:</strong> Auto Tune watches performance against the recent baseline after every change. It tracks latency for warehouses and run health for jobs, and rolls back automatically if something regresses.</p>
</li>
<li><p><strong>Granular and approval-gated:</strong> Control is per job, per task, and per warehouse. Nothing changes until you enable a recommendation. Jobs only change while idle and after policy checks pass.</p>
</li>
<li><p><strong>Stays current:</strong> Once enabled, Auto Tune keeps following newer recommendations as the workload changes, under the same monitoring and backoff. That is how sizing stays current instead of going stale by next quarter.</p>
</li>
<li><p><strong>Fully audited:</strong> Auto Tune timestamps every requested, applied, failed, and backoff event with who, which job or task, before, and after. You can filter and export those events.</p>
</li>
</ul>
<p><strong>Savings you can see:</strong> Altimate reports realized savings, money already banked, separately from potential savings. Potential savings are ones Altimate identified but did not capture yet. The Autonomous Savings summary page shows the savings, with a breakdown per job and per warehouse if you want to drill down.</p>
<img src="/blog/understanding-databricks-compute-costs/a367847b-a36d-48ff-8fc7-400b74d6ea36.png" alt="Altimate AI Summary dashboard showing $83.37K total projected money savings over the next year, split into $74.20K autonomous and $9.17K assisted, with pie charts breaking savings down by autonomous vs. assisted and by DBU vs. cloud infrastructure." style="display:block;margin:0 auto" />

<h2>Which Compute Type for Which Workload</h2>
<table>
<thead>
<tr>
<th>Workload</th>
<th>Compute</th>
<th>Key settings</th>
</tr>
</thead>
<tbody><tr>
<td>Interactive BI</td>
<td>Serverless SQL warehouse</td>
<td>Right-size, short auto-stop, scale <em>out</em> on concurrency</td>
</tr>
<tr>
<td>Ad hoc SQL and exploration</td>
<td>Serverless, or classic with tight auto-termination</td>
<td>Start smaller than feels comfortable, size up on evidence</td>
</tr>
<tr>
<td>Scheduled ETL and batch</td>
<td>Job compute plus Auto Tune</td>
<td>On-demand driver, spot or fleet workers, narrow autoscale range</td>
</tr>
<tr>
<td>Short frequent jobs</td>
<td>Serverless jobs, or classic with a pool</td>
<td>Measure startup as a share of total runtime first</td>
</tr>
<tr>
<td>Streaming</td>
<td>Job compute, or Lakeflow with enhanced autoscaling</td>
<td>Evaluate triggered (AvailableNow) before assuming always-on</td>
</tr>
<tr>
<td>ML training</td>
<td>All-purpose or job compute with GPU</td>
<td>Pools for iteration, right-sized driver</td>
</tr>
</tbody></table>
<p>The cheapest option depends on the workload. Compute gets expensive when teams pick one out of habit.</p>
<h2>What to Measure Before You Optimize Databricks Compute</h2>
<p>On classic compute, your Databricks DBU cost and your cloud infrastructure cost arrive on separate invoices. Read both before you change a setting. Use the Databricks system tables to find which workloads run on which compute type and which clusters sit idle. Most waste comes from idle time, the wrong compute type, and defaults nobody revisited. Join that data to your cloud cost and usage report to measure what spot, autoscaling, auto-termination, and instance-family changes save.</p>
<hr />
<p>See the official Databricks <a href="https://docs.databricks.com/aws/en/lakehouse-architecture/cost-optimization/best-practices">cost optimization best practices</a><em> and the well-known</em> <a href="https://www.databricks.com/blog/chaos-control-cost-maturity-journey-databricks"><em>cost maturity journey post</em></a> <em>on the Databricks blog.</em></p>
<h2>Frequently Asked Questions</h2>
<h3>How Is Databricks DBU Cost Calculated?</h3>
<p>Your Databricks DBU cost is the DBUs a workload consumes multiplied by the rate for its compute SKU. An all-purpose compute cluster on a standard runtime costs around $0.55 per DBU-hour in mid-2026. Classic compute adds a separate cloud invoice for VMs, disks, and networking. Serverless compute includes the VM cost in the DBU rate.</p>
<h3>How Do You Reduce Databricks DBU Consumption?</h3>
<p>Idle interactive compute, oversized clusters, and loose autoscaling ranges all waste DBUs. To reduce Databricks DBU consumption, tighten auto-termination and narrow the autoscale range. Check per-node CPU and memory in <code>system.compute.node_timeline</code> to find oversized clusters. Moving scheduled jobs from all-purpose to job compute lowers the DBU rate. Databricks says job compute is typically 2 to 3x cheaper. Your saving depends on idle time and on which half of the bill dominates.</p>
<h3>Do Databricks System Tables Show the Full Compute Bill?</h3>
<p>The Databricks system tables hold DBU usage and list prices, but none of them contains cloud infrastructure cost. To get the total bill, join Databricks usage to the cost and usage report from your cloud provider on resource tags.</p>
<h3>Is Databricks Expensive?</h3>
<p>Databricks gets expensive when the compute does not match the workload. The bill has two halves, DBUs from Databricks and infrastructure from your cloud provider. Idle interactive clusters, scheduled jobs on all-purpose compute and oversized clusters raise both halves. Databricks says job compute is typically 2 to 3x cheaper than all-purpose compute. For six settings that change the bill, read <a href="/blog/beyond-the-databricks-cost-calculator-6-levers-that-actually-cut-your-bill">6 levers that cut your Databricks bill</a>.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/understanding-databricks-compute-costs/99cb0dd4-1cf6-4536-81c5-ce9954e222f8.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Power User for dbt Can Now Tell You Why Your Model Is Slow</title>
    <link>https://altimate.ai/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow</link>
    <guid isPermaLink="true">https://altimate.ai/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow</guid>
    <pubDate>Sun, 02 Aug 2026 20:18:00 GMT</pubDate>
    <dc:creator>Anand Gupta</dc:creator>
    <dc:creator>Hoshang Mehta</dc:creator>
    <category>dbt</category>
    <category>SQL</category>
    <category>sql optimize</category>
    <category>altimateAI</category>
    <description>The queries that cost you money usually aren&apos;t the ones anyone complains about. A dbt model ships to prod looking fine, then scans ten times the data it needs on every scheduled run for the next six m</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/6a81073d-4498-42f5-b716-cc99edaf592c.jpg" alt="Power User for dbt Can Now Tell You Why Your Model Is Slow" /></p>
<p>The queries that cost you money usually aren't the ones anyone complains about. A dbt model ships to prod looking fine, then scans ten times the data it needs on every scheduled run for the next six months… Nobody notices, because nothing is broken. It's just quietly expensive.</p>
<p>The ones people <em>do</em> notice are bad enough: a model that used to build in two minutes now takes twenty. If someone asks why, nobody really knows.</p>
<p>But the information needed to spot these issues and answer the questions does exist: your warehouse produces it every time it runs a query. The problem is that almost nobody reads that output, because it was never written for humans.</p>
<p>That changes with the new <a href="https://help.altimate.ai/dbt-power-user/test/queryResults/"><strong>Profile this query</strong> feature in Power User for dbt</a>. One click sends your query to Altimate Code, which runs the warehouse's own diagnostics, reads the output, and tells you in plain language what the query is actually doing and where it's going wrong.</p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/583dc698-7ae5-4a6c-a078-23033553f183.png" alt="Altimate Code, the agentic data engineering harness, powers many advanced features of Power User for dbt" style="display:block;margin:0 auto" />

<h2>Why slow SQL is so hard to debug</h2>
<p>In a cloud warehouse, SQL is a <em>request</em>, not a set of instructions. You describe the result you want. The warehouse decides how to get it.</p>
<p>That decision-making is invisible. Two queries that look almost identical can behave completely differently. One might read a few thousand rows. The other might scan an entire ten-billion-row table because a filter was written in a way the warehouse couldn't use.</p>
<p>You can't see this by reading the SQL. The SQL describes <em>what</em>, not <em>how</em>. And in modern cloud warehouses, <em>how</em> is exactly where the time and money go. Compute is billed by usage. A query that scans more data than it needs isn't just slow. It's expensive, every single time it runs.</p>
<p>Most dbt users respond to slow queries the only way they can: by guessing. Rewrite a CTE. Add a filter earlier. Try an incremental model. Sometimes it helps. Often it doesn't, because the guess didn't match the actual problem.</p>
<h2>What an execution plan actually tells you</h2>
<p>If you know how to ask, warehouses will tell you exactly how they run a query. Ask with a command like <code>EXPLAIN</code>, and you get back an <strong>execution plan</strong>: the warehouse's step-by-step strategy. Which tables it reads. How much data it expects to scan. How it joins tables together. Where it filters. What each step is estimated to cost.</p>
<p>Some databases go further. <code>EXPLAIN ANALYZE</code> (in Postgres, for example) actually runs the query and reports real numbers: how long each step took, how many rows actually flowed through, whether the work fit in memory.</p>
<p>This is the "ground truth" of query performance. If your query is slow, the reason is in the execution plan.</p>
<p>So why does nobody read them? Three reasons.</p>
<ol>
<li><p><strong>They're dense.</strong> A plan for a moderately complex query can run to hundreds of lines of nested operators, cost units, and internal jargon.</p>
</li>
<li><p><strong>They're inconsistent.</strong> Snowflake, BigQuery, Postgres, and Databricks each format plans differently, use different terminology, and even use different commands to produce them.</p>
</li>
<li><p><strong>They assume expertise.</strong> Reading a plan well means knowing what a <em>hash join</em> is, why "estimated rows: 100, actual rows: 4,000,000" is alarming, and which operators are red flags. That's a database performance skill set, not an analytics engineering one.</p>
</li>
</ol>
<blockquote>
<p><strong>Warehouse execution plans</strong> are like an X-ray of your query: Incredibly informative… if you happen to be a radiologist.</p>
</blockquote>
<h2>What Altimate Code does differently</h2>
<p><a href="https://github.com/AltimateAI/altimate-code/">Altimate Code</a> is an open-source AI coding agent built for data work, with a live connection to your warehouse. That last part is the key. It doesn't just look at your SQL. It can run the diagnostic commands your warehouse supports, get the real plan back, and interpret it.</p>
<p>In other words: it reads the X-ray for you.</p>
<p>Because it knows the differences between warehouse dialects, the same button works whether you're on Snowflake, BigQuery, Postgres, or something else. You don't need to remember which explain command your warehouse uses or what its plan format looks like. (The exact diagnostics available do vary by warehouse. Some expose richer runtime detail than others, so the depth of the profile depends on what your database can report.)</p>
<h2>The dbt profile query workflow</h2>
<p>The whole thing takes one click.</p>
<p>Step 1: <strong>Run a query</strong> in Power User for dbt, as you normally would.</p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/50c2ffaa-e5ef-49d4-8cbb-079538aeda83.png" alt="Screenshot of the Power User for dbt UI showing the &quot;Run a query&quot; feature." style="display:block;margin:0 auto" />

<p>Step 2: When results load, click "<strong>Profile Query"</strong> in the query results panel toolbar.</p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/4f99e508-1c7b-4b1f-add8-d1435bfc5b0e.png" alt="Screenshot of the Power User for dbt UI showing  where to click &quot;Profile Query&quot; in the query results panel toolbar" style="display:block;margin:0 auto" />

<p>Step 3: <strong>Altimate Code chat opens</strong> with your SQL and a profiling prompt already in place.</p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/ed2662ad-4ee8-4eeb-8cf4-f6da8f574832.png" alt="Screenshot of the Power User for dbt UI: Altimate Code chat opens with your SQL and a profiling prompt already in place" style="display:block;margin:0 auto" />

<p>Step 4: The agent runs or interprets the relevant warehouse diagnostics — the execution plan, and runtime statistics where available.</p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/01ffe52d-6866-4b50-b6b8-a4a50ced44fb.png" alt="Screenshot of the Power User for dbt UI showing Step 4: Altimate Code runs and interprets the warehouse's execution plan and runtime statistics" style="display:block;margin:0 auto" />

<p>Step 5: You get back <strong>plain-language findings</strong>: what the query is doing, where the time and cost are going, and what to try next.</p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/e3a1d2aa-2672-43d5-b622-c72010af7d50.png" alt="Screenshot of the Power User for dbt UI showing Step 5: Plain-language findings on what the query is doing, where the time and cost are going, and what to try next" style="display:block;margin:0 auto" />

<p>There's also "<strong>Explain with Altimate Code"</strong> in the SQL tab, which does something related but different. More on that distinction below.</p>
<h2>What dbt Query Profiler can actually find</h2>
<p>Here are the kinds of problems that hide in execution plans, and what a profile might surface. These examples are deliberately simple; real findings depend on your data and your warehouse.</p>
<h3>The full table scan</h3>
<pre><code class="language-sql">select
    order_id,
    customer_id,
    order_total
from analytics.fct_orders
where date(created_at) = '2026-08-03'
</code></pre>
<p>This looks fine. It filters to a single day. But wrapping <code>created_at</code> in <code>date()</code> can prevent the warehouse from using <strong>pruning</strong> — its ability to skip chunks of data that can't possibly match the filter. Instead of reading one day's worth of data, it may read the whole table and check every row.</p>
<p>A profile of this query might surface something like:</p>
<blockquote>
<p><em>the plan shows a scan of the full table rather than a pruned range; the</em> <code>date()</code> <em>function on the filter column is likely preventing partition pruning; rewriting the filter as a range on the raw column should let the warehouse skip most of the data:</em></p>
</blockquote>
<pre><code class="language-sql">where created_at &gt;= '2026-07-20'
  and created_at &lt;  '2026-07-21'
</code></pre>
<p>Same result. Potentially a small fraction of the data scanned.</p>
<h3>The join that explodes</h3>
<pre><code class="language-sql">select
    c.customer_id,
    count(*) as event_count
from dim_customers c
join fct_events e
    on c.customer_id = e.customer_id
where e.event_date &gt;= '2026-07-01'
group by 1
</code></pre>
<p>Suppose <code>fct_events</code> is huge, and the plan shows the join producing 200 million intermediate rows before the date filter is applied. That's a <strong>filter applied too late</strong>: the warehouse did an enormous amount of join work, then threw most of it away.</p>
<p>A profile might point out that the row count balloons at the join step, and suggest filtering the events table first (for instance, in a CTE) so the join only touches July's events. The output is identical; the work is not.</p>
<h3>The dbt row estimate that's wildly wrong</h3>
<p>Warehouses plan queries using <strong>row estimates</strong>: guesses about how many rows each step will produce, based on statistics about your data. When those guesses are badly wrong (i.e.: the plan expected just 100 rows and got 4 million) the warehouse may have picked a join strategy or memory allocation that made sense for 100 rows and falls over at 4 million.</p>
<p>This is one of the most common causes of "this query is sometimes fine and sometimes terrible," and it's essentially invisible without looking at a plan. A profile can flag the mismatch and point at the step where the plan's assumptions diverged from reality, which is often the first real clue to stale statistics or a skewed join key.</p>
<h3>The expensive aggregation</h3>
<p>A <code>count(distinct user_id)</code> over a billion rows, or a <code>group by</code> on a high-cardinality column, can dominate a query's runtime, sometimes spilling work to disk when it doesn't fit in memory. The plan shows this. A profile can identify that the aggregation step is where the time goes and suggest alternatives worth testing, like pre-aggregating in an upstream model or, where approximate results are acceptable, an approximate distinct count.</p>
<h2>Explain vs. Profile: what's the difference?</h2>
<p>Power User for dbt now gives you two related (but different) tools:</p>
<p><strong>Explain this query</strong> answers: <em>what does this SQL do?</em> It reads the query and describes the logic: the joins, the filters, the transformations. It's great for understanding unfamiliar code, reviewing a teammate's model, or onboarding onto a project. It doesn't need to touch your data.</p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/308220e3-186f-4690-915d-2629a42772b0.png" alt="Screenshot of the Power User for dbt UI showing &quot;Explain with Altimate Code&quot; describes the query's logic without touching the warehouse" style="display:block;margin:0 auto" />

<p><em>"Explain with Altimate Code" describes the query's logic without touching the warehouse</em></p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/9d15caab-9f74-4d75-9c43-479a15884144.png" alt="Screenshot of the Power User for dbt UI showing the &quot;Explain&quot; panel, breaking down joins, filters, and transformations" style="display:block;margin:0 auto" />

<p>The Explain panel breaking down joins, filters, and transformations</p>
<p><strong>Profile this query</strong> answers: <em>how does this query perform against my actual warehouse?</em> It's grounded in diagnostic output from the database: the execution plan, real or estimated row counts, the actual strategy the warehouse chose. It can tell you things no amount of reading the SQL can, because the answer depends on your data: its size, its distribution, how it's clustered or partitioned.</p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/fca9f2fd-3be0-4ec1-a242-38459d60a360.png" alt="&quot;Profile this query&quot; is grounded in the warehouse's actual execution plan" style="display:block;margin:0 auto" />

<p>"Profile this query" is grounded in the warehouse's actual execution plan</p>
<img src="/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/438dbccf-5f4f-46df-9f01-b6d1a9eaa75d.png" alt="Screenshot of the Power User for dbt UI showing the Profile panel surfacing real row counts and cost data from the warehouse" style="display:block;margin:0 auto" />

<p>The Profile panel surfacing real row counts and cost data from the warehouse</p>
<p>This is also what separates Power User profiling from pasting your SQL into a general-purpose chatbot. A chatbot can only reason about the text of your query. It doesn't know that your events table is 3TB, that your filter isn't hitting the partition column, or that the optimizer's row estimate was off by four orders of magnitude. Those facts live in your warehouse, and profiling is what brings them into the conversation.</p>
<h2>What health query profiling means in practice</h2>
<p><strong>Cost.</strong> In cloud warehouses, wasted scans are wasted money, compounded by every scheduled run. A model that scans ten times the data it needs isn't a one-time problem — it's a recurring line item. Profiling makes that waste visible while the query is still in front of you.</p>
<p><strong>Speed.</strong> Faster queries mean faster dbt builds, faster CI, faster dashboards. The fixes that profiling points toward — earlier filters, prunable predicates, leaner joins — tend to be small edits with large effects.</p>
<p><strong>Team productivity.</strong> Perhaps the biggest shift is who can do this work. Today, deep query tuning tends to bottleneck on whoever on the team can read plans. Profiling puts a first-pass diagnosis in every analytics engineer's hands. Instead of "this is slow, can someone look at it," the starting point becomes "the profile says the join is exploding before the filter — I'm going to try restructuring it."</p>
<p>One note on positioning: profiling doesn't guarantee a faster query, and it doesn't rewrite your models for you. What it does is close the gap between <em>"this query is slow"</em> and <em>"here is what is likely causing it, and what to try next."</em> It's still a judgment call when it comes to what to change (and whether the tradeoff is right for your model).</p>
<h2>Try dbt query profiler today</h2>
<p>Query Profiler is live in Power User for dbt today. <a href="https://help.altimate.ai/dbt-power-user/test/queryResults/">You will find the docs here</a>. You can access the feature as follows:</p>
<ul>
<li><p><strong>Profile this query</strong>: in the query results panel toolbar, visible once query results are loaded. Run a query, then click it.</p>
</li>
<li><p><strong>Explain with Altimate Code</strong>: in the SQL tab, for when you want to understand what a query does rather than how it performs.</p>
</li>
</ul>
<p>Both open Altimate Code chat with the context already loaded, so you can keep asking follow-up questions: "<em>why is this step expensive?", "What would happen if I filtered earlier?", "Show me the rewritten version."</em></p>
<p>If you're already running Power User for dbt, <strong>update to the latest version</strong> and try it on the slowest model in your project. You may find the answer has been sitting in your warehouse all along, just waiting for someone to read it.</p>
<hr />
<p><a href="https://altimate.ai/products/dbt-power-user"><em>Altimate Code and Power User for dbt (available on VS Code)</em></a> <em>is open source. Have feedback on profiling? We're actively improving dialect coverage and would love to hear what you find.</em></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/power-user-for-dbt-can-now-tell-you-why-your-model-is-slow/6a81073d-4498-42f5-b716-cc99edaf592c.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Autonomous Agents for Snowflake Cost Optimization: Announcing Altimate Lite</title>
    <link>https://altimate.ai/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization</link>
    <guid isPermaLink="true">https://altimate.ai/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization</guid>
    <pubDate>Tue, 28 Jul 2026 15:28:02 GMT</pubDate>
    <dc:creator>Fraser Marlow</dc:creator>
    <category>snowflake</category>
    <category>Snowflake performance</category>
    <category>AI costs</category>
    <category>AI</category>
    <category>altimateAI</category>
    <description>TL;DR: it saves you money on Snowflake
Altimate Lite is a Snowflake native app that automatically tunes warehouse configuration (auto-suspend, scaling, clustering) roughly every 5-6 seconds to cut com</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization/5b60cea4-c56d-4ec0-9b16-038247be852b.jpg" alt="Autonomous Agents for Snowflake Cost Optimization: Announcing Altimate Lite" /></p>
<h2><strong>TL;DR: it saves you money on Snowflake</strong></h2>
<p><a href="https://app.snowflake.com/marketplace/listing/GZTYZ1VSPRPWK/altimate-ai-altimate-lite-for-ai-and-warehouse-cost-optimization">Altimate Lite is a Snowflake native app</a> that automatically tunes warehouse configuration (auto-suspend, scaling, clustering) roughly every 5-6 seconds to cut compute costs, with no performance impact. Private preview customers saved an average of 19% on warehouse costs, with some seeing savings as high as 57.5%.</p>
<p>As a Snowflake native app, it’s easy to adopt, secure, and can be paid with Snowflake credits. It's free for 21-days, then just $100/month plus 2.5% of the daily cost of any warehouse you activate it on.</p>
<p><a href="https://app.snowflake.com/marketplace/listing/GZTYZ1VSPRPWK/altimate-ai-altimate-lite-for-ai-and-warehouse-cost-optimization">Find it in the Snowflake Marketplace</a> today.</p>
<h2>Watch the Launch video</h2>
<div class="blog-embed"><iframe src="https://www.youtube.com/embed/pPDlkjMCSJY" title="YouTube video player" loading="lazy" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>

<h2>How AI costs get out of hand on Snowflake</h2>
<p>If you think your Snowflake instance is costing more than it should, you are not alone. There are several factors that drive this:</p>
<p>First, a common pattern keeps showing up across Snowflake teams that adopt AI: everything starts to look like an AI problem. Teams transition away from cheap deterministic tooling and start to adopt inference-based solutions across the board. This gets expensive.</p>
<p>Then there is the "Maximilian Fable" persona: always reaching for the newest, most expensive reasoning model. Tasks that a lightweight model like Anthropic’s Haiku would handle just fine often get clobbered with one of the most expensive models like Fable.</p>
<p>Snowflake offers some tooling for tuning your instance, but the process is manual and the audits too far apart to get good results. Snowflake users overspend as a result.</p>
<p>Finally there's cost visibility. Most teams just get a bill at the end of the month, a token count with no breakdown of what drove it. It’s a single total, no itemization, and no way to explain to finOps why this week's number is double last week's.</p>
<p>These costs really add up. There's now a well-known case of a company running up a <a href="https://finance.yahoo.com/sectors/technology/articles/company-blew-500m-claude-ai-173519468.html">$500 million AI bill</a> in a single month because no check was in place and nobody saw it coming.</p>
<p>The fix starts with tracking and visibility: who's consuming AI credits, whether usage is concentrated in a handful of users, and which models and services are actually driving spend.</p>
<h2>Continuous Auto-Tuning: The Other Lever for Cutting Snowflake Warehouse Costs</h2>
<p>Cost isn't just an AI-model problem. It's also a Snowflake warehouse configuration problem.</p>
<p>Snowflake exposes a handful of levers: warehouse size, warehouse type (Gen 1, Gen 2, adaptive), auto-suspend timing, multi-cluster scaling, and max concurrency level. Getting these right, and keeping them right as workloads shift, is normally a manual, periodic exercise: someone looks at usage patterns, makes a best guess, and revisits it weekly or monthly.</p>
<p>What if software made these decisions <em>continuously</em> instead? Not daily reconfiguration but adjusting configuration <strong>every five to six seconds</strong>, a frequency no human team could sustain.</p>
<img src="/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization/ee6e31b3-925b-446e-a1b0-829e6d2604ee.png" alt="An Agent Decisions chart showing the daily number of auto-tune configuration changes made over a one-month period." style="display:block;margin:0 auto" />

<p>By comparison, Snowflake's own auto-suspend only probes warehouse activity every 30 seconds; in that same window, Altimate's auto-tune has already run roughly ten checks, looking at idle state, workload shifts, and predicted upcoming load.</p>
<h2>Real World Results: Up to 57.5% in Snowflake Warehouse Savings</h2>
<p>Over the last couple of months during private preview, real Altimate Lite customers saw meaningful savings simply by turning on auto-tune, with no degradation in query performance or queue times:</p>
<ul>
<li><p>Lowest savings observed on any warehouse, any day: <strong>12.4%</strong></p>
</li>
<li><p>Average savings across all customers, warehouses, and days: <strong>19%</strong></p>
</li>
<li><p>Highest single-day savings (typically weekends, when workloads are less consistent): <strong>57.5%</strong></p>
</li>
</ul>
<h2>Inside Altimate Lite: Cost Dashboard, Auto-Tune, and AI Cost Observability</h2>
<p>Altimate Lite is a distilled version of <a href="https://altimate.ai/platform">Altimate's enterprise platform</a> that runs natively on Snowflake. Is was trained on billions of config changes from years of production use. Because it runs entirely inside your Snowflake environment, no data leaves your account, which sidesteps the InfoSec review that a SaaS tool would typically require.</p>
<p><a href="https://www.youtube.com/watch?v=pPDlkjMCSJY">In the demo</a>, Pradnesh walked through the core screens:</p>
<ul>
<li><strong>Cost dashboard</strong>: trending costs, potential annual savings, and how many warehouses are auto-tune eligible vs. already enabled.</li>
</ul>
<img src="/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization/6dcc9713-eb51-4a80-9dae-3f2330d2089c.png" alt="Altimate Lite warehouse detail page for a dbt pipeline warehouse showing Auto Tune enabled, realized savings of $351, and projected annual savings of $4,269." style="display:block;margin:0 auto" />

<ul>
<li><strong>Per-warehouse view</strong>: estimated 30-day cost, potential (or realized) savings, and a one-click toggle to turn auto-tune on or off.</li>
</ul>
<img src="/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization/462f2e2d-2b04-412c-8f48-2f111b7abce3.png" alt="Altimate Lite warehouses dashboard showing 30-day total cost, potential annual savings, auto-tune eligible and enabled warehouse counts, and a daily spend and savings chart." style="display:block;margin:0 auto" />

<ul>
<li><strong>Decision history</strong>: a full audit trail of every action taken (cluster suspensions, resize decisions) timestamped and exportable as CSV. On a single warehouse, the system logged 118 tuning decisions in one day.</li>
</ul>
<img src="/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization/57a5cae5-168c-43cb-9eba-27e007fb1b6d.png" alt="Agent Decisions chart and Auto Tune history log showing a timestamped list of warehouse suspend actions." style="display:block;margin:0 auto" />

<ul>
<li><strong>AI cost observability</strong>: a separate view tracking spend, token usage, and adoption across roughly eight AI services (AI SQL functions, Cortex, Code CLI tools, and more), filterable by service, user, and model, with CSV export for further analysis.</li>
</ul>
<img src="/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization/5d73219d-b7b2-4f00-a28d-8c777b1d8694.png" alt="Daily AI cost chart in Altimate Lite, stacked by Cortex service, showing spend trends over a one-month period." style="display:block;margin:0 auto" />

<p><em>Daily AI cost chart showing spend trends over a one-month period.</em></p>
<img src="/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization/e9db06b8-ab15-498c-a032-e58b365353bb.png" alt="Altimate Lite per-user AI usage detail page showing cost, tokens, queries, and daily spend for a single Snowflake user." style="display:block;margin:0 auto" />

<p><em>Per-user AI usage showing cost, tokens, queries, and daily spend for a single Snowflake user.</em></p>
<h2>Altimate Lite Pricing: Free 21-Day Trial, Then $100/Month</h2>
<p>Altimate made a deliberate choice to keep pricing transparent and self-serve. No sales call required:</p>
<ul>
<li><p><strong>21-day free trial</strong>, no cost.</p>
</li>
<li><p><strong>$100/month</strong> flat fee after the trial.</p>
</li>
<li><p><strong>2.5% of daily warehouse cost (after savings)</strong> for each warehouse you activate auto-tune on. You only pay for the warehouses you turn on, regardless of how many others exist in your account.</p>
</li>
</ul>
<p>The recommended path: turn it on for one or two warehouses, watch the savings and audit history for a bit, and expand from there once you're comfortable.</p>
<img src="/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization/6f943f3d-c722-4bf1-9ff0-a9debc753c38.jpg" alt="Find Altimate Lite on the Snowflake Marketplace." style="display:block;margin:0 auto" />

<h2>Altimate Lite vs. Enterprise: What's the Difference?</h2>
<p>Altimate Lite covers auto-tune and AI cost visibility. <a href="https://altimate.ai/platform">The Enterprise edition</a>, which has been running in production for customers processing billions of queries, adds:</p>
<ul>
<li><p><strong>Auto-resize</strong>: automatic warehouse right-sizing as workloads shift.</p>
</li>
<li><p><a href="https://altimate.ai/platform#studio">Altimate</a> <strong>AI Studio</strong>: a collaborative agent workspace for deeper savings analysis, scheduled reporting, and team-based showback/chargeback with SSO integration.</p>
</li>
<li><p><strong>Assisted optimization</strong>: guided recommendations for improving query code, table and storage configuration, and dbt models, safely assignable to teams.</p>
</li>
<li><p><strong>Altimate Code</strong>: <a href="https://github.com/AltimateAI/altimate-code/">an open-source CLI and VS Code extension</a> that catches costly SQL and dbt mistakes during development.</p>
</li>
</ul>
<p>On data handling: Enterprise is a hosted SaaS product that analyzes query history and telemetry (not your underlying business data) to power these features. The Altimate platform is SOC 2 compliant and has been through security review with financial services and healthcare customers, including in Europe.</p>
<h2>Altimate Lite: Key Questions Summary:</h2>
<p><strong>Is Altimate Lite free to try?</strong><br />Yes. Altimate Lite includes a 21-day free trial with no cost. After that, it's $100/month plus 2.5% of the daily cost of any warehouse where you've enabled auto-tune.</p>
<p><strong>Does my data leave my Snowflake account?</strong><br />No. Altimate Lite runs entirely inside your Snowflake environment as a native app, a walled garden, and none of your data ever leaves your account.</p>
<p><strong>How much can I save?</strong><br />Private preview customers saved an average of 19% on warehouse costs, with a low of 12.4% and weekend peaks as high as 57.5%, with no measurable impact on query performance.</p>
<p><strong>How is this different from Snowflake's built-in auto-suspend?</strong><br />Snowflake's auto-suspend checks warehouse activity every 30 seconds. Altimate's auto-tune runs roughly ten checks in that same window and adjusts configuration every five to six seconds based on predicted workload.</p>
<p><strong>How to Get Started with Altimate Lite's Free Trial</strong><br />Altimate Lite is live now on the Snowflake Marketplace. Start your 21-day free trial today. If you want to talk through auto-resize, Enterprise features, or just how to think about AI cost management more broadly, reach out to the Altimate team, no obligations, no high-pressure sales.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/altimate-lite-autonomous-agents-for-snowflake-cost-optimization/5b60cea4-c56d-4ec0-9b16-038247be852b.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>What AI Agents Are Really Changing in Data Engineering</title>
    <link>https://altimate.ai/blog/what-ai-agents-are-really-changing-in-data-engineering</link>
    <guid isPermaLink="true">https://altimate.ai/blog/what-ai-agents-are-really-changing-in-data-engineering</guid>
    <pubDate>Wed, 22 Jul 2026 13:00:00 GMT</pubDate>
    <dc:creator>Fraser Marlow</dc:creator>
    <category>AI</category>
    <category>data-engineering</category>
    <description>Now that job candidates write their resumes and rehearse their interview answers with AI, every application reads the same. &quot;Now every resume is perfect,&quot; Pradnesh Patil said on DataCamp&apos;s &quot;The New Da</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/what-ai-agents-are-really-changing-in-data-engineering/the-new-data-engineering-team.jpg" alt="What AI Agents Are Really Changing in Data Engineering" /></p>
<p>Now that job candidates write their resumes and rehearse their interview answers with AI, every application reads the same. "Now every resume is perfect," Pradnesh Patil said on DataCamp's "<a href="https://www.datacamp.com/resources/webinars/the-new-data-engineering-team">The New Data Engineering Team</a>" panel, part of its Data Science and Engineering Week.</p>
<p>Patil, co-founder and CEO of Altimate AI, joined host Richie Cotton alongside <a href="https://www.linkedin.com/in/nehatharani/">Neha Tharani</a>, data foundation lead at the reinsurer SCOR, and <a href="https://www.linkedin.com/in/lisa-mirkovic/">Lisa Mirkovic</a>, a data and AI strategy adviser who previously ran data engineering at Capital Group. Generative AI changed how data engineers work, and it also broke the funnels companies use to hire them. The panel covered what AI agents for data engineering change in hiring, output validation, documentation and governance.</p>
<p><a href="https://www.datacamp.com/resources/webinars/the-new-data-engineering-team">Catch the full episode here.</a></p>
<h2>Hiring when the resume stopped carrying signal</h2>
<p>Resumes are not the only signal AI degraded. Video interviews are straightforward to game with live prompting tools, which leaves conversation as a weak test of anything. Altimate AI rebuilt its process around work instead: exercises capped at sixty to ninety minutes, followed by a short discussion. Candidates are told the rules upfront, in Patil's words, "you can use as much AI as you want."</p>
<p>The exercise measures what someone builds with AI available, not whether they can work without it. Patil noted that startups across the San Francisco Bay Area are changing how they interview for the same reason. Skills assessments built around real tasks are displacing credential and resume screening.</p>
<h2>Validate agent output with a data diff, not a second model</h2>
<p>Large language models are probabilistic, so the validation layer around their output is the thing you actually build. Patil's example was SQL. When an agent rewrites or optimizes a query, the test is whether it returns the same data as the original: "is it producing the same data with a new query?" You do not need a second model to check that, only a data diff tool that compares the two result sets directly.</p>
<p>The pattern generalizes to anywhere an agent touches a pipeline, a transformation, or a query. Each of those places needs a lightweight deterministic check attached to it rather than an assumption of correctness.</p>
<h2>AI documents move the cost to the reviewer</h2>
<p>AI also created a collaboration cost that is easy to miss. A teammate generates a six-page document in five minutes, then expects a colleague to spend forty-five minutes reading it. Patil's rule is to edit AI output down before passing it on, because the models are built to overproduce. As he put it, "all these LLM models are text hungry. If you ask it to do something instead of writing five lines, it's going to write five pages."</p>
<h2>Governance became a daily job</h2>
<p>Governance is where the new risks concentrate, and Patil pointed to public incidents rather than hypotheticals: an agent that ran a query costing more than five thousand dollars, and production databases dropped at larger companies. "If you let it scale without guardrail, it's going to do crazy things," he said. A per-tool setting does not contain that, because an agent moves across tools and the guardrail has to move with it. Altimate AI open-sourced a rules-and-permissions framework, Altimate Core, under an MIT license as one starting point.</p>
<h2>Where agents already pay off</h2>
<p>Fenced in properly, agents produce measurable wins. Patil described a Fortune 500 company that built agents to manage its data infrastructure, resizing instances and adjusting configuration automatically as workloads shifted. Utilization climbed and the bill fell by 30 to 40 percent. The reason is bandwidth: "as humans, we can't change infrastructure configurations, thousand times a day, but a machine can."</p>
<p>For platform teams deciding where to deploy agentic automation first, infrastructure tuning is the low-risk, high-return place to start.</p>
<h2>Getting knowledge out of people's heads</h2>
<p>Mirkovic described where a team's working knowledge actually lives, "hidden in Wikis and Slack channels and in a senior developer who is there twenty seven years, and only that person knows quirks that are not even in a GitHub repo."</p>
<p>Patil sees teams democratizing that knowledge so business users self-serve the simple questions and bring back only the hardest 20 percent. That is the direction both agreed on: less work done by hand, more work made repeatable for AI and for everyone else.</p>
<p>Teams building 2026 roadmaps can use that split as the test for where agents belong in the stack and where human judgment still has to lead. If the governance layer is the gap, start from Altimate Core instead of writing your own rules engine.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/what-ai-agents-are-really-changing-in-data-engineering/the-new-data-engineering-team.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Why AI Agents Break in Production: The Missing Harness in Your Data Stack</title>
    <link>https://altimate.ai/blog/why-ai-agents-break-in-production-the-missing-harness-in-your-data-stack</link>
    <guid isPermaLink="true">https://altimate.ai/blog/why-ai-agents-break-in-production-the-missing-harness-in-your-data-stack</guid>
    <pubDate>Wed, 15 Jul 2026 18:50:14 GMT</pubDate>
    <dc:creator>Pradnesh Patil</dc:creator>
    <category>Data Science</category>
    <category>data-engineering</category>
    <category>AI</category>
    <description>Listen to the full conversation on DataScienceWithSam, available on Apple Podcasts and Spotify.
Most data teams have lived some version of this same story: an AI agent runs a query, the query returns</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/why-ai-agents-break-in-production-the-missing-harness-in-your-data-stack/80136cc1-556c-41ad-8d5b-a914072837a2.jpg" alt="Why AI Agents Break in Production: The Missing Harness in Your Data Stack" /></p>
<p><em>Listen to the full conversation on DataScienceWithSam, available on</em> <a href="https://podcasts.apple.com/us/podcast/ep-45-why-ai-agents-break-in-production-the-missing/id1587954336?i=1000776852944"><em>Apple Podcasts</em></a> <em>and</em> <a href="https://open.spotify.com/episode/0nKtoDZCNpcgD2NOAyFVzO?si=Vzos9X0YTkSeS0bUXoF9Mw&amp;nd=1&amp;dlsi=3d298d39cd99420e"><em>Spotify</em></a>.</p>
<p>Most data teams have lived some version of this same story: an AI agent runs a query, the query returns a result, the number looks reasonable, and the dashboard ships. Weeks later, someone traces a bad decision back to that query and finds a join that never should have executed the way it did. Nobody caught it in the moment because nothing about the failure looked like a failure.</p>
<p>On this episode of DataScienceWithSam, Pradnesh Patil, Co-Founder and CEO of Altimate AI argues that this is not a symptom of weak models. It is the predictable result of asking an agent to act without the infrastructure required to know what is true about the data. The gap is not in what the model can do, it is in what the model has been given to work with.</p>
<h2>AI Agent Harness vs. System Prompt: Why Context Grounding Matters</h2>
<p>A system prompt tells a model what to do. A harness tells it what is actually true. That distinction, Patil says, is the one most teams get wrong when their first AI data agent rollout stalls out or quietly produces bad numbers. Teams write increasingly elaborate instructions into the prompt, hoping better wording will compensate for the model having no grounded view of the schema, the lineage, or the cost of the action it is about to take. It rarely does.</p>
<p>Patil breaks the agentic data engineering harness into five components: context, governance, MCP tools, shared skills, and agent infrastructure. Each one answers a different question an agent needs answered before it acts responsibly. Context tells the agent what the data actually looks like today. Governance tells it what it is allowed to do. Tools give it the concrete means to act. Shared skills capture the institutional knowledge a team has already built up. Agent infrastructure ties all of it together into something that runs reliably at scale.</p>
<p>Miss any single one of those five components, Patil says, and the resulting failures are silent. The query runs, it returns a result, maybe the result looks correct to any human checking... but it is not, and nothing in the interface tells anyone that until the damage has already spread downstream into a report, a model, or a decision.</p>
<p>Between 27% and 33% of AI-generated queries reference tables that do not exist in the schema, phantom references that a grounded agent would never produce in the first place. A further 78% contain what Patil calls "silent wrong joins": joins that execute cleanly, return a syntactically valid result, and still return the wrong data. Neither statistic describes a model that is bad at SQL. Both describe what happens in the absence of infrastructure that keeps a model grounded in the real, current state of the data it is querying.</p>
<h2>Why a Well-Designed Harness Outperforms Larger LLMs (Sonnet vs. Opus Benchmark)</h2>
<p>The instinct when an agent underperforms is to reach for a bigger model. Patil pushes back on that instinct directly, and points to <a href="https://altimate.ai/products/altimate-code">Altimate Code</a>'s performance on ADE-Bench as the clearest evidence against it. Altimate Code topped the leaderboard running on Anthropic's Sonnet, while competing systems relied on Anthropic's Opus, a materially larger and more expensive model, to reach lower scores.</p>
<p>The takeaway is not that a smaller model can outperform a larger one under identical conditions, but that the system surrounding the model, the harness that grounds it in context and governs what it is allowed to do, determines outcomes more than raw model capability does. For data teams evaluating where to invest, that reframes the question. The more valuable investment is often not the next model upgrade. It is the infrastructure that makes any model reliable once it is put to work on real data.</p>
<h2>Deterministic vs. Probabilistic Reasoning in AI Data Agents</h2>
<p>A recurring theme here is the boundary between deterministic and probabilistic reasoning. Validation, cost checks, and query correctness are deterministic problems, Patil argues: they have a right answer that does not depend on interpretation, and they should never be handed to a model to reason about probabilistically. A query either references a table that exists or it does not. A join either matches the keys correctly or it does not. A cost estimate either falls inside budget or it does not. None of that needs a language model's judgment.</p>
<p>Hard rules should handle hard rules, and the model's judgment should be reserved for genuine ambiguity, the calls that actually require weighing context and making a reasoned choice. Building a harness that respects this boundary, rather than routing everything through the model, is what keeps an agent from confidently producing a wrong answer with the same tone of voice it uses for a right one.</p>
<h2>Context Compaction for Long-Running Data Pipelines: Preserving Schema and Lineage</h2>
<p>Standard LLM context compaction was designed for general-purpose chat, where discarding older turns of a conversation carries little cost. Applied to a long-running data engineering task, the same compaction approach tends to discard exactly the schema and lineage context an agent needs to keep working correctly. An agent that loses that context mid-task does not usually stop. It keeps going, with a thinner and thinner grip on what is actually true, until its output drifts from correct to merely plausible.</p>
<p>Altimate's response is a compaction approach built specifically for this kind of task, one that treats schema and lineage as context to be preserved rather than as expendable conversational history. The distinction matters most on the tasks that take the longest: multi-step pipeline builds, large-scale migrations, and anything else where an agent is expected to stay grounded over many turns rather than a handful.</p>
<h2>AI Agent Governance and a $5,000 Cortex AI Bill</h2>
<p>Governance is not an abstract concern here. Patil cites a real $5,000 Cortex AI query bill as the kind of outcome that permission-based governance helps avoid. The bill was not the result of malicious intent or a rare edge case. It was the predictable outcome of an agent operating without limits on what it was allowed to query and at what cost.</p>
<p>Without <a href="https://altimate.ai/use-cases/altimate-for-snowflake"><strong>controls on scope and spend</strong></a>, Patil argues, agents can go rogue on cloud cost just as easily as they can go rogue on correctness, and the two failure modes compound each other. An ungoverned agent that is also ungrounded in the real schema is not just likely to produce a wrong answer. It is likely to produce a wrong and expensive answer, executed against the wrong tables, at a cost nobody approved in advance.</p>
<h2>The Future of Data Engineering: From Hand-Written SQL to Agent Governance</h2>
<p>Patil's broader claim is that the era of hand-writing SQL is ending. The role is shifting toward building and governing the systems that let agents do that work reliably: defining the context that grounds them, the governance that constrains them, and the shared skills that let institutional knowledge outlive any one person's tenure on a team.</p>
<p>His advice reflects that same emphasis on infrastructure over individual features: Build open source, build cross-platform, so that the tools work across Snowflake, Databricks, and every other environment your data estate actually spans. Avoid siloed AI features that solve a narrow problem for one vendor's users without moving the broader field forward. For Patil, the teams that internalize this shift early, and start investing in the harness rather than the next model swap, are the ones that will find AI agents genuinely trustworthy in production, rather than merely fast and occasionally, silently, wrong.</p>
<h2>Frequently Asked Questions</h2>
<h3>How Do I Know an AI Agent Did What It Says It Did?</h3>
<p>Check its output with deterministic rules before the result reaches a dashboard. A query either references tables that exist or it does not. A join either matches the keys correctly or it does not. A cost estimate either falls inside budget or it does not. Patil argues that none of these checks needs a language model’s judgment.</p>
<p><em>Listen to the full conversation on DataScienceWithSam, available on</em> <a href="https://podcasts.apple.com/us/podcast/ep-45-why-ai-agents-break-in-production-the-missing/id1587954336?i=1000776852944"><em>Apple Podcasts</em></a> <em>and</em> <a href="https://open.spotify.com/episode/0nKtoDZCNpcgD2NOAyFVzO?si=Vzos9X0YTkSeS0bUXoF9Mw&amp;nd=1&amp;dlsi=3d298d39cd99420e"><em>Spotify</em></a>.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/why-ai-agents-break-in-production-the-missing-harness-in-your-data-stack/80136cc1-556c-41ad-8d5b-a914072837a2.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>4 Blind Spots of General Coding Agents in Data Engineering</title>
    <link>https://altimate.ai/blog/4-blind-spots-of-general-coding-agents-in-data-engineering</link>
    <guid isPermaLink="true">https://altimate.ai/blog/4-blind-spots-of-general-coding-agents-in-data-engineering</guid>
    <pubDate>Mon, 06 Jul 2026 22:35:27 GMT</pubDate>
    <dc:creator>Syed Haider</dc:creator>
    <category>data-engineering</category>
    <category>AI</category>
    <category>llm</category>
    <category>ai agents</category>
    <category>SQL</category>
    <description>A coding agent enters the data warehouse
A data engineer drops a one-liner into Claude Code: &quot;Add patient_visit_count to dim_patient.&quot; Twenty seconds later, Claude has read the project, scanned source</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/cb2766a9-9af9-4ce0-9fea-1c78181cc938.jpg" alt="4 Blind Spots of General Coding Agents in Data Engineering" /></p>
<h2><strong>A coding agent enters the data warehouse</strong></h2>
<p>A data engineer drops a one-liner into Claude Code: <em>"Add</em> <code>patient_visit_count</code> <em>to</em> <code>dim_patient</code><em>."</em> Twenty seconds later, Claude has read the project, scanned <code>sources.yml</code>, and written plausible-looking SQL. <code>dbt compile</code> is happy. The PR merges Friday evening.</p>
<p>At 2 AM Saturday, the scheduled job fires. The model references <code>PATIENT_ID</code>, but the actual warehouse column is <code>SUBJECT_ID</code>. The run fails in production.</p>
<p>Nothing about the SQL looked obviously wrong. Claude inferred the schema from surrounding code and naming patterns instead of verifying it against the actual warehouse.</p>
<p>Claude Code can write a dbt model. What it can't do, by itself, is run that SQL against your warehouse before you ship it.</p>
<p>This is one instance of a broader pattern. General coding agents like Claude, Cursor, and Copilot are designed for software where the source code <em>is</em> the truth. Data engineering inverts that: the <em>warehouse</em> is the truth, dbt YAML is its description, the agent's SQL is a guess. When the warehouse and the code disagree, only the warehouse is right, and the agent has no way to ask.</p>
<img src="/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/046ef1d7-41df-4e4b-9f6b-a1ad127fab6b.svg" alt="A single trace of a coding agent writing a dbt model. The agent reads the project, infers column names from sources.yml, writes plausible SQL, dbt compile passes, the PR merges. Hours later in production: column does not exist, scheduled job fails, pager fires at 2 AM." style="display:block;margin:0 auto" />

<p>This isn't a hypothetical. In our first experiment, bare Claude shipped a dbt model with <strong>two hallucinated column names</strong> that looked right based on the surrounding code but didn't exist in the actual Snowflake table. <code>dbt compile</code> passed. The model would have failed on first real run.</p>
<p>The altimate-code plugin catches this because Claude calls it before generating, and it actually queries the warehouse for the real columns.</p>
<blockquote>
<p>The altimate plugin gives Claude warehouse hands: schema introspection, cross-warehouse execution, dbt-idiomatic defaults. That's what turns a code generator into something that finishes the task.</p>
</blockquote>
<p>We ran three categorically different experiments to find out where this matters and where it doesn't. The answer is more interesting than "always" or "never.", and reveals four common blind spots when deploying coding agents on data engineering tasks.</p>
<hr />
<h2><strong>The three experiments</strong></h2>
<p>We deliberately picked task shapes that stress different parts of an AI data engineering workflow:</p>
<img src="/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/abcd9081-66dc-4639-9360-1dc55c645e27.svg" alt="Three side-by-side experiment panels. Task 1 Snowflake patient mart: plugin caught hallucinated columns at parity cost. Task 2 MSSQL to Snowflake migration: cross-warehouse the only path that finished. Task 3 Local DuckDB benchmark: passive bias rescued one of five hard failures." style="display:block;margin:0 auto" />

<p>Each task answers a different question about where the plugin actually earns its keep. Taken together, they give you a framework to predict where it'll pay off on <em>your</em> workloads.</p>
<hr />
<h2><strong>Blind spot #1: Schema hallucination on real warehouses</strong></h2>
<p><strong>The task:</strong> A real Snowflake mart-layer refactor of a patient-360 model with HIPAA constraints, and dozens of column-level decisions.</p>
<p><strong>What happened bare:</strong> Claude generated a working-looking model. Two column names were inferred from context, close to right but wrong. <code>dbt compile</code> was happy. Code review by a human would likely have missed them (they looked plausible).</p>
<p><strong>What happened with the plugin:</strong> Claude delegated schema introspection to <a href="https://altimate.ai/products/altimate-code">altimate-code</a>'s <code>altimate-dbt columns</code> tool, which hit Snowflake directly and returned the actual columns. The hallucinated names were caught before generation.</p>
<img src="/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/e2c47f6d-9514-470d-9145-0e9ba811af41.svg" alt="Two side-by-side traces of the same dbt task. Bare Claude infers column names, compile passes, then production breaks. With altimate plugin Claude introspects the warehouse for real columns and ships correct SQL." style="display:block;margin:0 auto" />

<p><strong>The cost was a wash.</strong> Plugin runs landed at near-parity per-token spend. So the correctness win is essentially free for any real-warehouse work.</p>
<blockquote>
<p><em>If your Claude is touching real warehouse models, the (free) plugin pays for itself by not shipping broken column names.</em></p>
</blockquote>
<hr />
<h2>Blind spot #2: Cross-warehouse work the agent can't reach</h2>
<p><strong>The task.</strong> Migrate a customer's project from MSSQL to Snowflake. Validate parity. This requires connecting to <em>both</em> warehouses, reading from one, comparing aggregates to the other.</p>
<p><strong>What happened bare.</strong> Five attempts in a row, Claude crashed on the connectivity layer. No <code>pyodbc</code> driver. No <code>pymssql</code>. No idea how to find MSSQL credentials. <strong>Five runs produced zero working output.</strong></p>
<p><strong>What happened with the plugin.</strong> altimate-code's pre-baked warehouse adapters drove the cross-DB diff end-to-end across four internal sub-sessions, with 9+ real <code>pyodbc.connect()</code> calls and a working parity report at the end.</p>
<p><strong>The honest cost:</strong> ~6× a bare-Claude run. But bare-Claude's run produced <em>nothing</em>. The right comparison isn't dollars-per-attempt, it's <strong>dollars-per-correct-answer</strong>, and bare-Claude's denominator is zero.</p>
<img src="/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/07f49cc0-9dcb-47a8-a3c9-df1dba8557cf.svg" alt="Two bars showing total spend per configuration on the cross-warehouse migration task. Bare Claude spent about $1.10 across 5 attempts producing 0 correct outputs. Altimate plugin spent $6.94 in 1 attempt producing 1 correct output. The cost-per-correct-answer metric flips the apparent picture." style="display:block;margin:0 auto" />

<blockquote>
<p><em>For cross-warehouse migrations, parity work, or source-of-truth reconciliation, the plugin isn't a nice-to-have. It's the only path that finishes.</em></p>
</blockquote>
<hr />
<h2>Blind spot #3: Default SQL patterns aren't dbt-idiomatic</h2>
<p>This was the surprise.</p>
<p><strong>The benchmark.</strong> ADE-Bench: 24 dbt tasks running against local DuckDB, objectively scored. Crucially, Claude has <em>everything it needs locally</em>: no cross-warehouse, no missing drivers. This is the "where the plugin shouldn't matter" scenario.</p>
<p><strong>The headline result.</strong> Of 5 hard tasks bare Claude failed, the plugin's <em>passive presence</em> (just being installed; no Skill tool invocation, no subprocess delegation) <strong>rescued 1</strong>. Specifically: an ADE-Bench task called <code>intercom003</code> went from FAIL → PASS for an extra ~$0.13 in tokens.</p>
<p>Here's what changed in the output:</p>
<table>
<thead>
<tr>
<th>Operation</th>
<th>Bare Claude (FAIL)</th>
<th>With plugin loaded (PASS)</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Removing duplicate rows</strong></td>
<td>implicit join, missed dupes</td>
<td><code>QUALIFY ROW_NUMBER() OVER (...)</code></td>
</tr>
<tr>
<td><strong>Handling missing values</strong></td>
<td>"empty values expected"</td>
<td><code>COALESCE(..., 0)</code> everywhere</td>
</tr>
<tr>
<td><strong>Computing time differences</strong></td>
<td><code>date_diff('second', ...)</code></td>
<td><code>EXTRACT(EPOCH FROM ...) / 60</code></td>
</tr>
</tbody></table>
<p>Bare Claude defended its wrong output as expected behavior. Plugin Claude wrote dbt-idiomatic SQL. <strong>The Skill tool never fired.</strong> The plugin's value here was purely the loaded skill descriptions sitting in Claude's context, biasing it toward correct patterns.</p>
<p>And the <code>intercom003</code> task wasn't the only one we ran. We tested the full 5 hard ADE-Bench tasks across 4 configurations (passive, forced consultation, mandatory delegation) to map which mechanisms actually flipped failures:</p>
<img src="/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/4513c380-0457-49f8-92ca-97183ad9ea6f.svg" alt="ADE-Bench rescue matrix. Five hard tasks where bare Claude failed, tested across four configurations. Two rescues total. Intercom003 rescued by passive plugin presence at near-zero extra cost. Analytics engineering 006 rescued by mandatory delegation at eighteen times bare cost. Three of four forced-skill consultations did not translate to delegation, rescued zero." style="display:block;margin:0 auto" />

<p>Two rescues, two completely different mechanisms. The <strong>passive presence</strong> rescue (<code>intercom003</code>) was nearly free. The <strong>mandatory delegation</strong> rescue (another ADE-Bench task, <code>analytics_engineering006</code>) cost 18× a bare run but turned 0/7 tests into 7/7. Forcing the Skill tool to fire without demanding actual delegation rescued nothing. Claude reads the guidance, then proceeds to do the work itself.</p>
<blockquote>
<p><em>Even if Claude never delegates to altimate-code, the plugin's presence is a free correctness prior on dbt-shaped code.</em></p>
</blockquote>
<p>The cheapest mode of adoption (just enable the plugin and walk away) measurably improves dbt output quality.</p>
<hr />
<h2><strong>Blind spot #4: Wasted exploration on tasks the agent could solve</strong></h2>
<p><em>The first three blind spots are about things Claude can't do at all without the plugin. This one is different: it's about tasks Claude can already solve and whether the plugin makes those cheaper or more expensive. The answer is surprising: just having the plugin loaded changes how Claude explores, even when no plugin tools ever fire.</em></p>
<p>The <code>intercom003</code> task rescue hinted at something deeper than tool augmentation: the plugin was changing Claude's <em>search behavior</em> even when no plugin tools fired. So we asked whether that same passive context bias also reduced cost on tasks Claude <em>already</em> solved correctly.</p>
<p>We replayed three ADE-Bench medium tasks where bare Claude already produced correct, test-passing answers (<code>f1006</code> semantic data fix, <code>f1010</code> analysis gotchas, <code>airbnb009</code> missing-days debug), this time with the plugin enabled. Both configurations passed all tests. We compared turns, tool calls, and spend.</p>
<img src="/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/8ff9a3a9-5e6b-45af-ae0d-ceb483cb62d1.svg" alt="Token efficiency across three ADE-Bench medium tasks where both bare Claude and Claude with the altimate plugin produced correct answers. Aggregate cost dropped 18.6 percent. Per-task deltas: f1006 down 41 percent, f1010 down 8.7 percent, airbnb009 up 2.5 percent." style="display:block;margin:0 auto" />

<p><em>(Note:</em> <code>airbnb009</code> <em>above is a medium-complexity task, and different from</em> <code>airbnb005</code><em>-shape, the simpler task class discussed in the next section of this article.)</em></p>
<p><strong>The aggregate is a 18.6% cost reduction with the plugin enabled, on tasks where both produce identical, correct outputs.</strong> Two of three tasks were cheaper with the plugin; one was essentially flat. The biggest win, <code>f1006</code>, saw the plugin use <strong>4 fewer turns and 15 fewer tool calls</strong> than bare.</p>
<p>Importantly, this isn't from the plugin's deterministic tools firing. In all three runs, <code>altimate-dbt</code> <strong>was never invoked</strong>. Claude used the same Read/Bash/Edit tools either way. The savings come from the skill descriptions in Claude's system prompt biasing exploration: plugin Claude reads fewer files, skips more dead-end debugging paths, converges to the answer with less noise.</p>
<blockquote>
<p><em>Loaded plugin context is a prior, not a tax. It guides exploration toward the answer, even when the bundled tools never fire.</em></p>
</blockquote>
<p>This generalizes the <code>intercom003</code> task result: passive context bias improves both correctness <em>and</em> efficiency on real dbt work.</p>
<hr />
<h2><strong>The decision framework</strong></h2>
<p>Here's a single chart you can use to decide, task by task, which mode of the plugin matters and what it'll cost:</p>
<img src="/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/2749eba5-d74e-49cd-a8ea-29e81fe52acb.svg" alt="Decision framework chart for when each plugin mechanism pays off. Passive context bias is near-free and helps idiom-sensitive dbt SQL. Schema introspection adds parity cost and catches hallucinated columns on real warehouses. Cross-warehouse delegation has a premium cost but is the only path that finishes multi-DB workflows." style="display:block;margin:0 auto" />

<p>Use this to predict where the plugin will pay off on <em>your</em> workloads.</p>
<hr />
<h2><strong>Where the plugin doesn't help</strong></h2>
<p>It's not a free lunch everywhere. Two patterns to know about before you adopt:</p>
<ul>
<li><p><strong>On the simplest model-creation tasks (</strong><code>airbnb005</code><strong>-shape), plugin presence costs +25%</strong> with no correctness gain. These are tasks bare Claude one-shots in a handful of turns; there's no exploration loop for the context bias to short-circuit. On a richer mix of dbt mediums (Blind spot #4) the aggregate flipped the other way to −18.6%, but the simplest end of the spectrum is a small tax.</p>
</li>
<li><p><strong>The Skill tool is advisory, not delegating.</strong> Even forcing it to "fire" via system-prompt nudges doesn't translate to Claude actually executing altimate-code. We tested this. Don't over-invest in prompt tricks. Just install the plugin and let the passive context bias do the work, then <em>prompt invoke</em> altimate-code for cross-warehouse tasks.</p>
</li>
</ul>
<img src="/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/51c65e79-7ab7-47f7-9792-2980ac5ff00c.svg" alt="Two panels showing where the altimate plugin does not help. Trivial code generation pays a 25 percent token tax with no benefit. Forced skill consultation fires the skill tool but Claude reads guidance and does work directly, three of four times." style="display:block;margin:0 auto" />

<p>The pattern is consistent: <strong>the plugin shines on the work that's actually hard</strong>. For trivial tasks, it's a small tax. For warehouse-shaped, multi-DB, or idiom-sensitive work, it's the difference between a working answer and no answer.</p>
<p><strong>Recommendation:</strong> Leave the plugin on by default. The +25% overhead on trivial tasks is small in absolute terms (these are cheap, short runs), and dynamically toggling introduces friction that costs more in engineering time than it saves in tokens. The aggregate across a realistic mixed workload still favors leaving it enabled. If you're running a batch of pure staging model scaffolding with no warehouse lookups, that's the one case worth disabling it — but it's the exception, not the workflow to optimize for.</p>
<hr />
<h2><strong>How to adopt: — the 5-minute path</strong></h2>
<img src="/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/11421822-6d14-436a-98ba-4e7ed39e488f.svg" alt="Four-step adoption path. Step one enable plugin in settings.json. Step two verify it loaded with a CLI check. Step three for cross-DB tasks explicitly demand altimate-code in the prompt. Step four pre-bake warehouse credentials once." style="display:block;margin:0 auto" />

<p><strong>Step 1.</strong> Add to <code>~/.claude/settings.json</code>:</p>
<pre><code class="language-json">{
  "enabledPlugins": {
    "data-engineering-skills": true
  }
}
</code></pre>
<p><strong>Step 2.</strong> Verify it loaded:</p>
<pre><code class="language-bash">claude --print "list available skills" | grep -i altimate
</code></pre>
<p><strong>Step 3.</strong> For cross-warehouse and parity tasks, demand altimate-code explicitly in the prompt:</p>
<pre><code class="language-plaintext">Use altimate-code to drive the cross-DB diff
</code></pre>
<p><strong>Step 4.</strong> Pre-bake your warehouse credentials in altimate-code's connection registry once. Saves re-doing it per task and avoids credential leakage into prompts.</p>
<hr />
<h2><strong>The bottom line</strong></h2>
<p>The altimate plugin doesn't make Claude smarter at SQL. It makes Claude <strong>competent at the parts of data engineering that aren't SQL</strong>: schema introspection, cross-warehouse connectivity, dbt-idiomatic defaults. And on the dbt work it already could do, it does it with fewer tokens.</p>
<p>For data teams running Claude on real warehouse work, that's the difference between a code generator and an agent that finishes the task.</p>
<blockquote>
<p><em>Bare Claude is cheap when it works. When it doesn't (when the warehouse can't be reached, or when the column names are wrong), the cost is undefined. And even when it does work, plugin Claude usually gets there cheaper.</em></p>
</blockquote>
<hr />
<p><strong>Try it.</strong> <a href="https://github.com/AltimateAI/data-engineering-skills">Altimate Data Engineering Skills Plugin for Claude Code</a></p>
<p>If you run it on your next migration or parity task, we'd love to hear what shape of work it helped, or didn't.</p>
<hr />
<p><em>All three experiments used Claude Sonnet 4.6 uniformly. Sample size is small per task (1-2 runs per configuration); the task shapes are deliberately divergent, so treat the numbers as directional rather than precise.</em></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/4-blind-spots-of-general-coding-agents-in-data-engineering/cb2766a9-9af9-4ce0-9fea-1c78181cc938.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Where AI Agents Belong in Data Engineering: The Correctness Layer</title>
    <link>https://altimate.ai/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer</link>
    <guid isPermaLink="true">https://altimate.ai/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer</guid>
    <pubDate>Mon, 29 Jun 2026 16:47:17 GMT</pubDate>
    <dc:creator>Simon Späti</dc:creator>
    <category>altimateAI</category>
    <category>harnessengineering</category>
    <category>data-engineering</category>
    <category>AI</category>
    <category>llm</category>
    <description>With ever-changing models, new and better ones coming out every few months, it&apos;s great if we don&apos;t have to rely on them too heavily. The better your tooling, the less dependent you become on any singl</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/2c9f17df-29cf-4ff3-902c-5d6162b044ae.jpg" alt="Where AI Agents Belong in Data Engineering: The Correctness Layer" /></p>
<p>With ever-changing models, new and better ones coming out every few months, it's great if we don't have to rely on them too heavily. The better your tooling, the less dependent you become on any single model. That's also why the deterministic harness matters: a correctness layer that lets you reproduce outputs and trace lineage regardless of which model you're running underneath. This is especially true during maintenance or extending the project, where verification is the real job.</p>
<p>The danger isn't only a crash or an error message, but a wrong number that didn't break. It might be a clean query, but it introduces duplicated rows.</p>
<p>In this article, we go through the three levels of AI agents in data engineering, how to structure projects so the AI delivers its best outcomes, and how dedicated agents with a deterministic core help us build higher-quality pipelines — ones we can actually trust. And we look at a practical example of how it works with a blast radius analysis.</p>
<h2>The Three Levels of AI Agents in Data Engineering</h2>
<p>Why should we use agents for data engineering? And at what levels can agents help us productively? As LLMs will always have some error tolerance, as humans do too, we need a way to be more confident in producing the code.</p>
<h3>Chat-phase, Autonomous and Dedicated Tooling</h3>
<p>There are different levels of confidence and levels on which the agents can help us.</p>
<ol>
<li><p>The initial <strong>chat-phase</strong>: the development where we prompt Claude or ChatGPT. The model tries to understand the context based on what it has access to. It takes a decent amount of tokens, as it needs to scan everything from scratch.</p>
</li>
<li><p>The <strong>autonomous approach</strong>, where Claude Code or Codex also have access to the tools humans have, mostly the CLI on the terminal, making it possible to query Postgres with psql or read from S3 or Parquet with DuckDB to verify queries and data. A much higher quality outcome.</p>
</li>
<li><p><strong>Dedicated agents</strong> for the task at hand. E.g., for data, the tools know dbt or know how to transpile SQL code deterministically, meaning not from training data only, but with an actual tool that does it much faster and more reliably. Built-in checks and features a "general" agent can't provide.</p>
</li>
</ol>
<img src="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/B1cu2JQzGe.png" alt="Diagram of three levels of AI agents in data engineering: chat tools, autonomous agents such as Claude Code, and dedicated data agents, with confidence rising and token cost falling at each level" style="display:block;margin:0 auto" />

<p><em>Showcasing the three levels of AI agents in data engineering</em></p>
<p>Ideally, we'd want to always use the dedicated tools, but there isn't always one.</p>
<h3>Where in the DE Lifecycle Each Level Actually Helps</h3>
<p>BI Dashboards vs. Plumbing the Data Pipelines, or Creating Source Ingestions, or Maintaining? For data engineering, the question is not only if there is dedicated agent tooling, but also on what part of the <a href="https://www.oreilly.com/library/view/fundamentals-of-data/9781098108298/?ref=ssp.sh">data engineering lifecycle</a> AI agents can help data engineers and analysts the most, and potentially even domain experts?</p>
<p>The lifecycle contains the ingestion part, ETL, or understanding the business in great detail, or is it just to visualize the result? Or should it cover maintenance in case of overnight ETL errors, or the full data lifecycle?</p>
<p>In general, before we go into more details later, agents can help us on the full cycle, but it always depends on who you are and what role you play. Building from scratch with <strong>no knowledge</strong> or <strong>seniority</strong> is dangerous. Why? Because they can't verify if the produced code is correct. Okay for a side project or a proof of concept, but not for actual production.</p>
<h3>What's the Engineering Discipline for Working with AI?</h3>
<p>There's also a part that is less technical, a way of guiding the agents in the right direction. Especially if we want to safely use it in large projects or organizations, we can't just let it run without guidance.</p>
<p>For that we need:</p>
<ol>
<li><p>clear <strong>project structure</strong> in which the agents can flourish. The more is given, the fewer tokens are used for this work, and it will be more aligned across the project. (Another reason a deterministic workflow such as <code>uv init</code> is best, because it will always be the same).</p>
</li>
<li><p>build with clear <strong>instructions</strong> (<a href="https://altimate.ai/skills">agentic skills</a>, <a href="https://github.com/obra/superpowers">superpowers</a>, etc.) on how the tools are used (basically providing CLIs and API documentation). This is the bulk of the work anyway. That's the data architecture, the brainstorming with fellow humans before you build something, instead of missing a key insight in the beginning and then letting the agent run down the wrong path. Also, be realistic: prompting "be correct" or "use state-of-the-art" won't make it more correct or more state-of-the-art than the model was trained on. So if it's a rather new architecture, it's a must that you provide these links and hints.</p>
</li>
<li><p><strong>set up</strong> the project in a modular fashion, so the agents cannot break the whole project if they make a small change, so you don't end up in a scenario like <a href="https://xkcd.com/2347/">dependency hell</a> with everything dependent on each other.</p>
</li>
<li><p>use a <strong>declarative approach</strong>, with descriptive configuration that says the what and not the how, so that you can <strong>collaborate</strong> on these configs with the agents, version them, and easily revert or change something, as well as decouple the implementation logic from the actual business logic.</p>
</li>
</ol>
<p>With these steps, you can get the best out of the agents of today. I'd say the model matters less, but the structure does, and as Mario says, so does the workflow approach. For example, extensively plan (the process before writing a single line) and correct the model before any implementation that could lead down the wrong path is written.</p>
<p>Also, don't overthink it. But this is only the workflow and learning the <strong>soft skills and discipline of working with agents</strong>. How does that look in a real-world project?</p>
<blockquote>
<p>!Note:</p>
<p>The key is to get use out of AI, not to get more work. E.g., most developers used to think about the problem. Today, most drown in PRs. When the AI tooling gets better, AI can provide more quality code that is correct, that needs less review or fewer iterations, which means fewer PRs and less work for the developers to go through.</p>
</blockquote>
<h2>The Correctness Layer for Data Engineers</h2>
<p>A key insight is that AI agents should support the "human in the loop" for <strong>correctness</strong>, or a <a href="https://altimate.ai/blog/the-correctness-layer-in-ade">correctness layer</a>. And rather than making more work to verify more code, we should be confident in the process and know that the code it produces is verified and ultimately correct.</p>
<p>But how do we get more "correct" work and a layer in which we can verify it? The biggest argument is a deterministic-validation architecture in full. E.g., <a href="https://github.com/AltimateAI/altimate-code">Altimate Code</a> splits the agent into a probabilistic layer on top and a deterministic Rust/TS layer underneath that does the actual SQL ops such as parsing, validating, and equivalence checks, so that the agent itself never has to be trusted on those questions.</p>
<img src="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/BklE61QMGl.png" alt="Architecture diagram of Altimate Code: a probabilistic LLM agent on top, a deterministic TypeScript harness in the middle, and the altimate-core Rust library for SQL parsing, validation and lineage at the bottom" style="display:block;margin:0 auto" />

<p><em>An example of how Altimate Code is built with its probabilistic agent, deterministic harness, and deterministic core | Image from the article</em> <a href="https://altimate.ai/blog/the-correctness-layer-in-ade"><em>The Correctness Layer: Why Data Agents Need Determinism</em></a></p>
<p>Altimate Code, for example, is built on a probabilistic agent, deterministic harness, and deterministic core. The <strong>probabilistic agent</strong> with the LLM does the creative work of reading intent, picking a strategy, drafting SQL, summarizing results, and recovering when something goes wrong.</p>
<p>Below the boundary sits the <strong>deterministic harness</strong>, a TypeScript layer that intercepts every tool call: a dispatcher checks <code>hasNativeHandler</code> before the call runs, and routes it either to a native, deterministic handler or back to the model. Those handlers don't reimplement logic themselves, they call into the <strong>deterministic core</strong>, a Rust engine (<code>altimate-core</code>) that exposes SQL operations as pure functions over ASTs and schemas, wired in via napi-rs bindings. Parsing, validating, transpiling, checking query equivalence, diffing schemas, extracting column lineage, diffing rows across warehouses — all of it runs sub-millisecond, and all of it returns the same answer on the same input, every time.</p>
<p>Like a compiler, the agent never <em>decides</em> whether two queries are equivalent or a column exists upstream. Instead, it calls a function that proves it against the parsed AST and the schema, the same way a type-checker proves a program compiles rather than guessing.</p>
<img src="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/rkxihk7Mfg.svg" alt="Flow diagram comparing a bare agent, which guesses the column PATIENT_ID and fails at 2 AM, with an agent behind a correctness layer, which resolves SUBJECT_ID from the dbt manifest before merge" style="display:block;margin:0 auto" />

<p><em>How the correctness layer adds additional verification</em></p>
<p>That's the distinction that makes the output easier to review, as factual checks have been run and the output is either correct, or there's a bug that it can fix directly. The rest a human can re-verify. On the dilemma of having stopped to hand-write code and approving it faster than humanly possible to check, you can also read more at <a href="https://altimate.ai/blog/you-are-the-trust-layer-managing-data-engineering-ai-agents-at-scale">You Are the Trust Layer</a>.</p>
<blockquote>
<p>!Note: There's another factor: being wrong</p>
<p>Bare agent use might be cheap, but only until they're wrong, and then the cost is unbounded.</p>
</blockquote>
<h3>Improvements for Better Usage of Tokens</h3>
<p>Altimate, or data engineering agents that have deterministic functions and integrated understanding of how to work, can help you save tokens and be token lean (the opposite of <a href="https://en.wikipedia.org/wiki/Token_maxxing">tokenmaxxing</a>, which is popular on Twitter/X, using as many tokens as possible and having an agent running at all times). Because in large enterprises, token costs are a real budget point.</p>
<p>To slow down the tokens, an easy trick is to instruct the model to use fewer tokens and words itself - <a href="https://github.com/JuliusBrussee/caveman/">caveman</a> is a good example of that, but you can also add a singular prompt to your <code>CLAUDE.md</code>, Codex, or model of choice in combination with Altimate Code.</p>
<img src="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/Sk096JmGMx.png" alt="Screenshot of Altimate Code tracing the cat column in spend_categories through its dbt models, beside the Altimate Trace view of the same session showing token counts and tool calls" style="display:block;margin:0 auto" />

<p><em>An example of Altimate Code showing a trace of data lineage and a web UI for it.</em></p>
<p>There's a second, less obvious cost: the token itself isn't a stable unit. When Anthropic shipped Opus 4.7, the same prompt that cost X tokens on 4.6 <a href="https://altimate.ai/blog/the-great-token-heist-of-26">started costing roughly 1.4X</a> (same input, same answer, more tokens, same price per token).</p>
<p>In <a href="https://altimate.ai/blog/the-great-token-heist-of-26">The Great Token Heist of '26</a> , the Altimate team makes the case that "<em>cost-per-token is the wrong number to optimize</em>", since the meter itself can move with a vendor's next model update, and what we should track instead is <strong>cost-per-task</strong>. I fully agree, and this is where deterministic function calls work around that volatility by not using a model/tokens for every task, making it less expensive.</p>
<h2>Typical Use Cases</h2>
<p>In this chapter we go through typical AI agent use cases for data engineering.</p>
<p>There are many of them. You can use them to educate yourself or your team, build production data pipelines, build data apps, and visualize your data in new innovative ways (usually HTML web pages with React and other JavaScript frameworks). But in general, the use cases fit into these approaches:</p>
<ol>
<li><p><strong>Start a new project from scratch example</strong>: Building a data landscape with more open source.</p>
</li>
<li><p><strong>Extending an existing project or data warehouse</strong>: Adding new data pipelines.</p>
</li>
<li><p><strong>Maintaining current setup</strong>: Update and verify it still works when changes come in.</p>
</li>
<li><p><strong>Migration</strong>: Migrate from one database or tooling to the next.</p>
</li>
<li><p><strong>Finding the Blind Spots</strong>: Two similar-sounding IDs might be wrongly used for a join, or missing data in a column that got missed in a nightly load, or anything in between. If agents can do these checks, that would be super beneficial. With more access to CLI, Model Context Layer, and deterministic tooling, these things are truly possible.</p>
</li>
</ol>
<p>Below we go through extending and changing an existing warehouse with a change of column, and using Altimate Code to give us a Blast-radius assessment.</p>
<h3>Showcases: Blast-Radius Example</h3>
<p>A <a href="https://en.wikipedia.org/wiki/Blast_radius">Blast-radius</a> refers to the <strong>potential extent of damage</strong>. For example, before you knock down a wall in your house, you want to know if there's plumbing behind it, electrical wiring within it, or if it's holding up the floor above.</p>
<p>The same is true for a data warehouse or a data project with lots of ETL. For example, if a data engineer cleans up the table <code>fct_orders</code> by joining <code>orders</code> to <code>order_items</code> and summing <code>order_total</code>. It compiles, the dbt tests pass, nothing errors. But the join changes the grain, so any order with several line items now gets counted once per item, and revenue quietly inflates.</p>
<p>It's best to know, before you <strong>rename a column</strong> or add a new join, the downstream (data that comes after the current task) dependencies to the dashboard — that's what the blast-radius report does.</p>
<p>With Altimate Code we can achieve this. Before any change goes through, it maps out the full impact automatically and produces a detailed blast-radius report with what will break, what's safe, what needs someone to sign off, and also performs the changes. Here is what this looks like:</p>
<h4>Rename and Change Columns and Logic</h4>
<p>As an example, in this prepared <a href="https://github.com/sspaeti/ecommerce_demos">ecommerce repo</a> with different DWH layers such as <code>staging -&gt; intermediate -&gt; marts</code>, I prompted this request to change unit from cent to dollars:</p>
<img src="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/Bk_d41sfzx.png" alt="Screenshot of the Altimate Code terminal with a prompt to rename shipping_cents to shipping_dollar in the stg_order dbt model and list every model, test and metric that would break" style="display:block;margin:0 auto" />

<p>It recognized the dbt name and invoked <code>dbt-analyze</code> automatically:</p>
<img src="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/HyJcVyjMMg.png" alt="Screenshot of Altimate Code loading the dbt-analyze skill to run a blast radius analysis on the shipping_cents rename" style="display:block;margin:0 auto" />

<p>It gave me a full Blast-radius report and the impact my changes would have on the project:</p>
<img src="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/r1gsN1jMfg.png" alt="Screenshot of the Altimate Code impact audit for the shipping_cents rename, showing the lineage chain and four breaking changes by file and line" style="display:block;margin:0 auto" />

<p>Including semantics only, to point out what's safe and what's not:</p>
<img src="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/S1xNhVyozfx.png" alt="Screenshot of the Altimate Code impact audit listing one semantic-only change in sem_orders.yml and two files that are safe to leave unchanged" style="display:block;margin:0 auto" />

<p>With a fixed order to address breaking changes, semantics and docs, and intentionally untouched:</p>
<img src="/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/SJLaE1iMfg.png" alt="Screenshot of the recommended fix order from Altimate Code: six steps, ending with a rebuild of stg_orders and its downstream models" style="display:block;margin:0 auto" />

<p>Notice, I hadn't said anything about blast analysis or using dbt-analyze. It did it on its own, ran dbt, and analyzed it deterministically.</p>
<p>This shows how <strong>Altimate Code looks behind the walls of data engineering</strong>, just like blast radius analysis.</p>
<p>If you want to see another example and a full blog post on Blast Radius, check out <a href="https://altimate.ai/blog/blast-radius-analysis-using-altimate-code">Blast Radius Analysis Using Altimate Code</a>, and what Altimate Code did as in the <a href="https://www.youtube.com/watch?v=Npf7fHK43-k">video</a>. Or Altimate provides many more examples and <a href="https://docs.altimate.sh/examples/">Showcase</a> on their website such as <a href="https://www.youtube.com/watch?v=7MtD0NJjZS4">Migrate SQL Server to Snowflake with dbt</a> or showing how to resolve <a href="https://docs.altimate.sh/examples/#an-upstream-schema-changed-what-just-broke">An Upstream Schema Changed</a>.</p>
<blockquote>
<p>!Note: Connect a model to Altimate</p>
<p>Make sure to connect to a model with <code>/connect</code> and choose an existing subscription with API credits, or any other subscription. I used <a href="https://opencode.ai/zen">opencode zen</a> for my example, which includes e.g. Opus 4.8.</p>
</blockquote>
<h2>Correctness Over Confidence</h2>
<p>I hope you got a better understanding of why AI agents can be genuinely useful, especially when provided with the right tools and applied with the right discipline.</p>
<p>You've also seen how deterministic tooling, purpose-built for data engineering and analytics problems, gets you both better correctness and better token economics than general-purpose agents alone.</p>
<p>Coming back to where we started: not every task needs a level-three agent. A quick chat-phase agent is fine for exploring a dataset or drafting a query you'll review yourself. But the moment that output touches production or serious work, a dashboard, a nightly job, a number someone makes a decision on, you want the deterministic core underneath it, not just a model that sounds confident.</p>
<p>That's the gap <a href="https://github.com/AltimateAI/altimate-code">Altimate Code</a> is built to close. It runs on deterministic functions purpose-built for DE workloads, it's open-source via the OpenCode TUI, and for teams wanting more, there's Altimate Studio — a paid, multi-agent platform with extras like warehouse cost optimization, dbt development acceleration, and migration tooling.</p>
<hr />
<p>Check out <a href="https://github.com/AltimateAI/altimate-code">Altimate Code</a>, it's free and open-source. Give them a star if you like them, and find more information on their <a href="https://help.altimate.ai/">docs</a> and new <a href="https://altimate.ai/">website</a>.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/where-ai-agents-belong-in-data-engineering-the-correctness-layer/2c9f17df-29cf-4ff3-902c-5d6162b044ae.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>You Are the Trust Layer: Why AI Code Review Is Breaking Down</title>
    <link>https://altimate.ai/blog/you-are-the-trust-layer-managing-data-engineering-ai-agents-at-scale</link>
    <guid isPermaLink="true">https://altimate.ai/blog/you-are-the-trust-layer-managing-data-engineering-ai-agents-at-scale</guid>
    <pubDate>Mon, 15 Jun 2026 19:38:45 GMT</pubDate>
    <dc:creator>Anand Gupta</dc:creator>
    <category>AI</category>
    <category>Software Engineering</category>
    <category>ai agents</category>
    <category>developer productivity</category>
    <category>llm</category>
    <description>Your Job Just Became QA for an AI Pipeline You Didn&apos;t Design
Sometime this year your job changed, and nobody sent the memo. You used to write code. Now you mostly approve it: you read a summary, it lo</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/you-are-the-trust-layer-managing-data-engineering-ai-agents-at-scale/0762d2d6-5dab-447e-ace9-fd0a35f099a8.jpg" alt="You Are the Trust Layer: Why AI Code Review Is Breaking Down" /></p>
<h2>Your Job Just Became QA for an AI Pipeline You Didn't Design</h2>
<p>Sometime this year your job changed, and nobody sent the memo. You used to write code. Now you mostly approve it: you read a summary, it looks right, you hit accept, and you've moved on before you could have checked it even if you wanted to. The machine produces faster than any person can verify, and the distance between what it ships and what you actually confirmed grows every week.</p>
<p>So what does that make you? Not a tool's user. You are managing a labor force whose work you never read, and you are the only check between its confident output and what reaches production. You are the trust layer.</p>
<blockquote>
<p>The defining problem of this era isn't that AI can't do the work. It's that it does the work far faster than anyone can check it.</p>
</blockquote>
<h2>I Instrumented My Own AI Usage Like a Data Pipeline</h2>
<p>I know because I measured it. I wrote a small proxy, pointed it at my own machine, and logged every request that crossed the wire for forty-eight hours. One developer, two days: <strong>11,302 requests across 109 concurrent sessions and sub-agents</strong>. The last change one of those agents handed me had taken it six minutes and something close to an afternoon of human work. <strong>I looked at it for eleven seconds, then hit accept.</strong> I read what surfaced and trusted the rest. So do you.</p>
<blockquote>
<p>I Logged 11,302 AI Requests over two days. Only 37.5% Were Actually Correct.</p>
</blockquote>
<h2>Sub-Agents Are Unmonitored Nodes in Your Pipeline</h2>
<p>The first problem with a trust layer made of one person is that it's uneven. How much gets caught depends entirely on who is holding the line. A senior catches a surprising amount by reflex: the function that's subtly wrong, the assumption that doesn't hold. A junior catches less, because spotting the bad answer is the same skill as writing the good one, and that skill is the thing they're still building. And the ten sub-agents your agent spawned that nobody opened? Those are checked by no one at all. Across a real team, the work is thin on checking, and thinnest exactly where no one is looking.</p>
<h2>Why AI Generation Outpaces QA Capacity</h2>
<p>The second problem is worse, because it doesn't care how good you are. Generation is parallel and nearly free: one prompt fans out into ten agents. Your attention is serial and fixed: you read one thing at a time, and there are only so many hours. So as the volume climbs, the fraction any human can actually check falls, and not gently. It heads for zero. The senior's reflexes don't beat this. They just start from a higher number on the way down.</p>
<h2>96.9% Looked Clean. Only 37.5% Passed Validation.</h2>
<p>You might assume the part you don't check is mostly harmless, or you'd have noticed by now. I assumed that too, until I scored it. Almost everything the agents produced looked like a correct answer: clear, confident, well-formed. Barely a third of it actually was one, once I checked it against the code and the task in front of it. Looking right and being right turn out to be very different numbers, and the gap between them is exactly the part a quick skim waves through.</p>
<img src="/blog/you-are-the-trust-layer-managing-data-engineering-ai-agents-at-scale/a3a21996-9f63-456d-8ae2-3419691cef5a.png" alt="Bar chart comparing AI agent outputs that looked correct (96.9%) against outputs that were actually correct (37.5%) across 47 production traces, with the gap between them labeled &quot;what a glance waves through.&quot;" style="display:block;margin:0 auto" />

<h2>Bad Lineage Happens One Accepted Diff at a Time</h2>
<p>And the work you don't check doesn't disappear. It ships, things get built on top of it, and (this is what turns a backlog into debt) the next agent reads it as context and repeats it as fact. A wrong assumption from Tuesday is settled truth by Friday, cited in code none of you wrote by hand. You took the debt on to move fast. It accrues interest quietly, and it comes due later: the incident, the rollback, the week spent tracing where the data went wrong.</p>
<blockquote>
<p>The person clicking accept is almost never the person who pays.</p>
</blockquote>
<h2>Data Debt Doesn't Show Up on the Dashboard Until It's Expensive</h2>
<p>That's why you, personally, feel fine. The cost is displaced. It lands in time, weeks after the commit that caused it, and it lands on other people: the junior who trusts the senior's pace without the senior's reflexes, the teammate who inherits the module, next quarter's version of you. It's also why the best engineer on the team is the most sure there's no problem. He's right about his own desk. He just isn't the one holding the bag.</p>
<p>One developer can absorb this by hand for a while, which is the whole reason it stays invisible. An organization can't. Multiply it across everyone shipping this way and there is no trust layer left, only thousands of accepts a day, a rising balance of unverified work, and no single place that can tell you which of it was real.</p>
<p>Today the trust layer is you: by reflex, in the seconds between accepting one diff and starting the next. That was never going to hold. The only open question left is whether you replace it on purpose, with verification that runs as fast as the work is produced, or keep paying the debt until it picks the moment to collect.</p>
<hr />
<p><em>Numbers from a local proxy run against one machine over a 48-hour window: 11,302 requests, 109 concurrent sessions and sub-agents, and a 47-trace correctness sample in which 96.9% of output looked right and 37.5% was actually right. Measured, not modeled.</em></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/you-are-the-trust-layer-managing-data-engineering-ai-agents-at-scale/0762d2d6-5dab-447e-ace9-fd0a35f099a8.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>DeepSeek Cost 62% Less Than Claude. The Surprising Part Wasn&apos;t the Savings…</title>
    <link>https://altimate.ai/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark</link>
    <guid isPermaLink="true">https://altimate.ai/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark</guid>
    <pubDate>Wed, 10 Jun 2026 14:33:11 GMT</pubDate>
    <dc:creator>Syed Haider</dc:creator>
    <dc:creator>Surya Iyer</dc:creator>
    <category>AI</category>
    <category>llm</category>
    <category>Deepseek</category>
    <category>data-engineering</category>
    <category>ai agents</category>
    <description>If you&apos;re running an AI agent on data (pipeline diagnostics, schema exploration, ad-hoc SQL, lineage queries), you&apos;ve looked at the model bill and asked the same question we did:

&quot;The cheaper model o</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/03ea3e21-350a-45e9-87d7-7581b8d9aa92.jpg" alt="DeepSeek Cost 62% Less Than Claude. The Surprising Part Wasn&apos;t the Savings…" /></p>
<p>If you're running an AI agent on data (pipeline diagnostics, schema exploration, ad-hoc SQL, lineage queries), you've looked at the model bill and asked the same question we did:</p>
<blockquote>
<p><em>"The cheaper model on the leaderboard is only a few points behind the one I'm using. The endpoints are drop-in compatible. The agent code doesn't care which backbone is wired in. Why shouldn't I switch?"</em></p>
</blockquote>
<p>That's a defensible question. It's also a question with a more interesting answer than the leaderboard suggests.</p>
<p>We're going to walk through what we found when we ran the swap: Claude Sonnet 4.6 to DeepSeek v4 pro inside the same data agent, run across the same benchmark, with the same workspace, prompts, and tools. The accuracy difference is small and roughly what the leaderboard predicts. The behavioral difference is not. By the end of this post we'll have a concrete framework for thinking about LLM selection in an agent context that's a lot more useful than "<em>which model is on top of which leaderboard this week.</em>"</p>
<p>Throughout, the only thing we change is the backbone model.</p>
<p>*<strong>Note:</strong> We did not compare against Claude Opus series since Opus would intensify the cost gap (roughly 5× Sonnet's per-trial cost) without changing the model family. We plan more inter- and intra-model family comparisons soon.</p>
<img src="/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/61cbe1a4-8674-4c1b-bdc1-a51de5e41b90.svg" alt="Two abstract traces side by side, Sonnet on left dense and chatty, DeepSeek on right denser in tool calls but quieter in text." style="display:block;margin:0 auto" />

<p><em>Same task — Beyoncé's "Get Me Bodied" on DAB’s music_brainz dataset. The dots are tool calls. The gray bars are narration chunks. You can tell the models apart without looking at the model field.</em></p>
<h2><strong>The setup, in two paragraphs</strong></h2>
<p>We use <a href="https://github.com/altimateai/altimate-code">altimate-code</a>, the open-source agent runtime behind our data engineering platform. It's the harness currently sitting at #1 on the <a href="https://ucbepic.github.io/DataAgentBench/">DataAgentBench (DAB)</a> leaderboard for Pass@1 stratified accuracy, scored at 0.6320 with GPT 5.5 and Claude Sonnet 4.6. DAB is UC Berkeley's data-agent benchmark: 54 queries across 12 real-world datasets (Postgres + MongoDB + SQLite + DuckDB), 5 trials per query, 270 trial runs per submission. Real schemas, real ambiguity, validators that check the exact shape of the answer.</p>
<p>For this post we ran two complete Pass@5 passes through altimate-code: one with Claude Sonnet 4.6, one with DeepSeek v4 pro. 270 trials each. 540 trials total. Everything else (agent code, prompts, tools, validators, dataset hints, workspace setup) stayed identical. The result is a clean A/B with a single variable. That's what makes the contrast interesting.</p>
<h2><strong>The numbers that the leaderboard would show you</strong></h2>
<p>Here's how the two runs compare on the dimensions a leaderboard would surface:</p>
<pre><code class="language-plaintext">                          Sonnet 4.6      DeepSeek v4 proᵃ
Stratified Pass@1            60.4%             56.9%
Raw Pass@1                   63.0%             60.0%
Cost per trial               $0.76             $0.29
Median duration / trial      4 min             9 minᵇ

ᵃThis run has not been sumbitted to DAB, we're working on an improved approach.
ᵇDeepSeek latency measured via OpenRouter without upstream-provider pinning; 
OpenRouter's routing across DeepSeek's underlying providers contributes to wall-clock variance.
</code></pre>
<ul>
<li><p>Accuracy gap: 3.5 stratified points (the benchmark metric).</p>
</li>
<li><p>Cost gap: 2.7× cheaper for DeepSeek.</p>
</li>
<li><p>Latency gap: 2.2× faster per trial for Sonnet.</p>
</li>
</ul>
<p>If you're running an overnight batch workload where wall-clock doesn't matter, those numbers point at DeepSeek. If you're running an interactive agent where users are waiting, they point at Sonnet. That's the surface-level read, and it's not wrong.</p>
<p>It's also incomplete in ways that turn out to matter.</p>
<h2><strong>The trace tells a different story</strong></h2>
<p>We picked the model swap as the only variable so we could look at everything else.</p>
<p>Inside an agent run, the score is one bit of information: the final ANSWER, did it pass or fail. The trace (every tool call, every text emission, every step boundary, with timestamps) is thousands of bits. The agent loop produces a <code>events.jsonl</code> file per trial, and once you start reading them side-by-side, the score gap stops being the interesting number.</p>
<p>Here’s a snippet:</p>
<img src="/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/28ab6597-0184-4c7d-b107-128127bd4712.svg" alt="Annotated events.jsonl trace snippet with callouts pointing to empty SQL result, LIKE retry, and final ANSWER write." style="display:block;margin:0 auto" />

<p>The trace signature is what an operator stares at when something goes wrong in production at 3 AM. It's what you log, what you alert on, what you debug from. We found that the signature changes more when you swap the model than the accuracy does. By a lot.</p>
<p>Here's what that looks like, concretely.</p>
<h2><strong>Finding 1: One model talks. The other doesn't.</strong></h2>
<p>Per trial:</p>
<pre><code class="language-plaintext">                              Sonnet 4.6                DeepSeek v4 pro
Chat-text events (mean)             13                       10
Characters of narration (mean)      5.7 k                    1.7 k
Tools called — mean                 36                       36
Tool calls — median                 32                       36
Tool calls — min                    0                        0
Tool calls — max                    82                       75
</code></pre>
<img src="/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/7a761e9c-d563-4f47-9042-0a72cc81664f.svg" alt="Left: horizontal narration bars, Sonnet 5700 vs DeepSeek 1700 characters. Right: token-mix annotation showing cache for Sonnet, reasoning tokens for DeepSeek." style="display:block;margin:0 auto" />

<p>Both models handled the same workload with the same tool volume. Sonnet writes about 3× more chat text along the way. It narrates as it works ("Let me check the schema for the orders table" / "I'll filter for active customers first" / "Trying a different join condition"). DeepSeek does its planning silently and only surfaces what it has to.</p>
<p>This shows up in the cost structure too. Sonnet writes 49 k tokens into Anthropic's prompt cache per trial and reads 1.22 M back from it; reasoning tokens are zero. DeepSeek writes nothing to a prompt cache, but burns 8 k reasoning tokens per trial doing chain-of-thought inline.</p>
<p>The downstream consequences are concrete:</p>
<ul>
<li><p>If you're tailing logs from an agent in production, Sonnet sounds like a thinking colleague. DeepSeek sounds like a quiet one.</p>
</li>
<li><p>If you're building token-cost alerts, they'll be calibrated for one and miss the other. Sonnet's bill is input tokens + prompt cache. DeepSeek's is reasoning tokens, with no cache line at all. So a Sonnet-tuned alert ("input spend spike", "cache hit-rate drop") sits silent on DeepSeek while reasoning-token cost you're not watching adds up.</p>
</li>
<li><p>If your platform's observability is built on chat-text logging, swapping to DeepSeek will quietly cut your visibility by two-thirds.</p>
</li>
</ul>
<p>None of this affects the accuracy column on the leaderboard. All of it affects your team building on top of these models.</p>
<h2><strong>Finding 2: One model commits early. The other doesn't always commit.</strong></h2>
<p>altimate-code reads the agent's final answer from a file called ANSWER. Every <code>write</code> tool call against that file is a timestamped event. We plotted the first ANSWER write per trial as a fraction of trial elapsed:</p>
<img src="/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/208bd216-76ea-4aa7-a7ed-c58d4ed2adb1.svg" alt="Horizontal histogram showing when the first ANSWER write lands as a percentage of trial elapsed. Sonnet peaks in the 60–80 percent bin with 130 trials. DeepSeek peaks in the 80–100 percent bin with 125 trials. The 'never' row is the operationally important one: 32 trials for Sonnet, 79 for DeepSeek." style="display:block;margin:0 auto" />

<p>Sonnet's median first commit lands around 70% of the way through a trial. DeepSeek's lands around 90%. And the "never" row is the operationally important one: <strong>79 of 270 DeepSeek trials never wrote anything to ANSWER at all.</strong> For Sonnet, that number is 32.</p>
<p>These are two strategies, both legitimate. Sonnet commits early and refines: writes a first draft mid-trial, then rewrites it as confidence grows (mean: 1.47 ANSWER writes per trial). DeepSeek explores until forced to commit, then commits once (mean: 0.88 writes per trial).</p>
<p>Why DeepSeek explores-then-commits is partly architectural. Its reasoning models emit reasoning_content and content on two parallel channels (<a href="https://api-docs.deepseek.com/guides/reasoning_model">DeepSeek API docs</a>). The agent loop consumes content; reasoning_content is inspection-only and must be stripped before resubmission (the API 400s otherwise). DeepSeek plans privately in the reasoning channel and bursts the plan into content as tool calls + ANSWER in one transition. Sonnet has no such split: its chain-of-thought shares the channel the loop consumes, so drafts and retractions stream out as visible turns.</p>
<img src="/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/9f80f9da-c343-441e-9fd4-32870e03164e.svg" alt="Channel architecture: DeepSeek has reasoning_content private channel and content public channel with a burst arrow; Sonnet has a single content channel carrying drafts and final answer together." style="display:block;margin:0 auto" />

<p>If you're building anything where users see partial progress (a dashboard, a streaming UI, an agent that hands off intermediate results), Sonnet gives you a draft to show by minute two. DeepSeek leaves you with an empty file for eight minutes, and almost a third of the time, leaves it empty forever.</p>
<h2><strong>Finding 3: One model asks the database questions. The other writes scripts.</strong></h2>
<p>Look at the tool-call distribution across all 270 trials per model:</p>
<img src="/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/8dd290f6-13f1-40a0-b679-10fe639fe044.svg" alt="Grouped bar chart of mean tool calls per trial for five tools, comparing Sonnet and DeepSeek." style="display:block;margin:0 auto" />

<p>The agent and tool surface were identical; the tool preferences were not.</p>
<p>Sonnet falls back to bash 45% more often than DeepSeek. It runs Python scripts for filtering, aggregating, formatting. When in doubt, it writes code.</p>
<p>DeepSeek prefers the native data tools the harness exposes. It inspects schemas 2.7× more often. It runs SQL through <code>sql_execute</code> 64% more often. When in doubt, it asks the database.</p>
<p>The discovery cadence diverges before the first SQL even runs. Mean schema-related calls before the first SQL execution: 2.8 for Sonnet, 4.9 for DeepSeek. DeepSeek does a column-by-column tour before writing any SQL. Sonnet reads the prompt, takes one schema snapshot, and gets to work.</p>
<p>Both rhythms produce correct answers on plenty of queries. They get there with different tool budgets and different turn structures.</p>
<blockquote>
<p>If your platform logs the shape of tool calls in production, you can identify which backbone is running without looking at the model field.</p>
</blockquote>
<h2><strong>Finding 4: When they fail, they fail differently</strong></h2>
<p>This is the finding we found most operationally consequential.</p>
<p>Every failed trial fits one of four shapes:</p>
<pre><code class="language-plaintext">                            Sonnet 4.6      DeepSeek v4 pro
Empty (nothing written)        7 (3%)         27 (10%)
Short wrong (single value)    43 (16%)        26 (10%)
Medium wrong (small table)    30 (11%)        33 (12%)
Long wrong (multi-row)        20 (7%)         22 (8%)
Total failures               100             108
</code></pre>
<img src="/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/4955d3db-74e0-4108-aa0d-ca0023a8b439.svg" alt="Failure shapes grouped bar chart: Sonnet skews toward short-wrong, DeepSeek skews toward empty. Same totals, opposite shapes." style="display:block;margin:0 auto" />

<p>Sonnet's failures cluster on <em>short wrong</em>: confident commits to a wrong value. DeepSeek's cluster on <em>empty</em>: the agent worked, explored, iterated, and never wrote anything.</p>
<p>The total failure count is the same; the shapes are opposite. Both shapes have architectural roots.</p>
<p>DeepSeek's reasoning API can return HTTP 200 with <code>reasoning_content</code> populated but <code>content</code> empty, meaning the model reasons through to a conclusion without ever generating output text. The failure mode is tracked in <a href="https://github.com/deepseek-ai/DeepSeek-R1/issues/314">DeepSeek-R1 issue #314</a>: "the status code returned is 200 (indicating a successful request in the HTTP protocol sense), the actual content of the response is empty." The issue was closed stale without a fix. Sonnet has the opposite problem for the opposite reason: with no separate reasoning channel, its planning happens in the same <code>content</code> stream the loop consumes. Drafts surface as soon as the model has a candidate, and once a candidate is in ANSWER there's no separate "verify-before-commit" gate to slow it down. The model <em>satisfices</em>: it picks the first plausible answer, polishes the prose around it, and moves on. That's how “short wrong” gets produced: a confident commit on partial evidence, with the verification step folded into the same channel that wrote the answer in the first place.</p>
<p>Here's a concrete example. DAB’s “GitHub Repos” query 3 asks for the count of Shell-language commits in Apache-2.0 repos under a length filter. The ground truth is <code>1077</code>.</p>
<pre><code class="language-plaintext">Sonnet:   "963
114"   ← committed close-but-wrong on turn 8
DeepSeek: "1077"       ← landed correctly after exhaustive schema inspection
</code></pre>
<img src="/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/e648890e-6ef2-4a67-bf91-6c7a73ae5a8f.svg" alt="Two swim lanes for GitHub Repos q3. Top lane is Sonnet with 21 tool calls and an early wrong commit at turn 8. Bottom lane is DeepSeek with 40 tool calls and a correct commit at turn 40." style="display:block;margin:0 auto" />

<p>DeepSeek did 40 tool calls, including 4 <code>schema_inspect</code> calls and 12 <code>sql_execute</code> iterations. It got there because it kept asking. Sonnet did 21 tools, jumped to bash at turn 8 with a count that was nearly right, and never noticed it was wrong. DeepSeek won this query 4 out of 5 trials. Sonnet won 0.</p>
<p>For an operator, the two failure modes have different downstream costs:</p>
<ul>
<li><p><strong>Vocal-wrong</strong> (Sonnet's signature) gives you a bad answer that may pass type checks and propagate to consumers. The downstream system sees a number and assumes it's right.</p>
</li>
<li><p><strong>Silent-stuck</strong> (DeepSeek's signature) gives you nothing: a missing row that is easy to detect with a presence check but hard to debug without the trace.</p>
</li>
</ul>
<p>Which is worse depends on what your downstream consumers do. If you have validators downstream that can re-check correctness, silent-stuck is more recoverable. If you don't, vocal-wrong is the silent killer.</p>
<h2><strong>When the signature disappears</strong></h2>
<p>There are times, however, when models do <em>not</em> fail differently.</p>
<p>When a question is clean (the schema is obvious, the format is pinned down, the dataset hint spells out the join recipe), Sonnet and DeepSeek behave almost identically. We watched this on a question from DAB's <code>bookreview</code> corpus (query 3) that asks for a multi-row table from columns that store Python-dict syntax as text. Both models passed it. Both took exactly 27 tool calls. The first eight tools in each trace were nearly identical: read question, read format_hint, list warehouses, index schema, inspect a table, write the SQL.</p>
<p>The same effect shows up when the agent has good orientation upstream of the main loop. We run a pre-orientation pass where a lighter model walks the schema, samples rows, identifies non-obvious column formats, and proves out join candidates with mechanical probes. The output gets dropped into the agent's workspace as a single markdown file. When that file is well-formed, you can't tell the models apart from the trace.</p>
<p>The trace signature shows up at the <em>edges</em> of the agent's capability, where it has to decide for itself when to commit, how aggressively to explore, what to do when stuck.</p>
<p>So before you assume model selection matters for your workload, look at your queries. If most of them are clean (well-documented schemas, unambiguous prompts, validators that accept reasonable variants), the model choice may genuinely not move your needle. Pick on cost. If your real queries push the agent into open-ended decisions (which is what most production data-engineering work actually does), the trace signature is what you should be evaluating.</p>
<h2><strong>How we choose now</strong></h2>
<p>A short field guide, based on what we measured:</p>
<p><strong>Pick Sonnet 4.6 when:</strong></p>
<ul>
<li><p>You need progress visibility mid-run. For dashboards, streaming UIs, and partial-trace debugging, you need incremental output. Sonnet writes a draft answer at the 70% mark and improves it. DeepSeek doesn't write anything for 90% of the trial, and a third of the time, never writes anything.</p>
</li>
<li><p>Latency matters per trial. Sonnet finishes in ~4 minutes median; DeepSeek in ~9. For interactive use, the gap is felt.</p>
</li>
<li><p>Silent failures are expensive downstream. Vocal-wrong is easier to detect than silent-stuck. If your pipelines don't double-check the agent's output, you want it to commit (so you can catch wrong answers) rather than disappear (so you don't even know it failed).</p>
</li>
</ul>
<p><strong>Pick DeepSeek v4 pro when:</strong></p>
<ul>
<li><p>Cost matters more than wall-clock. DeepSeek runs at 38% of Sonnet's per-trial cost for similar accuracy on this benchmark, making the math straightforward for overnight batch, retroactive backfills, and async report generation.</p>
</li>
<li><p>The agent needs to explore. DeepSeek's tendency to inspect the schema thoroughly before writing SQL is the right behavior when the schema is unfamiliar and the question demands precision.</p>
</li>
<li><p>You have downstream validators that catch silent-stuck. If your platform notices missing outputs and can retry, DeepSeek's caution costs you less than Sonnet's overconfidence might.</p>
</li>
</ul>
<p><strong>Run both when:</strong></p>
<ul>
<li>You're doing consensus or majority voting. The two backbones disagree on 19% of trials in our run. That's a real ensemble margin, not noise. A judge model can pick the right answer often enough to lift the combined score above either alone.</li>
</ul>
<p><em><strong>Case in point:</strong></em> <em>In this comparison, Sonnet and DeepSeek disagreed on 51 trials. A perfect oracle judge over those would lift ensemble Pass@1 by ~9-10pp; a realistic LLM judge by ~3-5pp. Full consensus math and a real judge run is a follow-up.</em></p>
<p>We use all of the above in production. <a href="https://altimate.ai/products/altimate-code">altimate-code</a> is built to make this choice cheap: any backbone, swappable per workload, same trace format regardless. The selection logic is yours. The decision is yours.</p>
<h2><strong>A footnote on substrates</strong></h2>
<p>This post is the operational complement to an argument we made earlier in <a href="https://altimate.ai/blog/the-correctness-layer-in-ade"><em>The Correctness Layer in ADE</em></a>. That one argues that for the parts of data engineering that have deterministic ground truth (two queries are equivalent, a lineage edge exists, a row-level diff is correct), the LLM is the wrong substrate. The substrate should be deterministic code.</p>
<p>The argument here is the complement: even when you do leave a task to the LLM, <em>which</em> LLM you pick changes the operator experience. The substrate is still the story. The LLM is just the part of the substrate that varies the most when you swap providers.</p>
<h2><strong>If you want to look yourself</strong></h2>
<p>Everything in this post is reproducible. <a href="https://altimate.sh">altimate-code</a> is <a href="https://github.com/AltimateAI/altimate-code">open source</a>. DataAgentBench is open. You can obtain the per-trial <code>events.jsonl</code> files which preserve every tool call, every step boundary, every token count, every chat emission. The two runs we compared above are from our own <code>benchmark_runs</code> collection; the analysis script that produced the numbers is in the repo. If your team is making a similar swap, the same kind of diff is one fork and a few hours of compute away.</p>
<h2>Conclusion</h2>
<p>The leaderboard tells you what a model can do on a benchmark. The trace tells you what your agent will look like in production. We built <a href="https://altimate.sh">altimate-code</a> to win on both.</p>
<p>That's why we sit at <a href="https://web.archive.org/web/20260608100121/https://ucbepic.github.io/DataAgentBench/">#1 on DataAgentBench</a> with Sonnet, and why the same runtime runs DeepSeek at 38% of the cost just as cleanly. The tools, prompts, and trace format are identical across both. The model becomes a variable per workload, not a quarterly commitment.</p>
<p>The runtime carries its share too. Tools emit a compact, structured payload to the model and a richer, human-readable one to the UI, so the agent's context window isn't burned on formatting it'll never read. Long sessions get compacted instead of truncated. Token budgets stretch further on every backbone you point at it.</p>
<p>Pick the model that fits the workload. Pick the runtime that doesn't lock you to one.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/deepseek-vs-claude-sonnet-ai-agent-benchmark/03ea3e21-350a-45e9-87d7-7581b8d9aa92.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>The Great Token Heist of ‘26</title>
    <link>https://altimate.ai/blog/the-great-token-heist-of-26</link>
    <guid isPermaLink="true">https://altimate.ai/blog/the-great-token-heist-of-26</guid>
    <pubDate>Mon, 01 Jun 2026 20:15:13 GMT</pubDate>
    <dc:creator>Surya Iyer</dc:creator>
    <dc:creator>Syed Haider</dc:creator>
    <category>altimateAI</category>
    <category>agentic AI</category>
    <category>Tokenomics</category>
    <category>openai</category>
    <category>claude-code</category>
    <description>Your LLM provider charges by the token, but a token is not a portable unit of work, a unit of meaning, or any unit you can compare across vendors. It only has meaning inside one vendor&apos;s system and lo</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/the-great-token-heist-of-26/a164d003-f725-473b-a6e6-a026ab05d821.jpg" alt="The Great Token Heist of ‘26" /></p>
<p>Your LLM provider charges by the token, but a token is not a portable unit of work, a unit of meaning, or any unit you can compare across vendors. It only has meaning inside one vendor's system and loses it the moment you step outside. The token is a currency: vendors mint it, vendors re-denominate it, and the exchange rate with English (meaning how many tokens it takes to express the same sentence) is theirs to set. So when two vendors quote the same dollars-per-token, they are still quoting in different currencies.</p>
<p>On April 17, 2026, the day after Anthropic shipped Claude Opus 4.7, a Hacker News user named <em>anabranch</em> posted a public leaderboard they had built at <a href="https://tokens.billchambers.me">tokens.billchambers.me</a> with crowdsourced before-and-after token counts on the same prompts run through Opus 4.6 and Opus 4.7. The thread title, <a href="https://news.ycombinator.com/item?id=47816960">"Opus 4.7 to 4.6 Inflation is ~45%"</a>, climbed to 117 points before lunch. anabranch's summary: <em>"It can be more than 2x for small prompts."</em></p>
<p>The comments filled with developers reporting specific impacts on their bills. <em>hgoel</em>, on the Claude Max 5x plan, <a href="https://news.ycombinator.com/item?id=47817737">hit their five-hour usage limit in under two</a>. <em>tiffanyh</em> <a href="https://news.ycombinator.com/item?id=47817627">exceeded the weekly limit after seven prompts on a single-file HTML/CSS/JS project under 300 lines</a>. <em>KellyCriterion</em>: <a href="https://news.ycombinator.com/item?id=47817801">"killed my weekly limit with just three prompts."</a> <em>manmal</em> put the number on it: <a href="https://news.ycombinator.com/item?id=47817534">"The same prompt costs roughly 30% more now, for input."</a></p>
<p>None of this was a price change. <a href="https://www.anthropic.com/news/claude-opus-4-7">Opus 4.7 launched at the same $5 per million input tokens and $25 per million output as 4.6.</a></p>
<p>Independent measurements followed within days. Simon Willison upgraded his Claude Token Counter to compare the two models on the same input and <a href="https://simonwillison.net/2026/apr/20/claude-token-counts/">posted</a>: <em>"Opus 4.7 does appear to use 1.46x times the tokens for text"</em>, with up to 3× for images, priced the same as Opus 4.6 on a per-token basis. <a href="https://openrouter.ai/announcements/opus-47-tokenizer-analysis">OpenRouter ran the numbers across more than a million real customer requests</a> and published a bucketed breakdown: 32–45% more native tokens for equivalent text (highest on prompts under 2,000 tokens), with a 12–27% increase in net cost after prompt caching absorbed some of the inflation.</p>
<p>What changed was not the price per token. It was the token itself. The same prompt that cost you X tokens on 4.6 now costs roughly 1.4X on 4.7: same input, same answer, same work. The vendor changed the resolution. If that sounds like a camera going from 12 to 18 megapixels, Anthropic would accept that comparison: more resolution, better model, same price per unit. But a megapixel upgrade is a one-time capability you choose. This tokenizer change bills you per pixel on every shot, cannot be switched off, and shipped with no announcement. And more megapixels never guaranteed a better photo, only a bigger file. More tokens do not guarantee a better answer. They guarantee a bigger bill.</p>
<h2>The currency got re-denominated</h2>
<p>Buried in Anthropic's <a href="https://platform.claude.com/docs/en/about-claude/models/whats-new-claude-4-7">migration guide</a> is one easy-to-miss sentence: Opus 4.7 uses a new tokenizer that <em>"may use roughly 1x to 1.35x as many tokens"</em> as previous models, varying by content. The price per token did not move; the number of tokens required to express the same English sentence did.</p>
<p>The honest defense is that this is an upgrade: a finer tokenizer can mean better resolution and better answers, and you simply pay in more tokens for them. But "better answers" is a measurable claim. If the quality is real, it shows up as a higher success rate and the cost per finished task still holds. If it does not, you are paying more tokens for the same result. The catch is that they shipped the cost with no announcement and no opt-out, while leaving the "better outcomes" half for you to verify on your own bill.</p>
<p>If this happened in a fiat currency, we would call it a redenomination: the kind of operation central banks use when they need to recalibrate without admitting they are recalibrating. Your salary stays "the same" in the new currency, but the new currency buys 30% less coffee. Anthropic, of course, does not have the obligations of a central bank, so there is no announcement, no press conference, and no notice period. The tokenizer is part of the model. It changes when the model changes.</p>
<p>The Hacker News reactions were not just complaints about bills. They were the predictable response to opacity. <em>Shailendra_S</em>, a bootstrapped founder, <a href="https://news.ycombinator.com/item?id=47817588">argued that 45% inflation breaks the unit economics for most indie products</a> and pushes builders toward open models, or back to the more token-efficient Opus 4.5. <em>dakiol</em> <a href="https://news.ycombinator.com/item?id=47817610">announced his team had dropped Claude entirely</a>. <em>Boris Cherny from the Claude Code team</em> <a href="https://news.ycombinator.com/item?id=47817526">showed up in the thread</a>, but to address a separate complaint about over-fixated safety warnings, not the cost question. The cost question is hard to address. The currency really did get smaller, and the vendor can keep calling it "the same price."</p>
<p><em>"Nobody raised prices. The currency got smaller."</em></p>
<h2>What Does an AI Token Mean?</h2>
<p>An AI token is the unit that an LLM reads, writes and bills. A tokenizer splits your text into integer IDs, and each ID is one token. Each vendor trains its own tokenizer, so the same text gives a different token count on each model.</p>
<h2>There is no standard token</h2>
<p>Anthropic's redenomination is not unusual. It is the rule, dressed up as an exception.</p>
<p>Tokens are made by tokenizers, which are deterministic functions that split text into integer IDs. Each vendor trains its own. OpenAI's <a href="https://github.com/openai/tiktoken">tiktoken</a> is open-source: you can download the vocabulary files and count locally before you pay. GPT-3.5 and GPT-4 use <a href="https://github.com/openai/tiktoken"><code>cl100k_base</code></a>, with 100,256 entries. GPT-4o, GPT-5, and the o-series use <code>o200k_base</code>, with 200,019. The transition from one to the other in 2024 was not priced as a change. It was, of course, a change.</p>
<p>The pattern repeats across vendors. <a href="https://huggingface.co/blog/llama3">Llama 2 to Llama 3 jumped from a 32K to a 128K vocabulary</a>, and Meta says that buys up to 15% fewer tokens for the same text. <a href="https://mistral.ai/news/mistral-nemo">Mistral's Tekken tokenizer</a>, introduced for NeMo and Pixtral, compresses code about 30% more efficiently than its SentencePiece predecessor, and Korean and Arabic by 2–3×. <a href="https://docs.rs/gemini-tokenizer">Gemini's tokenizer</a>, currently a 262,144-token SentencePiece model shared with Gemma 3, has rotated through versions across Gemini 1.5, 2.x, and 3.x. DeepSeek's <a href="https://arxiv.org/abs/2412.19437">V3 paper</a> documents a 100K → 128K vocabulary expansion from V2.</p>
<p>The vendor with the most aggressive policy of opacity is Anthropic. The legacy <code>claude-v1-tokenization.json</code> was published for Claude 1 and never again. For Claude 3, 3.5, 4, and 4.7, the only authoritative way to count tokens is to call Anthropic's <a href="https://platform.claude.com/docs/en/build-with-claude/token-counting"><code>count_tokens</code> endpoint</a>. The repository <code>javirandor/anthropic-tokenizer</code> is the community workaround, reverse-engineered by asking Claude to repeat text and observing what comes back. It is approximate, and for many teams it is also the only way to estimate Claude cost without a round-trip to Anthropic's servers.</p>
<p>You can quote two vendors at the same dollar-per-million-token. You cannot quote them in the same units.</p>
<h2>The AI exchange rate is not the same for everyone</h2>
<p>If tokens are a currency, English speakers got a significantly better deal on it.</p>
<p>Petrov, La Malfa, Torr, and Bibi published <a href="https://arxiv.org/abs/2305.15425">"Language Model Tokenizers Introduce Unfairness Between Languages"</a> at NeurIPS 2023. They <a href="https://aleksandarpetrov.github.io/tokenization-fairness/">evaluated 17 tokenizers across 200+ languages</a> on FLORES-200, the standard multilingual parallel corpus. The single most cited number from that paper: the same translated sentence can produce <em>"differences up to 15 times"</em> in token count across languages, and the disparity persists even on tokenizers explicitly designed for multilingual support.</p>
<p><a href="https://www.artfish.ai/p/all-languages-are-not-created-tokenized">Yennie Jun's parallel study</a> across 52 languages and 2,033 messages quantified the everyday cost. English averaged 7 tokens per message. Spanish, French, and Portuguese came in at similar rates. Hindi and Bengali ran approximately 5× English. Armenian ran 9×. Burmese reached 72 tokens, roughly 10× English for the same sentence. Her summary: <em>"some languages require up to 10 times more tokens."</em></p>
<p>Newer tokenizers narrow the gap without closing it. Tamil's நீ ("you") <a href="https://www.njkumar.com/gpt-o-multilingual-token-compression/">was four tokens in <code>cl100k_base</code> and is a single token in <code>o200k_base</code></a>. Gemini's larger SentencePiece vocabulary handles CJK (Chinese, Japanese, Korean) noticeably better than the GPT-4 generation did. But the underlying training distribution is still English-dominant, and the structural penalty has not been engineered away.</p>
<p>What this means in practice: if your customer base is Hindi-speaking and your model uses an English-trained tokenizer, you are paying roughly four to five times what an equivalent English workload costs you, for content of equivalent meaning. The vendor did not charge you more per token. The exchange rate did the charging.</p>
<h2>The AI token fees you cannot see on the menu</h2>
<p>Once you accept that the token is the currency and the rate is the vendor's, the rest of the LLM bill becomes simultaneously more legible and stranger.</p>
<p><strong>Reasoning tokens.</strong> Newer models think before they answer, and the thinking counts. OpenAI's o-series, <a href="https://api-docs.deepseek.com/news/news260424">DeepSeek's V4</a> in its thinking mode, Anthropic's extended-thinking models (Opus 4.7 by default now runs its <code>xhigh</code> effort tier in Claude Code), and Gemini's thinking modes all generate internal chain-of-thought that gets billed at the output rate. <a href="https://developers.openai.com/api/docs/guides/reasoning">OpenAI exposes a count of reasoning tokens</a> in <code>output_tokens_details.reasoning_tokens</code>, though the actual chain-of-thought is summarized or hidden. <a href="https://platform.claude.com/docs/en/about-claude/models/whats-new-claude-4-7">Anthropic in Opus 4.7 omits thinking content from the response by default</a>, but the count is billed whether or not you request a summary. A 10,000-token reasoning budget on <a href="https://openai.com/index/introducing-gpt-5-5/">GPT-5.5 at $30/M output</a> costs thirty cents before the user sees a word. Most teams running translation or classification through reasoning models are paying many times what they should because nobody turned thinking off.</p>
<p><strong>Caching, which sometimes is not a discount.</strong> OpenAI applies cache discounts automatically, up to 90% off on cached input, with no write premium and no code changes required. Anthropic uses explicit <a href="https://platform.claude.com/docs/en/build-with-claude/prompt-caching"><code>cache_control</code> markers</a>: reads are 10% of base input (the deepest discount on the market), but writes cost 1.25× base on a five-minute TTL or 2× base on a one-hour TTL. <a href="https://platform.claude.com/docs/en/about-claude/pricing">Anthropic's own pricing page</a> says the math amortizes after one cache hit on the five-minute tier, or two on the hour-long one. But if your prefix, the stable front of the prompt you mark for caching, gets written and rarely re-read, caching costs you more than not caching. Gemini layers in a <a href="https://ai.google.dev/gemini-api/docs/pricing">per-hour storage fee</a> ($4.50 per million tokens cached per hour on 3.1 Pro), and the cache-read rate also doubles above 200K context, so the long-context cliff applies to caching too.</p>
<p><strong>Context cliffs.</strong> Most vendors charge a flat per-token rate across their full context window. A few do not. Gemini 3.1 Pro is $2 in / $12 out per MTok up to 200K, then $4 in / $18 out above. <a href="https://openai.com/api/pricing/">OpenAI's GPT-5.5 jumps to $10 in / $45 out above 272K input tokens</a>. Anthropic's Opus 4.6 and 4.7 are flat across their 1M window, with one caveat: there is a 1.1× surcharge if you request US-only inference routing. A RAG pipeline whose prompt-length distribution flirts with these thresholds can change cheapest-vendor depending on the day's typical input length.</p>
<p><strong>Batch.</strong> This is the one place the price card stops misrepresenting your actual cost. <a href="https://ai.google.dev/gemini-api/docs/batch-api">Google's batch API is half the standard rate</a>; OpenAI and Anthropic match. If your workload tolerates async latency, batch is the single most impactful switch you can make, more than swapping vendors, and usually more than switching models within a vendor. The number of production pipelines that are eligible for batch and not using it is alarming.</p>
<h2>What the LLM price card actually tells you</h2>
<p>Pull all of this together and the dollar-per-million-token figure on a vendor's pricing page tells you exactly one thing: the dollar cost of one million units of that vendor's specific currency at this moment for the specific model variant and inference region and effort tier and TTL choice you picked. It does not tell you the cost of doing your work. The translation from "currency" to "work" sits inside the tokenizer, the language mix of your content, your reasoning-token policy, your cache hit pattern, your batch share, and your prompt-length distribution against context cliffs.</p>
<p>The honest unit for cross-vendor comparison is not cost-per-token. It is cost-per-task: what you pay, end-to-end, for a unit of output your users would accept. The formula is:</p>
<p><em>cost_per_task = (price_per_token × tokens_per_request × (1 + reasoning_overhead) × (1 − cache_hit_rate × cache_discount) × (1 − batch_share × 0.5)) ÷ task_success_rate</em></p>
<p>Every term is measurable. Token count comes from each vendor's official counter. Reasoning overhead comes from the usage block on each response. Cache hit rate and batch share come from your own logs. Task success rate comes from your eval. The headline $/MTok is one term on the right side, not the answer to the equation.</p>
<p>Cost is not the only thing that moves. More tokens means a longer sequence, which brings more latency, more KV-cache memory, and a higher chance of crossing the 200K/272K context cliffs in ways that can change how an agent loop behaves. Tokenizer inflation lands in your latency and memory budgets, not just the bill.</p>
<h2>The state of the major LLM currencies, May 2026</h2>
<p>Here is what each vendor is actually doing under their published rate card, in the dimensions that matter for real bills:</p>
<table>
<thead>
<tr>
<th><strong>Vendor</strong></th>
<th><strong>Can you count tokens locally?</strong></th>
<th><strong>How stable is the tokenizer across versions?</strong></th>
<th><strong>Caching</strong></th>
<th><strong>Long-context cliff</strong></th>
<th><strong>Batch</strong></th>
</tr>
</thead>
<tbody><tr>
<td><strong>OpenAI</strong></td>
<td>Yes: tiktoken is open</td>
<td>Changed once: GPT-4 → GPT-4o (cl100k → o200k)</td>
<td>Automatic, ≤90% off, no write premium</td>
<td>Flat to 1M on GPT-4.1; 272K cliff on GPT-5.5 (≈2× input, 1.5× output)</td>
<td>50% off</td>
</tr>
<tr>
<td><strong>Anthropic</strong></td>
<td>No: only via count_tokens API</td>
<td>Changed 4.6 → 4.7: 1.0–1.35× per Anthropic, 1.46× measured by Willison</td>
<td>Explicit cache_control; 0.10× reads, 1.25–2× write premium</td>
<td>Flat to 1M; 1.1× surcharge on US-only inference</td>
<td>50% off</td>
</tr>
<tr>
<td><strong>Google Gemini</strong></td>
<td>Partial: Gemma 3 SentencePiece (262,144 vocab) is published</td>
<td>Differs across 1.5 / 2.x / 3.x lines</td>
<td>Explicit + per-hour storage fee; cache reads also double above 200K</td>
<td>2× input, 1.5× output above 200K on 3.1 Pro</td>
<td>50% off</td>
</tr>
<tr>
<td><strong>DeepSeek</strong></td>
<td>Yes: BBPE (byte-level BPE) published</td>
<td>V2 → V3 expanded 100K → 128K; V4 added dual thinking/non-thinking modes</td>
<td>Automatic disk cache, no write premium</td>
<td>Flat</td>
<td>Off-peak discount</td>
</tr>
<tr>
<td><strong>Meta Llama</strong></td>
<td>Yes: tokenizer.json ships with the model</td>
<td>Llama 2 → 3: 32K → 128,256</td>
<td>Host-dependent (Bedrock, Together, Groq differ)</td>
<td>Host-dependent</td>
<td>Host-dependent</td>
</tr>
<tr>
<td><strong>Mistral</strong></td>
<td>Yes</td>
<td>SentencePiece → Tekken (NeMo, Pixtral)</td>
<td>Host-dependent</td>
<td>Host-dependent</td>
<td>Host-dependent</td>
</tr>
</tbody></table>
<p>The vendors split into two groups. Open-tokenizer providers (OpenAI, DeepSeek, Meta, Mistral) let you compute cost client-side before you send the request, which is useful for budgeting, useful for routing, and useful when you are trying to A/B against another model. Closed-tokenizer providers (Anthropic, Gemini in part) require a round-trip to find out what the request will cost. That asymmetry is itself a feature of the pricing, even though it does not appear on any pricing page.</p>
<h2>Auditing your own AI currency exposure</h2>
<p>The practical version of this post is a worksheet, not a checklist. Sit with your team and answer:</p>
<ol>
<li><p><strong>What does your token actually buy?</strong> Take 50–100 real prompts from production logs. Run each through every candidate vendor's official token counter. Compare the counts. A 20% gap on your real content is normal; a 50% gap on non-English content is normal. Now multiply each count by each vendor's $/MTok and look at the result. This is the real per-call cost, not the price card cost.</p>
</li>
<li><p><strong>How much are you paying to think?</strong> For every reasoning-capable model you use, pull the reasoning-token count from the usage block. Multiply by output price. If a non-trivial fraction of your bill is thinking tokens on workloads that do not need them, such as translation, classification, extraction, or short Q&amp;A, turn thinking off. This is almost always the largest single optimization available.</p>
</li>
<li><p><strong>Does caching cost you or save you?</strong> Pull the actual ratio of cache writes to cache reads from your logs. On Anthropic, if your prefix gets written more often than it gets read, the write premium is making things worse, not better. On Gemini, work out whether the per-hour storage fee on rarely-hit caches is worth the discount on the hits.</p>
</li>
<li><p><strong>Where in your prompt-length distribution do the cliffs sit?</strong> Histogram your input lengths against 200K (Gemini) and 272K (GPT-5.5). If the 90th percentile is anywhere near those numbers, you are paying tier-2 rates more often than you realize.</p>
</li>
<li><p><strong>What fraction of your traffic could be batch?</strong> If 30% of your work is async-tolerant and you are not batching it, you are leaving ~15% of your total bill on the table.</p>
</li>
<li><p><strong>What's your real success rate per dollar?</strong> A cheaper-per-token model that fails your eval 20% more often is more expensive in production. Build the cost-per-accepted-task number. Reorder vendor preferences accordingly.</p>
</li>
</ol>
<h2>Why this state of affairs persists</h2>
<p>It is tempting to read all of the above as vendors being deliberately opaque. Mostly, they are not. The Opus 4.6 → 4.7 tokenizer change was, on the merits, the right engineering trade for downstream quality. Anthropic's cache write premium reflects real storage and warm-cache costs. Gemini's 200K cliff is honestly disclosed. OpenAI's automatic caching is genuinely user-friendly. Every individual decision makes sense on its own.</p>
<p>What is missing is a market norm requiring vendors to publish their tokenizers, announce changes, and standardize the comparison unit. Until that norm exists, and there is no commercial incentive for any vendor to ship it unilaterally, the dollar-per-million-token figure on a pricing page will continue to be the most quoted and least informative number in the industry.</p>
<p>The fix lives on the buyer side. Track cost-per-task, not cost-per-token. Tokenize your real prompts before you migrate. Route by workload, not by vendor. Audit reasoning overhead like you audit any other line item. Treat the price card as one input to a model of your true unit economics, not the model itself.</p>
<p>And when a thread titled "Opus 4.7 to 4.6 Inflation is ~45%" climbs the front page of Hacker News on the day after a model launch, check the tokenizer before you check the price card.</p>
<img src="/blog/the-great-token-heist-of-26/78d92d86-be82-4f8e-bad2-b499db01ede0.png" alt="Pixel-art illustration of a masked figure with hands raised being arrested by a police officer beside a spilled bag of tokens, outside a neon-lit arcade called Tokens Arcade, evoking a heist over token pricing." style="display:block;margin:0 auto" />

<hr />
<p><em>— Written from the Altimate team. We build <a href="https://altimate.ai/"><em>Altimate-Code</em></a>, an agentic data engineering platform for enterprises. If you're working through this kind of vendor economics for your own stack, we'd like to compare notes.</em></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/the-great-token-heist-of-26/a164d003-f725-473b-a6e6-a026ab05d821.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>The Correctness Layer</title>
    <link>https://altimate.ai/blog/the-correctness-layer-in-ade</link>
    <guid isPermaLink="true">https://altimate.ai/blog/the-correctness-layer-in-ade</guid>
    <pubDate>Wed, 20 May 2026 17:32:37 GMT</pubDate>
    <dc:creator>Syed Haider</dc:creator>
    <dc:creator>Surya Iyer</dc:creator>
    <category>agentic AI</category>
    <category>data-engineering</category>
    <category>altimateAI</category>
    <description>We started altimate-code with one goal: build a harness that data engineers could actually trust with their pipelines and platforms. The first thing that became clear is that LLMs are the wrong tool f</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/the-correctness-layer-in-ade/1871c39e-0eee-4e5f-ba3c-fbf6eb835a79.jpg" alt="The Correctness Layer" /></p>
<p>We started <a href="https://altimate.ai/products/altimate-code">altimate-code</a> with one goal: build a harness that data engineers could actually trust with their pipelines and platforms. The first thing that became clear is that LLMs are the wrong tool for half of that job. Two queries either are or are not semantically equivalent. A lineage edge either does or does not exist. A row-level diff is either correct or not. None of those are creative questions, and a probability distribution is the wrong answer to any of them.</p>
<p>Over the past year, we have built a three-layer architecture that puts the LLM in charge of the work it is good at (strategy, intent-parsing, code generation) and a deterministic Rust and TypeScript stack underneath for everything that has to be reproducible. The split (detailed later) is what gets us to the top of the ADE and the <a href="https://ucbepic.github.io/DataAgentBench/">DAB</a> benchmarks, and more importantly, what makes the result repeatable on someone else's hardware.</p>
<p>This post walks through how the split actually works: where the boundary sits, the three operations we moved out of the model entirely, and what thousands of structured benchmark traces taught us about where agents actually fail.</p>
<h2>LLMs are probability distributions</h2>
<p>Run the same prompt through the same model twice, and you'll get two different answers. That's not a bug. It's the substrate. Language models sample from a probability distribution every time they generate a token, and the distribution is shaped — sometimes broadly — by sampling temperature[1], prompt-cache state, and the internal nondeterminism of large batched inference on shared hardware[2].</p>
<p>For creative work, this is exactly what you want. Drafting a SQL query, summarizing a result, recovering from an unexpected error — these are open-ended tasks with many acceptable answers, and probabilistic output is what makes the model useful.</p>
<p>For correctness, it's a liability. "Are these two queries semantically equivalent?" has one right answer. "What columns does this output project from this source?" has one right answer. "Are these two tables byte-equal?" has one right answer. When a probabilistic system answers a deterministic question, you can't cache the answer (it might be different next time), you can't debug it (a single sample tells you nothing about the distribution), and you can't benchmark it (a single pass-rate is a coin flip away from a different number).</p>
<h2>What this looks like on a real benchmark</h2>
<p>We took one task off the <a href="https://github.com/dbt-labs/ade-bench">ADE benchmark</a>, a dbt refactor called <code>asana004</code>, and ran it through altimate-code three times with the same model, the same prompt, and the same starting state. The agent passed it once and failed it twice. Across the three runs, dbt's test counts came back as 6/6, then 4/6, then 5/6.</p>
<p>If you are building a data-engineering agent, that is the problem you have to design around. You cannot trust a system whose output is intrinsically random. You cannot cache it. You cannot reproduce it. You cannot debug it. And you cannot reliably benchmark it.</p>
<h2>The comfortable go-to (but wrong) answer</h2>
<p>The instinct is to make the model itself more deterministic. Lower the temperature. Tighten the prompts. Introduce multi-agent voting. Run test-time consensus across N samples. Vendors in the data space are responding to this demand, and their responses make sense on some level. Temperature=0 is easy (provides marginal repeatability at the cost of much of the agent's ability to explore or recover from mistakes), ensemble voting is well-understood, and prompt engineering keeps getting better.</p>
<p>This works, partially. Lower temperature reduces variance but does not eliminate it. Multi-agent voting trades dollars for variance reduction but never reaches zero. None of it changes the fundamental shape of the problem. The model is a probability distribution, and you are sampling from it.</p>
<h2>So stop fixing the model</h2>
<p>The LLM should stay out of the correctness layer.</p>
<p>That is the bet behind altimate-code. The LLM stays in charge of strategy, intent-parsing, and code generation, which are the genuinely creative parts of the work. Everything else runs in a deterministic Rust and TypeScript layer underneath: SQL validation, schema diffing, query equivalence, lineage extraction, cross-database join inference, data-parity diffing. The agent does not decide whether two queries are equivalent. It calls a function that proves they are.</p>
<p>I keep coming back to this framing because it is the only one I have seen that survives contact with a real benchmark. Once you have watched the same prompt produce three different answers, you stop wanting the model to be more reliable. You start wanting it to be less involved.</p>
<blockquote>
<p><em>Once you have watched the same prompt produce three different answers, you stop wanting the model to be more reliable. You start wanting it to be less involved.</em></p>
</blockquote>
<h2>Three layers</h2>
<p>altimate-code's architecture has three layers. The decision that matters most is where the boundary between them sits.</p>
<img src="/blog/the-correctness-layer-in-ade/60f9ccf1-3568-45c0-a913-2406eb75fd21.png" alt="Diagram of altimate-code's three-layer architecture: a probabilistic LLM agent (intent, strategy, codegen, summarize, recovery) sits above a deterministic TypeScript harness (dispatcher, registry, skills, helpers, hasNativeHandler, join inference), which calls via napi-rs bindings into a deterministic Rust core (altimate-core) running 34 SQL operations across 4,600+ tests and 34 dialects, validating 1,000 queries in 30ms." style="display:block;margin:0 auto" />

<p>The <strong>deterministic core</strong> is a Rust library (<code>altimate-core</code>) that exposes 34 SQL operations as pure functions over abstract syntax trees and schemas. It parses, validates, transpiles, fingerprints, checks equivalence, diffs schemas, classifies PII, extracts column lineage, and diffs rows across warehouses. Every operation runs sub-millisecond. Our benchmark battery validates 1,000 SQL queries in 30 ms and lints 1,000 queries in 250 ms. All of it is reproducible. All of it is zero-cost at the LLM API layer because it never touches the model. The engine carries 5,700+ Rust tests, runs on a single sqlparser-based AST representation, and targets 34 SQL dialects, from Postgres and Snowflake to Trino and TSQL.</p>
<p>The <strong>deterministic harness</strong> is the TypeScript code that runs the agent. A dispatcher maintains a registry of native handlers. When the agent calls <code>altimate_core.transpile</code>, the dispatcher routes the call to compiled Rust via napi-rs bindings, not to the model. Skills (encoded playbooks) prescribe step orderings. Helpers like dialect-aware identifier quoting prevent whole classes of "the model generated almost-correct SQL" failures.</p>
<p>The <strong>probabilistic agent</strong> is the LLM. It reads task descriptions, plans, picks tools, writes drafts, summarizes results, and recovers from failures. It sits in the creative layer, not the correctness layer.</p>
<p>The agent does not always know which layer it is calling into. But it always can know. A <code>hasNativeHandler</code> check classifies a tool call as deterministic or not before it runs. That asymmetry is most of the value.</p>
<p>Consider what happens when the agent calls <code>altimate_core.track_lineage</code>. The tool wrapper packages the arguments. The dispatcher looks up the handler registered for that method name. The handler normalizes the agent-supplied schema, accepting either the flat <code>{table: {col: TYPE}}</code> shape or the nested <code>SchemaDefinition</code> shape, and converts both to a canonical form before passing through. The napi-rs binding calls into compiled Rust. The Rust engine builds the lineage graph and returns it. The tool formats the output for the agent. From the agent's perspective, it called a tool and got back lineage. From the architecture's perspective, every step is deterministic, including the schema normalization, which the harness does, not the model.</p>
<img src="/blog/the-correctness-layer-in-ade/fffbede3-6ad9-46d4-ad55-a4ccc5307558.png" alt="Sequence diagram of a tool call crossing the agent/harness boundary in seven steps: the LLM agent calls a tool, a TypeScript wrapper packages the arguments, a dispatcher looks up the handler, the handler normalizes the schema, hasNativeHandler() routes it to compiled Rust, a lineage engine builds the graph, and the formatted result returns to the agent, captioned &quot;the agent does not always know which layer it is calling into, but it always can know.&quot;" style="display:block;margin:0 auto" />

<h2>What this looks like in practice</h2>
<p>I will walk through three concrete operations, because adjectives do not earn the claim.</p>
<p>Take two queries written differently but doing the same thing:</p>
<pre><code class="language-sql">-- Writer A
SELECT id FROM users
WHERE status = 'active'
  AND created &gt; NOW() - INTERVAL 30 DAY

-- Writer B
SELECT id FROM users
WHERE created &gt; DATE_SUB(NOW(), INTERVAL 30 DAY)
  AND status = 'active'
</code></pre>
<p><code>altimate_core.checkEquivalence</code> proves these are semantically identical without running either of them. The comparison happens on parsed ASTs against the provided schema. It handles predicate reordering, equivalent date-arithmetic functions, and identical column projection. The result is a boolean plus a confidence score, not a sample of an LLM's opinion. Downstream, that means refactor verification, migration safety checks, and regression tests that confirm a query's behavior did not change. None of it requires a live database or a model that "looks at" the queries.</p>
<p>Dialect translation is the same story. <code>transpile(sql, fromDialect, toDialect)</code> takes a Snowflake query and produces a BigQuery one (or BigQuery to Postgres, or Postgres to Databricks) via <code>sqlparser-rs</code> and dialect-specific AST transforms. It runs sub-millisecond. The agent never has to memorize that Snowflake's <code>IFF(cond, a, b)</code> becomes <code>CASE WHEN cond THEN a ELSE b END</code> in ANSI dialects. We have measured the LLM-direct alternative. The failure mode is not "wrong output." It is almost-right output that compiles in dev and breaks in prod when an edge-case function shows up. Determinism here is not about speed. It is about coverage. The AST transform handles every case the parser handles, not every case the model happens to have seen in training.</p>
<p><code>schemaFingerprint(schema)</code> returns a SHA-256 hash of a serialized schema. That is the entire interface. The hash is what makes caching trustable. When the agent is validating many queries against a large schema, we compute the fingerprint once and use it as a cache key. Identical schemas produce identical hashes, and the cache hits. An LLM-derived "is this schema the same?" cannot offer that guarantee. A model might say "yes" twice and "no" the third time, and you would have to debug whether the third answer was the wrong one. The fingerprint also acts as the index for progressive context compression. The core exposes five disclosure levels: fingerprint-only, table list, column names (the default), full detail for relevant tables only, and the complete schema - and the agent picks the level it needs for the question at hand. The selection is deterministic, the cache key is deterministic, and nothing about either step is the LLM's opinion of "is this schema close enough?"</p>
<p>Reliability and performance turn out to be the same lever pulled twice. Determinism is what makes the cache safe. The cache is what makes the agent fast. You cannot get the second without the first.</p>
<h2>Case study: cross-database join inference</h2>
<p>The cleanest illustration of this principle is a tool we shipped in late April 2026. <a href="https://github.com/AltimateAI/altimate-code">altimate-code</a> is often connected to several warehouses at once (Snowflake, BigQuery, Postgres), and the agent needs to suggest cross-database joins. One warehouse calls an entity <code>customer_42</code>. Another calls it <code>cust_42</code>, or <code>c-42</code>, or <code>42</code>. Naming and formatting disagree, so naive column-name matching fails.</p>
<p>A pure-LLM approach to this is straightforward to describe and unreliable to ship. You prompt the model with the schemas and ask "which columns join across these DBs?" It works on the cases the model has seen. It hallucinates plausible-but-wrong matches on the cases it has not. Different runs return different rankings.</p>
<img src="/blog/the-correctness-layer-in-ade/180cf068-ad07-4493-90b9-5261db1239dc.png" alt="Four-step algorithm for matching join keys across databases without hallucination: sample about 50 string values per column from Snowflake and Postgres, compute the longest common prefix, strip the prefixes and intersect the remaining suffixes, then rank by overlap size, ending in a worked example matching Snowflake's businessid_42 to Postgres's businessref_42 as a candidate with score 1.0." style="display:block;margin:0 auto" />

<p>The deterministic version is about 400 lines of TypeScript. The algorithm is small enough to summarize:</p>
<ol>
<li><p>From each connection, sample ~50 string values per column.</p>
</li>
<li><p>Compute the longest common prefix per column, trimmed back to the last <code>_</code>, <code>-</code>, or <code>:</code> separator. So <code>["businessid_42", "businessid_43", …]</code> produces prefix <code>"businessid_"</code>. Sequences without a separator are rejected.</p>
</li>
<li><p>For each pair of columns from different databases, require distinct non-empty prefixes (so the prefix actually distinguishes the two columns), strip the prefixes, and compute the set intersection of suffixes.</p>
</li>
<li><p>Emit a candidate when the suffix overlap is non-empty. Rank by overlap size, then by <code>overlap / min(left, right)</code>.</p>
</li>
</ol>
<p><code>businessid_42</code> on one DB and <code>businessref_42</code> on another both reduce to suffix <code>42</code>. The algorithm pairs them with score 1.0 and reports the rule as "shared suffix after stripping distinct prefixes."</p>
<p>The function that computes the common prefix is fewer than 30 lines. It walks character-by-character and trims back to the last separator. Identical inputs produce identical outputs, every time, in any order, on any machine. We can ship the algorithm to a customer and tell them exactly what will happen.</p>
<h2>Case study: column lineage with depth tiering</h2>
<p>Lineage is the question of where each output column comes from. Given a query with joins, CTEs, and expressions like <code>SUM(o.amount + o.tax)</code>, you need to know which upstream columns flow into each output. An LLM can answer this question in plain English. It cannot answer it precisely enough to chain operations on. Agents that act on lineage need exact edges, not summaries.</p>
<p><code>altimate_core.column_lineage</code> does this as an AST walk. Each output column gets a list of source columns plus a transformation lens: direct projection, function call, expression, or aggregation. The walk is deterministic by construction. Subqueries and CTEs are inlined. Window functions decompose into their partition and order clauses. CASE expressions report all branches as sources.</p>
<p>The piece worth featuring is the <em>depth tiering</em>. The same engine exposes three modes:</p>
<ul>
<li><p><strong>Basic</strong>: direct source-target edges only, with minimal context.</p>
</li>
<li><p><strong>Deep</strong>: adds transformation lenses (expression, function, aggregation), confidence scores, and the internals of every CTE the lineage flows through.</p>
</li>
<li><p><strong>Full</strong>: transitive closure across multi-query chains, plus indirect dependencies from <code>WHERE</code>, <code>JOIN</code>, and <code>GROUP BY</code> predicates that affect row selection.</p>
</li>
</ul>
<p>The agent picks the depth it needs for the question at hand. The classification of what counts as "basic" versus "deep" is encoded. It is not an LLM call disguised as one. The pattern repeats: every level of detail an agent can ask for is a level the engine knows how to produce, and the choice between them is a parameter, not a guess.</p>
<p>The same principle controls the output format. Lineage, like every operation in altimate-core, ships with two formatters: a verbose one for humans, and a compact one optimized for an agent's context window. Compact is the default. The agent gets a headline token (<code>LINEAGE | 5 cols, 3 tables, depth=basic</code>) followed by structured <code>column &lt;- source</code> rows it can parse without spending tokens on prose. Depth chooses how much detail; the format chooses how that detail is encoded; both compound across a trajectory of hundreds of tool calls.</p>
<h2>Case study: data parity</h2>
<p>A different shape of problem: prod was migrated to a new warehouse, and we need to know whether the rows match.</p>
<p>The naive answers are bad. You write a 200-line custom SQL diff query and hope you covered the edge cases, or you ask an LLM to "compare these two tables" and get an unactionable summary.</p>
<img src="/blog/the-correctness-layer-in-ade/72445e75-27a6-4720-9c09-cc24d6caef39.png" alt="Diagram of the HashDiff algorithm bisecting two 10-million-row tables across Snowflake and BigQuery by checksum, recursively splitting any row range whose SHA-256 checksums disagree through levels L0 to L5 until it pinpoints the single row where the payload hash differs." style="display:block;margin:0 auto" />

<p>The engine implements two complementary algorithms. <strong>HashDiff</strong> uses bisection plus checksums for cross-database diffs. It partitions both tables, checksums each segment, recursively bisects any segment whose checksums disagree, and terminates at the row level on exactly the segments that contain mismatches. The bisection lets it pinpoint the exact rows that differ instead of scanning every row, and the module ships with 303 dedicated tests covering every dialect pair we support. <strong>JoinDiff</strong> uses a same-database <code>FULL OUTER JOIN</code> for when both tables live in the same warehouse. The cost characteristics differ. The correctness guarantee is the same.</p>
<p>The engine ships with a cooperative state-machine API. It emits the SQL it wants executed, the caller runs it, and the engine steps forward based on the result. There is no point in the loop where the engine guesses, or where its behavior depends on which LLM is in front. Given identical inputs, the diffs come out identical, every time.</p>
<p>"<em>Are these two tables byte-equal?</em>" is the antithesis of a creative task.</p>
<h2>Smaller wins, in the harness</h2>
<p>So far the story has been about the Rust core. The TypeScript harness gets the same treatment, and the wins are smaller per-instance but they compound.</p>
<p>A single function called <code>quoteIdentForDialect</code> holds the truth about identifier quoting across our supported warehouses. MySQL gets backticks, T-SQL gets brackets, and everything else gets ANSI double quotes. The LLM never has to remember which is which, because it never builds quoted SQL directly. It passes column names through tools that route through <code>quoteIdentForDialect</code>. That is not a clever optimization. It is a category of failure removed from the system. The same pattern applies to <code>EXPLAIN</code>-plan retrieval. Postgres has <code>EXPLAIN (ANALYZE, BUFFERS)</code>. Snowflake has <code>EXPLAIN USING TEXT</code>. BigQuery has no <code>EXPLAIN</code> statement at all, and you read plans from job metadata. A ~50-line decision table maps each warehouse to its plan-retrieval mechanism. The agent does not ask the model "what is the BigQuery EXPLAIN syntax?" because a tool already knows.</p>
<p>Skills are altimate-specific procedures encoded in markdown. The <code>dbt-develop</code> skill prescribes a four-step workflow: plan (check the layer and naming conventions), discover (use schema-search tools, read existing YAML), write (generate SQL with validated joins), and validate (call <code>altimate_core_validate</code>, then <code>column_lineage</code>, then <code>dbt build</code>). The skill does not replace the LLM. It constrains where the LLM is creative and where the harness is prescriptive. Our trace data shows skill-driven sessions complete in fewer turns and with fewer tool errors than ad-hoc sessions on the same task.</p>
<p>None of these are individually dramatic. Cumulatively they are the difference between an agent that almost works and one you can deploy.</p>
<h2>What thousands of session traces taught us</h2>
<p>We ran the ADE-Bench DuckDB benchmark against altimate-code and captured structured traces for every session. Our benchmark topping score was 74.4%.<a href="2">[2]</a> The traces are where the interesting story lives.</p>
<p>Failure has three distinct causes, and they require three different responses.</p>
<p>The first cause is stochastic LLM noise. Two airbnb tasks (<code>airbnb005</code>, <code>airbnb006</code>) failed the original baseline but then passed all three reruns. <code>asana004</code> (the task from the opening) passed once out of three. The inputs are the same, the outputs differ, and the cause is intrinsic to the model. There is nothing to fix here except the model.</p>
<p>The second cause is deterministic capability gaps. <code>asana003</code> failed at exactly 16 of 17 dbt tests, every single time across reruns. Same failure mode every time, with the same dbt-test count. The agent's output has a stable bug we can investigate and fix.</p>
<p>The third cause is bench-fixture bugs. Three airbnb tasks (<code>airbnb001</code>, <code>airbnb002</code>, <code>airbnb008</code>) failed reproducibly, but the root cause was a pre-existing bug in the bench's own dbt incremental models: a broken <code>is_incremental()</code> filter that collapses the date series to a single row, so the <code>LAG</code> window function in the MoM/WoW aggregation returns <code>NULL</code> on rerun and overwrites the correct first-run values. This is not an altimate-code problem. The maintainers shipped a test-setup workaround in dbt-labs/ade-bench#106, but the model SQL itself is still broken — fix proposed in <a href="https://github.com/dbt-labs/ade-bench/pull/145">dbt-labs/ade-bench#145</a>.</p>
<p>From the outside, all three look identical. The test failed. Only the deterministic substrate (structured traces, reproducible reruns, exact dbt-test counts) lets us separate them. Without that, we would be guessing about what is actually wrong, and our improvement work would be aimed at the wrong target.</p>
<h2>Where the market is</h2>
<p>Most coding agents in the field are general-purpose. Cursor, Cline, Claude Code, Codex, and GitHub Copilot Workspace all sit in that category. They are built for the generic developer-with-a-text-editor case. When a data engineer uses them to write a Snowflake query or refactor a dbt model, the tools treat SQL like any other code. Text goes in, text comes out, and the model decides. There is no deterministic substrate for the data-specific operations because there does not need to be one for general coding.</p>
<p>The data-native AI products (dbt Cloud's AI features, in-warehouse LLMs like Snowflake Cortex) are closer to the right surface area, but they are still primarily LLM wrappers with a different UI. They generate SQL. They do not prove SQL.</p>
<p>Our bet is that for data engineering specifically, the LLM-as-creative-layer / code-as-correctness-layer split is the right architecture, and that the deterministic infrastructure is where the actual moat lives. Models will get better. APIs will get cheaper. Prompt techniques will improve. None of that changes the calculus on whether two queries are semantically equivalent, or whether a cross-warehouse data diff is correct. Those are facts about code and data, decidable by code that operates on code and data.</p>
<p>altimate-code currently sits at number one on the <a href="https://altimate.ai/benchmarks">ADE benchmark</a>, ahead of Claude Code, Cortex Code CLI, and dbt Labs, by a wide margin. It also recently scored #1 on the <a href="https://ucbepic.github.io/DataAgentBench/">Berkeley EPIC Data Lab DAB</a> (Data Agent Benchmark)</p>
<h2>What is still LLM territory</h2>
<p>It would be dishonest to claim we replaced the LLM. We did not, and we will not. The LLM still owns intent-parsing ("refactor the <code>asana__project</code> model into an intermediate one that…"), code generation, description-writing for dbt model YAML, and strategy under uncertainty. When a build fails for reasons that are not immediately classifiable, the model is what figures out the next move.</p>
<h2>What's next</h2>
<p><em><strong>Comparative trace analysis across models</strong></em>. Sonnet, Opus, DeepSeek v4 pro, Kimi K2, and Qwen 2.5 Coder all run through the same altimate-code stack on the same benchmarks. What we don't yet have is a systematic comparison of how they differ on data-engineering tasks — which failure modes are model-specific vs architecture-specific, which models pair best with which skills, where the cost-quality frontier sits per task category. The traces are captured; we’ll share the analysis soon.</p>
<p><em><strong>Harness resilience</strong></em>. The same trace data surfaces a handful of harness-side next moves. We are making the agent loop resilient to truncated model outputs from streaming providers. We are adding a per-generation timeout so a hung request does not tie up a worker for 25 minutes. We are detecting when the agent has fallen into a same-tool-same-argument loop and forcing a replan. Each one is a place where the harness can be more deterministic about how it handles a probabilistic model.</p>
<p><em><strong>Cost / quality frontier mapping</strong></em>. Our DeepSeek v4 pro run on DAB scored 0.5693 stratified Pass@1 for $9 of inference, ahead of the then benchmark leader Pi's Opus 4.6 submission — is one data point in a larger frontier. We’re in touch with DAB maintainers to add this run to the leaderboard. The natural follow-up is systematic: across the model lineup we already run through altimate-code, at what cost does each model fall below a quality threshold, broken out by task category (SQL refactor, dialect translation, lineage extraction, cross-DB joins)? The architecture is model-agnostic; the right backbone for a given customer workload may be category-dependent.</p>
<h2>Conclusion</h2>
<p>The claim is narrower than "no LLM." It is that the LLM stays out of correctness. The probabilistic layer handles probabilistic work. The deterministic layer handles deterministic work. The boundary is where the payoff lives.</p>
<p>Probabilistic models are a remarkable substrate for the things they are good at: language, intent, creativity. They are a poor substrate for proof, equivalence, and reproducibility. The architectural question for any agent in this space is not "can we use the LLM for X?" It is <em>"should we, and if not, what should we use instead?"</em></p>
<p>For the data-engineering work altimate-code does, the answer is the correctness layer underneath: a deterministic core in Rust, a deterministic harness in TypeScript, with the LLM kept exactly where it belongs.</p>
<p><a href="1">[1]</a>: <a href="https://platform.claude.com/docs/en/api/messages/create#create.temperature">Claude API Docs</a></p>
<p><a href="2">[2]</a>: <a href="https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/">Defeating Nondeterminism in LLM Inference</a></p>
<p><em>altimate-code is an open source project:</em> <a href="https://github.com/AltimateAI/altimate-code"><em>github.com/AltimateAI/altimate-code</em></a><em>.</em><br /><em>If you are building in this space and want to compare notes, reach out by email at</em> info-at-altimate.ai*.*</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/the-correctness-layer-in-ade/1871c39e-0eee-4e5f-ba3c-fbf6eb835a79.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Blast Radius Analysis Using Altimate Code</title>
    <link>https://altimate.ai/blog/blast-radius-analysis-using-altimate-code</link>
    <guid isPermaLink="true">https://altimate.ai/blog/blast-radius-analysis-using-altimate-code</guid>
    <pubDate>Mon, 18 May 2026 13:22:09 GMT</pubDate>
    <dc:creator>Muhammad Anas Farooqui</dc:creator>
    <category>altimate-code</category>
    <category>Data pipelines</category>
    <category>dbt</category>
    <category>data-engineering</category>
    <category>snowflake</category>
    <category>devtools</category>
    <category>#ai-tools</category>
    <description>What is Blast Radius
Blast radius refers to the potential extent of damage.
For example, before you knock down a wall in your house, you want to know if there&apos;s plumbing behind it, electrical wiring w</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/blast-radius-analysis-using-altimate-code/872f1689-fd5d-494d-b1b9-cf001d92f029.png" alt="Blast Radius Analysis Using Altimate Code" /></p>
<h2>What is Blast Radius</h2>
<p>Blast radius refers to the potential extent of damage.</p>
<p>For example, before you knock down a wall in your house, you want to know if there's plumbing behind it, electrical wiring within it, or if it's holding up the floor above.</p>
<p>Same idea with data. Before you rename a column, change a formula, or update a filter, you need to know what depends on it. That could include downstream models, dashboards, reports, or other workflows.</p>
<hr />
<h2>Need for Blast Radius Analysis</h2>
<p>Often when you rename a column and push it to production, everything seems fine. Two days later, finance pings you on Slack: the weekly revenue dashboard has been broken since Tuesday.</p>
<p>You dig in. The column you renamed was referenced in three other models. One of those models feeds a Tableau workbook. That field is the denominator in the revenue metric on the CFO's dashboard.</p>
<p>Nobody documented any of this. The dependencies existed in the relationships between systems, invisible until something broke. This is the blast radius problem.</p>
<p><a href="https://docs.altimate.sh/getting-started/">Altimate Code</a> fixes this. Before any change goes through, it maps out the full impact automatically. It produces a detailed blast radius report (what will break, what's safe, what needs someone to sign off) and also performs the changes.</p>
<p>I ran a workflow using Altimate Code to verify this.</p>
<hr />
<h2>The workflow: renaming <code>total_cents</code> to <code>gross_revenue_cents</code></h2>
<p>I ran this on my open-source <a href="https://github.com/altimateanas/ecommerce_demos">CartWave E-commerce dbt project</a>, a real analytics codebase with staging models, intermediate transformations, mart tables, and a semantic layer on Snowflake.</p>
<p><code>stg_orders</code> is a simple staging model that reads raw order data and explicitly picks the columns that are needed. The finance team wants us to rename <code>total_cents</code> to <code>gross_revenue_cents</code> to align with GAAP terminology.</p>
<h3>The prompt</h3>
<p><strong>I gave Altimate Code this prompt:</strong></p>
<blockquote>
<p><em>"Rename the column total_cents to gross_revenue_cents in stg_orders as the finance team wants to align with GAAP terminologies. Before performing the changes, show me the blast radius of the same."</em></p>
</blockquote>
<img src="/blog/blast-radius-analysis-using-altimate-code/80e6c164-2932-4c78-bc7e-cf795dc17933.png" alt="Altimate Code is an agentic harness for data engineering." style="display:block;margin:0 auto" />

<p><em>One column, one rename. It should have been straightforward, but it wasn't.</em></p>
<hr />
<h3>What Altimate Code did</h3>
<p>After receiving the prompt, Altimate Code ran through a series of steps before changing a single line of code. Here's what happened, in order.</p>
<div class="blog-embed"><iframe src="https://www.youtube.com/embed/Npf7fHK43-k" title="YouTube video player" loading="lazy" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>

<hr />
<p><strong>Step 1: It loaded the</strong> <code>dbt-analyze</code> <strong>skill and scanned the project.</strong></p>
<p>Altimate Code started by tracing the dependencies. It read the model SQL, searched every file in the project for references to <code>stg_orders</code>, and checked YAML config files for column-level references.</p>
<p>Within seconds it found five files that depend on <code>stg_orders</code>:</p>
<img src="/blog/blast-radius-analysis-using-altimate-code/9fdf62f6-a929-471d-98e9-a77ce73c98e3.png" alt="Terminal output listing six files requiring changes after a column rename, including staging, intermediate, and semantic layer files, with a note that downstream mart models are safe because they reference a derived column name." style="display:block;margin:0 auto" />

<table>
<thead>
<tr>
<th>#</th>
<th>File</th>
<th>What it is</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td><code>int_order_enriched.sql</code></td>
<td>Combines order data with customer info</td>
</tr>
<tr>
<td>2</td>
<td><code>int_customer_lifetime.sql</code></td>
<td>Calculates lifetime value per customer</td>
</tr>
<tr>
<td>3</td>
<td><code>mart_return_analysis.sql</code></td>
<td>Report table for analyzing returns</td>
</tr>
<tr>
<td>4</td>
<td><code>sem_orders.yml</code></td>
<td>Defines business metrics like "total revenue"</td>
</tr>
<tr>
<td>5</td>
<td><code>_staging.yml</code></td>
<td>Documents what each column means</td>
</tr>
</tbody></table>
<p>Five files depend on this model. But how many of them actually use the column we're renaming? That's the question that matters.</p>
<hr />
<p><strong>Step 2: It checked each file for column-level references to</strong> <code>total_cents</code><strong>.</strong></p>
<p>Altimate Code checked more than whether a file depended on <code>stg_orders</code>. It opened each downstream file and looked for direct references to <code>total_cents</code>.</p>
<p>Here's what it found:</p>
<img src="/blog/blast-radius-analysis-using-altimate-code/c50f73df-6320-4fed-8fc1-a7d0d5a33a6d.png" alt="Summary table classifying the blast radius of a column rename into four categories: 4 breaking models, 2 cascading-but-safe mart models, 1 safe model, and 1 YAML doc update." style="display:block;margin:0 auto" />

<p><code>int_order_enriched.sql</code> – <strong>BREAKING</strong></p>
<p>Directly selects <code>orders.total_cents</code> on line 31:</p>
<pre><code class="language-sql">orders.total_cents,   -- directly uses the column we're renaming
</code></pre>
<p><strong>Explanation:</strong> This file asks for a column called <code>total_cents</code>. After the rename, that column won't exist anymore. The query will fail.</p>
<p><code>int_customer_lifetime.sql</code> – <strong>BREAKING</strong></p>
<p>Sums <code>total_cents</code> across all orders on line 22:</p>
<pre><code class="language-sql">sum(total_cents) as lifetime_revenue_cents,  -- adds up all order values
</code></pre>
<p><strong>Explanation:</strong> Same problem. The column disappears, the math breaks.</p>
<p><code>mart_return_analysis.sql</code> – <strong>SAFE</strong></p>
<p>This one depends on <code>stg_orders</code> but only uses <code>customer_id</code> and <code>order_date</code>:</p>
<pre><code class="language-sql">orders.customer_id,   -- doesn't touch total_cents
orders.order_date,    -- doesn't touch total_cents
</code></pre>
<p><strong>Explanation:</strong> It never references the renamed column. No changes needed.</p>
<p><code>sem_orders.yml</code> <strong>(semantic layer)</strong> – <strong>BREAKING</strong></p>
<p>Two metric definitions reference <code>total_cents</code> by name in their formulas:</p>
<pre><code class="language-yaml">measures:
-name: total_revenue_cents
agg: sum
expr: total_cents          # references the column by name

-name: avg_order_value_cents
agg: average
expr: total_cents          # references the column by name
</code></pre>
<p><strong>Explanation:</strong> This is the one that would have bitten me. The semantic layer is a YAML config file, not SQL. It doesn't show up if you're just grepping through <code>.sql</code> files. But if you rename the column and forget to update these metric definitions, every dashboard using "total revenue" or "average order value" breaks silently.</p>
<hr />
<p><strong>Step 3: It traced the impact further downstream.</strong></p>
<p>Altimate Code didn't stop at the first layer. It followed the chain: if a breaking model feeds another model, that downstream model could be affected too.</p>
<img src="/blog/blast-radius-analysis-using-altimate-code/27757262-64fd-4a02-941d-cf646a9095da.png" alt="Blast radius report for renaming total_cents to gross_revenue_cents in stg_orders, showing the changed model's dependency tree with each downstream model marked BREAKING, CASCADING, or SAFE." style="display:block;margin:0 auto" />

<p>Two mart tables sit downstream of <code>int_customer_lifetime</code>: <code>mart_customer_360</code> (full customer profiles, contains PII) and <code>mart_customer_cohorts</code> (customer segmentation). But neither one references <code>total_cents</code> directly. They use a derived column called <code>lifetime_revenue_cents</code>, which <code>int_customer_lifetime</code> produces from <code>total_cents</code> and then passes downstream under its own name.</p>
<p>Think of it like fixing a pipe in the basement. The faucets upstairs keep working as long as the pipe gets repaired properly. These two marts don't need code changes, they just need <code>int_customer_lifetime</code> to be fixed first.</p>
<p>One thing worth noting: <code>mart_customer_360</code> is tagged <code>compliance: 'CCPA / GDPR'</code> and <code>contains_pii: true</code>. It doesn't need code changes here, but in a governed environment, you still want to know that a compliance-tagged table sits in the blast radius.</p>
<hr />
<p><strong>Step 4: It presented the full blast radius report.</strong></p>
<p>Altimate Code assembled everything into a single view:</p>
<img src="/blog/blast-radius-analysis-using-altimate-code/c12bdf06-d31e-4360-a6d7-cea47f7074fe.png" alt="Detailed breakdown table listing each of the eight affected files, its type, impact classification (rename, breaking, safe, or cascading), and the specific line and code change involved." style="display:block;margin:0 auto" />

<table>
<thead>
<tr>
<th>#</th>
<th>File</th>
<th>What it is</th>
<th>Impact</th>
<th>Details</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td><code>stg_orders.sql</code></td>
<td>The model being changed</td>
<td>RENAME</td>
<td><code>total_cents</code> becomes <code>gross_revenue_cents</code></td>
</tr>
<tr>
<td>2</td>
<td><code>_staging.yml</code></td>
<td>Column documentation</td>
<td>RENAME</td>
<td>Update column name and description</td>
</tr>
<tr>
<td>3</td>
<td><code>int_order_enriched.sql</code></td>
<td>Order enrichment model</td>
<td>BREAKING</td>
<td>Directly references <code>orders.total_cents</code></td>
</tr>
<tr>
<td>4</td>
<td><code>int_customer_lifetime.sql</code></td>
<td>Customer lifetime value</td>
<td>BREAKING</td>
<td>Uses <code>sum(total_cents)</code> in a calculation</td>
</tr>
<tr>
<td>5</td>
<td><code>mart_return_analysis.sql</code></td>
<td>Return analysis report</td>
<td>SAFE</td>
<td>Uses <code>stg_orders</code> but never touches <code>total_cents</code></td>
</tr>
<tr>
<td>6</td>
<td><code>mart_customer_360.sql</code></td>
<td>Customer profile (PII)</td>
<td>CASCADING</td>
<td>Safe once <code>int_customer_lifetime</code> is fixed</td>
</tr>
<tr>
<td>7</td>
<td><code>mart_customer_cohorts.sql</code></td>
<td>Customer segmentation</td>
<td>CASCADING</td>
<td>Safe once <code>int_customer_lifetime</code> is fixed</td>
</tr>
<tr>
<td>8</td>
<td><code>sem_orders.yml</code></td>
<td>Business metric definitions</td>
<td>BREAKING</td>
<td>Two metrics reference <code>total_cents</code> by name</td>
</tr>
</tbody></table>
<p><strong>The bottom line: Five files need changes. Three are safe.</strong></p>
<p>Then the agent asked me:</p>
<blockquote>
<p><em>"I've identified 6 files that need changes across 3 layers (staging, intermediate, semantic). The 2 mart models downstream are safe because they reference derived column names. Shall I proceed with the rename?"</em></p>
</blockquote>
<img src="/blog/blast-radius-analysis-using-altimate-code/d24768f8-dcc5-40e0-abb6-d49f04bafbb8.png" alt="Interactive prompt showing Altimate Code asking whether to proceed with the rename across all six affected files, with options to proceed, stop at the analysis, or type a custom answer." style="display:block;margin:0 auto" />

<p>It didn't just run ahead. It stopped, showed me everything, and waited for the go-ahead.</p>
<hr />
<p><strong>Step 5: I approved. It applied all changes at once.</strong></p>
<p>After I said yes, Altimate Code updated all five files in a single pass. No partial updates, no window where half the models use the old name and half use the new one.</p>
<img src="/blog/blast-radius-analysis-using-altimate-code/2ec8b3e5-3cfc-4194-95c2-3fcf8b27ac18.png" alt="Chat transcript showing the user approving Altimate Code's proposed rename, followed by a to-do checklist tracking each file update and the final build-and-verify step." style="display:block;margin:0 auto" />

<p><code>stg_orders.sql</code> – aliased the source column:</p>
<pre><code class="language-sql">total_cents as gross_revenue_cents,  -- raw data keeps actual source column name, downstream sees new name
</code></pre>
<p>The raw data still has a column called <code>total_cents</code>. Instead of changing the source, the staging model gives it a new name. Everything downstream sees <code>gross_revenue_cents</code> from here on.</p>
<p><code>int_order_enriched.sql</code> – updated the reference:</p>
<pre><code class="language-sql">orders.gross_revenue_cents,  -- was: orders.total_cents
</code></pre>
<p><code>int_customer_lifetime.sql</code> – updated the aggregation:</p>
<pre><code class="language-sql">sum(gross_revenue_cents) as lifetime_revenue_cents,  -- was: sum(total_cents)
</code></pre>
<p><code>sem_orders.yml</code> – updated both metric definitions:</p>
<pre><code class="language-yaml">-name: total_revenue_cents
description:"Sum of gross revenue in cents (GAAP-aligned)"
expr: gross_revenue_cents   # was: total_cents

-name: avg_order_value_cents
description:"Average order value in cents (GAAP-aligned)"
expr: gross_revenue_cents   # was: total_cents
</code></pre>
<p><code>_staging.yml</code> – updated the documentation:</p>
<pre><code class="language-yaml">-name: gross_revenue_cents
description:"Gross revenue in cents, aligned with GAAP terminology"
</code></pre>
<hr />
<p><strong>Step 6: It built the entire project to confirm nothing broke.</strong></p>
<p>Altimate Code ran <code>altimate-dbt build</code> across all thirty-four models:</p>
<img src="/blog/blast-radius-analysis-using-altimate-code/7a51f847-993b-4524-93d4-1e5ec034f8c4.png" alt="Terminal log of a full dbt project build after the rename, ending in &quot;Full build: PASS=36, WARN=0, ERROR=0 — all green!&quot; before the agent verifies column lineage." style="display:block;margin:0 auto" />

<p>Thirty-six passed. Zero errors. Every staging view, intermediate table, and mart, including the PII-tagged <code>mart_customer_360</code>, built cleanly.</p>
<hr />
<p><strong>Step 7: It verified the column lineage end to end.</strong></p>
<p>As a final check, Altimate Code traced the data flow from source to destination to confirm the rename propagated correctly:</p>
<img src="/blog/blast-radius-analysis-using-altimate-code/3db3c89b-02a5-44ed-9c56-89f7ddd41f48.png" alt="Summary confirming the rename is complete, column-level lineage is verified end to end, and listing the five files changed with their exact before-and-after edits." style="display:block;margin:0 auto" />

<p>The source column <code>TOTAL_CENTS</code> flows through the alias in staging, propagates correctly to both intermediate models, and the derived column names downstream (<code>lifetime_revenue_cents</code>) stay the same. Exactly what the blast radius report predicted.</p>
<hr />
<h2>Column Changes Are Never Just Column Changes</h2>
<p>A simple rename turned out to touch five files across three layers plus the semantic layer. Without the blast radius check, I would have updated <code>stg_orders</code>, run the build, and moved on. The semantic layer would have broken silently. Finance would have found out before I did.</p>
<hr />
<h2>How to read a blast radius report</h2>
<p>Every downstream asset gets one of four labels:</p>
<table>
<thead>
<tr>
<th>Label</th>
<th>What it means</th>
<th>What to do</th>
</tr>
</thead>
<tbody><tr>
<td><strong>BREAKING</strong></td>
<td>Directly uses the thing being changed. Will fail.</td>
<td>Update before or alongside the change</td>
</tr>
<tr>
<td><strong>CASCADING</strong></td>
<td>Depends on a breaking file, but doesn't use the changed column directly</td>
<td>Verify it works after the upstream fix. Usually no code changes.</td>
</tr>
<tr>
<td><strong>SAFE</strong></td>
<td>Depends on the changed model but never uses the specific column</td>
<td>Nothing</td>
</tr>
<tr>
<td><strong>UNKNOWN</strong></td>
<td>Can't determine impact (dynamic SQL, runtime-generated column names)</td>
<td>A human needs to look at it</td>
</tr>
</tbody></table>
<p>The report also flags compliance tags. In our case, <code>mart_customer_360</code> carries <code>compliance: 'CCPA / GDPR'</code> and <code>contains_pii: true</code>. It didn't need code changes here, but those flags make sure the right people know a compliance-tagged asset is in the blast radius.</p>
<hr />
<h2>Try it out yourself:</h2>
<p><strong>I ran this on a real project. To reproduce it:</strong></p>
<ol>
<li><p>Clone the CartWave demo project: <a href="https://github.com/altimateanas/ecommerce_demos.git">https://github.com/altimateanas/ecommerce_demos.git</a></p>
</li>
<li><p>Set up your database connection</p>
</li>
<li><p>Launch <a href="https://docs.altimate.sh/getting-started/">Altimate Code</a></p>
</li>
<li><p>Give Altimate Code the prompt "<em>Rename the column total_cents to gross_revenue_cents...</em>" from the article above</p>
</li>
</ol>
<p>It'll scan the project, map every dependency at the column level and show you a structured report before changing anything.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/blast-radius-analysis-using-altimate-code/872f1689-fd5d-494d-b1b9-cf001d92f029.png" type="image/png" />
  </item>
  <item>
    <title>We Created Data Engineering Skills for Claude Code</title>
    <link>https://altimate.ai/blog/we-created-data-engineering-skills-for-claude-code</link>
    <guid isPermaLink="true">https://altimate.ai/blog/we-created-data-engineering-skills-for-claude-code</guid>
    <pubDate>Mon, 11 May 2026 18:46:05 GMT</pubDate>
    <dc:creator>Steven Johnson</dc:creator>
    <description>Data engineering work spreads beyond SQL into lineage, tests, docs, cost, schema changes, and PII. We built skills that bring those workflows into Claude Code, covering dbt development, SQL review and</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/we-created-data-engineering-skills-for-claude-code/beb8fcfb-2ed1-4c46-ac6e-d7b964c96314.jpg" alt="We Created Data Engineering Skills for Claude Code" /></p>
<aside>
Data engineering work spreads beyond SQL into lineage, tests, docs, cost, schema changes, and PII. We built skills that bring those workflows into Claude Code, covering dbt development, SQL review and translation, data parity checks, schema migration safety, Snowflake cost analysis, PII auditing, and visualization.
</aside>

<p>Data engineering looks like software development from a distance, but the work has a different center of gravity. You still write code, review changes, and ship to production, but the real risk often lives outside the diff: downstream lineage, metric correctness, warehouse cost, schema drift, PII exposure, and whether the business can still trust the data after a change lands.</p>
<p>Most data engineering work also does not begin and end with writing SQL. A small model change can require checking upstream sources, understanding downstream impact, updating dbt docs, adding tests, comparing outputs, reviewing query performance, and making sure sensitive data is handled correctly. We created data engineering skills for Claude Code to bring those workflows into the coding agent experience, giving data teams reusable playbooks for the work they already do every day.</p>
<p>You can also access these skills through Altimate Code, our open-source LLM harness for data engineering, instead of installing each one individually in Claude Code. Altimate Code includes the skills out of the box and is ready to use with Claude:</p>
<pre><code class="language-bash">npm install -g altimate-code
</code></pre>
<p>The skills are open source, so you can use Altimate Code or browse the full set directly on GitHub: <a href="https://github.com/AltimateAI/altimate-code/tree/main/.opencode/skills">https://github.com/AltimateAI/altimate-code/tree/main/.opencode/skills</a></p>
<h2><strong>Skills as Data Engineering Playbooks</strong></h2>
<p>A skill is a reusable workflow Claude Code can load when a task calls for a specific kind of expertise. For data engineering, that means more than a prompt template. Each skill gives Claude Code guidance on what context to gather, what checks to run, what tools to use, what risks to watch for, and what kind of answer or artifact to produce.</p>
<p>For example, a SQL review skill should not only say whether a query is syntactically valid. It should look for anti-patterns, safety issues, readability problems, performance risks, and whether the query is appropriate for the warehouse or dialect. A dbt testing skill should understand model structure, schema YAML, unit test patterns, and the kinds of edge cases that usually cause production data issues.</p>
<p>The goal is to make Claude Code less dependent on one giant perfect prompt from the user. Instead of asking a data engineer to spell out every step, the skill carries the workflow: build the model, document the columns, add the tests, inspect the lineage, compare the outputs, review the SQL, and summarize what changed.</p>
<h2><strong>The Data Engineering Workflows We Covered</strong></h2>
<p>We organized the skills around the workflows data teams repeat every week: building models, reviewing SQL, validating changes, debugging warehouse issues, governing sensitive data, and communicating results. Each skill is focused on a specific job, but the real value comes from how they work together across the lifecycle of a data change.</p>
<p>The current skill set covers six areas:</p>
<ul>
<li><p>Building and maintaining dbt projects</p>
</li>
<li><p>Reviewing and improving SQL</p>
</li>
<li><p>Validating changes before they ship</p>
</li>
<li><p>Operating the warehouse</p>
</li>
<li><p>Governing data and team knowledge</p>
</li>
<li><p>Visualizing and explaining results</p>
</li>
</ul>
<hr />
<h2><strong>Building and Maintaining dbt Projects</strong></h2>
<p>The dbt skills cover the full lifecycle of a model: creating it, documenting it, testing it, understanding its downstream impact, and troubleshooting it when something breaks.</p>
<h3><strong>Creating and Changing Models</strong></h3>
<p>At it’s core, dbt is a tool that allows users to create SQL models, so we had to have a skill that creates dbt models. It is called <code>dbt-develop</code>.</p>
<p>This skill teaches Claude how to both write new dbt models and change existing ones. If you are a dbt user, you know that is not as simple as just writing SQL. You have to understand the project setup, dialect of the database, patterns across the staging, intermediate, and mart models, and the lineage of data flowing throughout the project.</p>
<h3>Documenting the Project</h3>
<p>If you are anything like me, you’ve spent days or even weeks creating an intricate dbt project that takes messy, raw data and forms it into beautiful marts that you deliver to your stakeholders. You neglect to create good documentation for your work because you created it so why would I need to write what it does?</p>
<p>A few weeks later you receive a message from a colleague asking what a specific column does, and you have no idea what the answer is. Documentation might have helped out a bit here.</p>
<p>When I say documentation, I mean going past the basic notes of <em>primary key</em> or <em>unique ID for customer.</em> Our skill, <code>dbt-docs</code>, writes documentation that will answer questions about models and columns that you might not have thought about.</p>
<p>The skill guides Claude to write about aggregations, primary and foreign keys, upstream tables, etc. Our hope is that this skill will allow you to stop answering questions about your models and columns and spend more time building more.</p>
<p><a href="https://youtu.be/PY63_Eu3Si4">https://youtu.be/PY63_Eu3Si4</a></p>
<h3><strong>Writing Tests for dbt Models</strong></h3>
<p>Before working in data, I was a teacher, so I have always loved a good test. Not the kind that exists just to make someone nervous, but the kind that makes expectations clear. A good test tells you what should happen, what matters, and where the gaps are.</p>
<p>That is exactly why tests matter in dbt. There is a special kind of confidence that comes from seeing a model run successfully. There is also a special kind of pain that comes from realizing later that the model ran successfully and still produced the wrong answer.</p>
<p>The <code>dbt-test</code> skill helps Claude Code add schema tests, unit tests, and data quality checks to dbt models. It can guide Claude Code through common checks like <code>not_null</code>, <code>unique</code>, <code>relationships</code>, and <code>accepted_values</code>, as well as custom generic or singular tests when a model needs something more specific.</p>
<p>For more complex model logic, the <code>dbt-unit-tests</code> skill goes deeper. It helps generate dbt unit tests by analyzing the model SQL, identifying upstream refs and sources, creating mock inputs, and assembling YAML that tests things like <code>CASE</code> statements, joins, window functions, null handling, aggregations, and incremental behavior.</p>
<p>The point is not to test for the sake of testing. It is to protect the assumptions your model depends on, so the next change does not quietly break the meaning of the data.</p>
<p><a href="https://youtu.be/O49qIMh2QPQ">https://youtu.be/O49qIMh2QPQ</a></p>
<h3><strong>Understanding and Fixing Impact</strong></h3>
<p>dbt changes have a habit of traveling. A small edit to a source model can ripple into downstream marts, dashboards, tests, and metric definitions. The <code>dbt-analyze</code> skill helps Claude Code reason about that blast radius before a change ships by inspecting dependency and lineage context, including column-level lineage where available.</p>
<p>The other side of impact is troubleshooting. When a dbt project fails to compile, a model errors at runtime, a test starts failing, or a dashboard suddenly looks wrong, the <code>dbt-troubleshoot</code> skill gives Claude Code a diagnostic workflow instead of leaving it to guess from the error message alone. It helps separate compilation issues, warehouse errors, test failures, incorrect data, and performance problems.</p>
<p>Together, these skills help Claude Code answer two questions that come up constantly in dbt work: “What could this change affect?” and “What is actually going wrong?”</p>
<hr />
<h2><strong>Reviewing and Improving SQL</strong></h2>
<p>Even in a dbt-heavy world, SQL is still the language data teams use to express business logic. But good SQL is not just SQL that runs. It should be readable, safe, efficient, and appropriate for the warehouse it runs on. The SQL skills help Claude Code review, optimize, and translate queries across the systems data teams actually use.</p>
<h3><strong>Reviewing SQL Before It Ships</strong></h3>
<p>Every data team has seen a query that technically works but makes you nervous. Maybe it has a risky join, a missing filter, unclear business logic, a performance issue hiding in plain sight, or a pattern that will be painful for the next person to maintain.</p>
<p>The <code>sql-review</code> skill gives Claude Code a pre-merge review workflow for SQL. It guides Claude Code to look for syntax issues, anti-patterns, readability problems, performance risks, and safety concerns before the query lands in production.</p>
<p>The goal is not just to ask, “Does this query run?” It is to ask, “Is this query understandable, reliable, and safe enough for the data system it is about to become part of?”</p>
<h3><strong>Optimizing Slow or Expensive Queries</strong></h3>
<p>Slow queries are rarely just an inconvenience in data engineering. They can block development, delay dashboards, frustrate stakeholders, and quietly drive up warehouse costs. A query that was fine on a small table can become a problem as data volume grows or as more teams start depending on it.</p>
<p>The <code>query-optimize</code> skill helps Claude Code inspect SQL with performance in mind. It can look for inefficient joins, unnecessary scans, filtering issues, aggregation patterns, and opportunities to rewrite the query in a way that is easier for the warehouse to execute.</p>
<p>This is where Claude Code becomes useful beyond code generation. It can help reason through why a query is slow, what tradeoffs are available, and how to make the SQL more efficient without losing the business logic that made the query valuable in the first place.</p>
<h3><strong>Translating Across Dialects</strong></h3>
<p>If you’ve done much traveling, you know that speaking the same language does not always mean speaking it the same way. SQL is similar. Snowflake, BigQuery, Databricks, Postgres, Redshift, MySQL, SQL Server, and DuckDB all share the same broad language, but each warehouse has its own syntax, functions, conventions, and sharp edges.</p>
<p>A query written for BigQuery will not always translate cleanly into Snowflake. The same is true when moving models between warehouses, supporting multiple customer environments, or trying to standardize logic across a mixed data stack.</p>
<p>That is why we built the <code>sql-translate</code> skill. It helps Claude Code translate SQL from one dialect to another while preserving the intent of the query. Think of it as Duolingo for Claude Code, except instead of asking it to practice ordering coffee, you are asking it to keep your business logic intact across warehouses.</p>
<p>If your team is migrating warehouses or working across multiple SQL engines, this skill gives Claude Code a much better starting point for making those translations safely.</p>
<hr />
<h2><strong>Validating Changes Before They Ship</strong></h2>
<p>In software engineering, tests often tell you whether a change broke expected behavior. In data engineering, validation can be harder to pin down. A model can run, a query can return rows, and a migration can apply successfully while the meaning of the data has still changed.</p>
<p>That is why this category matters so much. Data teams do not just need help making changes. They need help understanding whether those changes are safe to ship. The validation skills help Claude Code compare outputs, inspect lineage, and look for migration risks before a change reaches production.</p>
<h3><strong>Comparing Data Outputs</strong></h3>
<p>One of the most common questions in data work is also one of the most important: did this change alter the data?</p>
<p>Sometimes the answer should be yes. You fixed a bug, changed a business definition, or added new logic. But often, especially during a refactor or migration, the goal is to preserve behavior while changing the implementation. That is where the <code>data-parity</code> skill becomes useful.</p>
<p>The <code>data-parity</code> skill helps Claude Code compare two tables or query results and diagnose exactly how they differ. It can be used for migration validation, ETL regression checks, and query refactor verification. Instead of stopping at “these counts do not match,” the workflow pushes toward understanding where they differ, why they differ, and whether the difference is expected.</p>
<p>Think of it as asking Claude Code to check the receipt before you leave the store. The change may look fine at a glance, but you want to know whether the numbers actually add up.</p>
<h3><strong>Seeing How Lineage Changed</strong></h3>
<p>A data change is not only about the rows that come out the other side. It is also about how values move through the system. When the lineage changes, the meaning of a column can change with it.</p>
<p>The <code>lineage-diff</code> skill helps Claude Code compare column-level lineage between two versions of a SQL query or model. It can show which data flow edges were added, removed, or changed, giving the reviewer a clearer picture of how the transformation shifted.</p>
<p>This is especially useful when reviewing changes that look small in the SQL but may affect important downstream fields. A join changes. A source column is swapped. A derived field starts pulling from a different upstream path. The query may still run, but the story of the data has changed.</p>
<p>The goal is to make those invisible changes visible before they surprise someone downstream.</p>
<h3><strong>Catching Migration Risk</strong></h3>
<p>Schema changes are another place where “it ran successfully” is not enough. A migration can apply cleanly and still introduce data loss, break assumptions, or create problems for downstream consumers.</p>
<p>The <code>schema-migration</code> skill helps Claude Code analyze DDL changes before they are applied. It looks for risks like type narrowing, dropped columns, missing defaults, removed constraints, and other breaking column changes that can quietly turn into production issues.</p>
<p>This matters because schema migrations often feel mechanical until they are not. Renaming a column, changing a type, or tightening a constraint might look straightforward in code, but those changes can affect ingestion jobs, BI tools, reverse ETL flows, contracts, and every team that has built something on top of the data.</p>
<p>The skill gives Claude Code a migration review mindset: not just “Can this statement execute?” but “What could this break if it does?”</p>
<hr />
<h2><strong>Operating the Warehouse</strong></h2>
<p>Once data work is running in production, a different set of questions starts to matter. What is expensive? What is slow? What changed? Which workloads are driving spend? Which queries or models need attention? The warehouse is not just where data lives. It is also where performance and cost decisions show up.</p>
<p>The warehouse operations skills help Claude Code reason about those questions as part of the engineering workflow. Instead of treating cost and performance as separate admin tasks, these skills bring them closer to the code, queries, and models that created them.</p>
<h3><strong>Understanding Cost</strong></h3>
<p>Warehouse spend can be difficult to reason about because the cost is usually spread across queries, users, jobs, warehouses, and workloads. A dashboard may feel slow, a bill may jump, or a team may notice that a routine transformation suddenly got more expensive, but finding the cause is not always obvious.</p>
<p>The <code>cost-report</code> skill helps Claude Code analyze Snowflake query costs and identify optimization opportunities. It can help look at expensive queries, warehouse usage, credit consumption, unused resources, and patterns that may point to waste or inefficient workloads.</p>
<p>This gives Claude Code a FinOps lens. Not in the “please enjoy this spreadsheet of guilt” sense, but in the useful sense: where is the money going, what changed, and what can we do about it?</p>
<h3><strong>Diagnosing Operational Issues</strong></h3>
<p>Cost is only one part of operating a warehouse. Data teams also have to deal with slow queries, failing jobs, runtime errors, and models that behave differently as volume grows.</p>
<p>This is where several skills work together. The <code>query-optimize</code> skill helps Claude Code reason about slow or inefficient SQL. The <code>dbt-troubleshoot</code> skill gives it a workflow for compilation failures, runtime database errors, failing tests, incorrect data, and performance issues in dbt projects.</p>
<p>The goal is to make Claude Code useful when something is not healthy in production. It can help move from symptoms to causes: from “this dashboard is slow,” “this model failed,” or “our warehouse spend jumped” toward a clearer explanation of what is happening and what to try next.</p>
<hr />
<h2><strong>Governance, Privacy, and Team Knowledge</strong></h2>
<p>Data engineering also carries responsibilities that do not fit neatly into “write the model” or “make the query faster.” Teams need to know where sensitive data lives, whether a query exposes it, and whether new work follows the standards the team has already agreed on. The governance and training skills help Claude Code operate with more awareness of privacy, compliance, and team-specific conventions.</p>
<h3><strong>Auditing Sensitive Data</strong></h3>
<p>Sensitive data has a way of showing up where you least expect it. An email field gets added to a downstream model. A phone number moves into an analytics table. An IP address appears in a query result that was supposed to be safe to share. Unlike pie, PII is much better when it is not casually passed around.</p>
<p>The <code>pii-audit</code> skill helps Claude Code classify schema columns for personally identifiable information and sensitive data, including direct identifiers like SSNs, emails, phone numbers, names, addresses, and credit card numbers, as well as quasi-identifiers like dates of birth, zip codes, IP addresses, and device IDs.</p>
<p>It can also check whether a query or dbt model exposes PII, distinguish between sensitive fields used internally and sensitive fields returned in the output, and help generate a PII inventory for compliance workflows like GDPR, CCPA, and HIPAA.</p>
<p>The point is not to turn Claude Code into a compliance department. It is to give it enough privacy awareness to pause at the right moments, surface risk, and help data teams avoid accidentally spreading sensitive data through models, reports, or ad hoc queries.</p>
<p><a href="https://youtu.be/KtWwjVIhlGI">https://youtu.be/KtWwjVIhlGI</a></p>
<h3><strong>Teaching Claude Code Your Team’s Standards</strong></h3>
<p>That same teaching instinct shows up in the <code>teach</code>, <code>train</code>, and <code>training-status</code> skills. A lot of what makes someone effective on a data team is not just knowing SQL or dbt. It is learning the patterns, preferences, definitions, and little bits of context that make work fit the team around it.</p>
<p>Every data team has conventions that are obvious to the people who have been there long enough and invisible to everyone else. How staging models should be named. What belongs in marts. Which patterns are encouraged. Which shortcuts should be avoided. Which business definitions have sharp edges. Most of that knowledge lives in scattered docs, review comments, Slack threads, and the brains of the people who have answered the same question ten times.</p>
<p>The <code>teach</code> skill lets you show Claude Code an example file from your codebase and extract reusable patterns from it. The <code>train</code> skill helps Claude Code learn team standards from a document, style guide, or review checklist. The <code>training-status</code> skill shows what it has learned so far.</p>
<p>These skills help Claude Code move closer to the way your team actually works. The goal is not just technically valid output. It is output that reflects your standards, your naming conventions, your modeling patterns, and the context your team has built over time.</p>
<hr />
<h3><strong>Visualizing and Explaining Results</strong></h3>
<p>Data work does not end when the query returns rows. At some point, someone needs to understand what the data is saying. That might mean a chart for a trend, a dashboard for a team, a KPI view for leadership, or a more interactive way to explore a dataset.</p>
<p>The <code>data-viz</code> skill helps Claude Code turn data into visual interfaces: charts, dashboards, KPI cards, analytics views, and reporting experiences. It guides Claude Code toward modern component libraries like Recharts, Tremor, Nivo, D3, Victory, visx, and shadcn/ui, depending on the project.</p>
<p>This matters because the last mile of data work is often communication. A model can be correct, tested, documented, and optimized, but if people cannot understand the result, the work is not finished. The <code>data-viz</code> skill helps Claude Code move from “here is the data” to “here is what the data means.”</p>
<hr />
<p>Claude Code is already a powerful place to work with code. These skills make it more useful for the specific work data teams do every day: building models, writing tests, reviewing SQL, validating changes, checking lineage, auditing PII, understanding cost, translating dialects, and explaining results.</p>
<p>The goal is not to replace data engineers. It is to give them a better teammate inside the workflows they already know. Data engineering requires code, context, caution, and communication. These skills give Claude Code more of that context, so it can help with the work around the code, not just the code itself.</p>
<p>If you want to use the skills without installing them one by one in Claude Code, they are included in Altimate Code, our open-source LLM harness for data engineering. Altimate Code comes with these skills installed and is ready to work with Claude:</p>
<pre><code class="language-bash">npm install -g altimate-code
</code></pre>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/we-created-data-engineering-skills-for-claude-code/beb8fcfb-2ed1-4c46-ac6e-d7b964c96314.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Best Data Conferences 2026: The Complete Guide</title>
    <link>https://altimate.ai/blog/best-data-conferences-2026-the-complete-guide</link>
    <guid isPermaLink="true">https://altimate.ai/blog/best-data-conferences-2026-the-complete-guide</guid>
    <pubDate>Mon, 11 May 2026 18:31:11 GMT</pubDate>
    <dc:creator>Steven Johnson</dc:creator>
    <description>If you&apos;re trying to figure out which data conferences in 2026 are worth your time and travel budget, this is the list. We&apos;ve covered the biggest events on the calendar, from global platform</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/best-data-conferences-2026-the-complete-guide/ee92f384-3c6f-4d0c-90a0-79f0018e6387.webp" alt="Best Data Conferences 2026: The Complete Guide" /></p>
<hr />
<p>If you're trying to figure out which data conferences in 2026 are worth your time and travel budget, this is the list. We've covered the biggest events on the calendar, from global platform summits drawing 20,000+ attendees to practitioner-focused gatherings where the real technical conversations happen.</p>
<p>Listed in chronological order.</p>
<table>
<thead><tr><th>Conference</th><th>Dates</th><th>Location</th><th>Best for</th></tr></thead>
<tbody>
<tr><td>Gartner Data &amp; Analytics Summit</td><td>March 9-11</td><td>Orlando, FL</td><td>Data leaders and strategists</td></tr>
<tr><td>Tableau Conference</td><td>May 5-7</td><td>San Diego, CA</td><td>Teams where Tableau is the main visualization layer</td></tr>
<tr><td>Snowflake Summit</td><td>June 1-4</td><td>San Francisco, CA</td><td>Teams that run on Snowflake</td></tr>
<tr><td>Databricks Data + AI Summit</td><td>June 15-18</td><td>San Francisco, CA</td><td>Practitioners and engineers on Databricks</td></tr>
<tr><td>Ai4</td><td>August 4-6</td><td>Las Vegas, NV</td><td>Data leaders and strategists</td></tr>
<tr><td>dbt Summit</td><td>September 15-18</td><td>Las Vegas, NV</td><td>Teams that run on dbt, and practitioners</td></tr>
<tr><td>Big Data LDN</td><td>September 23-24</td><td>London, England</td><td>European teams, free to attend</td></tr>
</tbody>
</table>
<hr />
<h2><a href="https://www.gartner.com/en/conferences/na/data-analytics-us">Gartner Data &amp; Analytics Summit</a></h2>
<p><strong>March 9-11 | Gaylord Palms, Orlando, FL | ~5,000 attendees</strong></p>
<p>If your job involves data strategy, AI governance, or making the case to leadership for data investments, this one belongs near the top of your list. The summit runs on research from Gartner analysts: over 60 experts delivering 137 sessions across five main tracks and three spotlight tracks. This year's focus was squarely on moving past AI pilots and into production-grade AI that actually delivers ROI.</p>
<p>The crowd skews toward senior roles: CDAOs, heads of AI, data architecture leads, data management executives. The format matches that audience: keynotes and roundtables built for strategic conversation, not product demos. There are 130+ vendors in the Exhibit Showcase if that's useful, but the sessions are where the value is. Gartner also runs this summit in London and Sydney for teams outside North America.</p>
<hr />
<h2><a href="https://www.salesforce.com/tableau-conference/">Tableau Conference</a></h2>
<p><strong>May 5-7 | San Diego Convention Center, San Diego, CA | ~8,000 attendees</strong></p>
<p><strong>TC26</strong> is three days of 300+ expert-led sessions, 150+ hands-on trainings, and the kind of community programming that makes this feel less like a tech conference and more like a reunion. Tableau's community calls itself the DataFam for a reason. The culture is genuinely welcoming in a way that most data conferences aren't.</p>
<p>Content this year centers on agentic analytics, interoperability, and new product integrations. If your team uses Tableau day-to-day, the skill-building alone makes this worth attending. Sessions run from beginner dashboard design to advanced AI integration. There's also Iron Viz (a live data viz competition), Tableau Doctor for 1:1 expert help, and Salesforce+ livestreams for anyone who can't make it in person.</p>
<hr />
<h2><a href="https://www.snowflake.com/en/summit/">Snowflake Summit</a></h2>
<p><strong>June 1-4 | Moscone Center, San Francisco, CA | ~20,000 attendees</strong></p>
<p><strong>Snowflake Summit 2026</strong> has 500+ sessions, hands-on labs, training and certification, and an expo floor with 190+ partner booths. The Builders Hub is specifically for developers: bootcamp sessions and live demos. The Industry Zone covers vertical-specific content for finance, healthcare, retail, and more.</p>
<p>The theme this year is agentic intelligence: how to move from isolated data strategies to connected, AI-powered enterprise experiences. If your team runs on Snowflake, this is where you get ahead on what's coming from the platform and hear real implementation stories from companies that have already shipped it. Main keynotes are livestreamed free for non-registrants.</p>
<p>Catch the Altimate AI team at booth 1311</p>
<hr />
<h2><a href="https://www.databricks.com/dataaisummit">Databricks Data + AI Summit</a></h2>
<p><strong>June 15-18 | Moscone Center, San Francisco, CA | ~22,000 attendees</strong></p>
<p><strong>Data + AI Summit</strong> brings together data engineers, scientists, architects, ML engineers, and executives from over 160 countries across 800+ sessions covering data engineering, warehousing, governance, analytics, agentic AI, and AI/BI.</p>
<p>If you're working with Apache Spark, Delta Lake, Apache Iceberg, MLflow, or dbt alongside Databricks, this is where roadmaps get announced and where you'll find the most advanced technical content on those tools. The conference also offers new certification courses on-site. One caveat: it's a big event. Plan your session schedule before you arrive or you'll spend the week just trying to navigate the venue.</p>
<p>Catch the Altimate AI team at booth 577</p>
<hr />
<h2><a href="https://ai4.io/vegas/">Ai4</a></h2>
<p><strong>August 4-6 | Las Vegas, NV | ~12,000 attendees</strong></p>
<p>America's largest independent AI conference, drawing 12,000+ executives and decision-makers from 90+ countries. Ai4 is enterprise-focused. The emphasis is on real-world AI implementation and measurable business outcomes, not research. Tracks are organized by industry (finance, healthcare, retail, manufacturing) and by function (AI strategy, generative AI, AI agents, automation).</p>
<p>The audience skews toward business and technical leadership. If you're evaluating AI strategy or want to see how peers in adjacent industries are actually deploying AI in production, this is a useful venue. For teams wondering whether their AI initiatives are in line with what the broader market is doing, the comparison is genuinely worth making.</p>
<hr />
<h2><a href="https://coalesce.getdbt.com/">dbt Summit</a> <em>(formerly Coalesce)</em></h2>
<p><strong>September 15-18 | The Cosmopolitan, Las Vegas, NV | ~3,000 attendees</strong></p>
<p>Coalesce has a new name. <strong>dbt Summit 2026</strong> is the world's largest gathering of dbt users: analytics engineers, data engineers, data architects, and the data leaders working alongside them. The rebrand reflects how the event has grown from a community conference into a full industry summit, spanning four days with 100+ sessions across keynotes, breakout tracks, and hands-on labs.</p>
<p>The conversations here are practitioner-driven. You won't find a lot of polished vendor pitches. You'll find engineers being honest about what's working and what isn't. Key themes include dbt Mesh, data contracts, AI-ready data architectures, incremental models, and how analytics engineering intersects with ML workflows. For data teams building on dbt, this is the one worth planning around.</p>
<p>Catch the Altimate AI team on the Expo floor</p>
<hr />
<h2><a href="https://www.bigdataldn.com/en-gb.html">Big Data LDN</a></h2>
<p><strong>September 23-24 | Olympia London, London, England | Free to attend</strong></p>
<p>The UK's largest data, analytics, and AI event and the most important data conference on the European calendar. Big Data LDN brings together engineers, architects, data leaders, and practitioners for two days of 400+ seminars across 15 free-to-attend conference theatres. Speakers come from Google, AWS, TikTok, Spotify, Snowflake, Databricks, and a wide range of startups.</p>
<p>Free registration, 130+ exhibitors ranging from major platform vendors to early-stage companies, and sessions covering AI governance, data engineering, and data products. In 2026, a co-located event called Data Driven LDN runs on September 22nd, focused specifically on AI agents, AI governance, and data products for senior practitioners who want deeper dives.</p>
<p>Catch the Altimate AI team on the Expo floor</p>
<hr />
<h2>How to Pick the Right Data Conference in 2026</h2>
<p>Nobody can do all of these, so a few filters are worth applying. If your team runs on Snowflake, Snowflake Summit is the obvious call. The same logic applies for dbt and dbt Summit. Platform-specific conferences tend to have the highest signal-to-noise for teams already using those tools. Data leaders and strategists get the most out of Gartner and Ai4. Practitioners and engineers tend to get more hands-on value from dbt Summit and the Databricks summit. Tableau Conference is its own category: best for teams where Tableau is the primary visualization layer. European teams should have Big Data LDN near the top of the list. It's free, comprehensive, and the audience quality is high.</p>
<p>Pick the ones where your stack, your role, and your team's current problems overlap with the program. That overlap is usually obvious once you look.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/best-data-conferences-2026-the-complete-guide/ee92f384-3c6f-4d0c-90a0-79f0018e6387.webp" type="image/webp" />
  </item>
  <item>
    <title>Claude Code or Altimate Code for Data Engineering?</title>
    <link>https://altimate.ai/blog/claude-code-or-altimate-code-for-data-engineering</link>
    <guid isPermaLink="true">https://altimate.ai/blog/claude-code-or-altimate-code-for-data-engineering</guid>
    <pubDate>Thu, 23 Apr 2026 17:00:26 GMT</pubDate>
    <dc:creator>Muhammad Anas Farooqui</dc:creator>
    <category>claude-code</category>
    <category>altimate-code</category>
    <category>altimateAI</category>
    <description>Claude Code is fast, writes good software code, and can even handle dbt models and other data engineering tasks to certain extent.
At first glance Altimate Code, the data engineering harness, may seem</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/claude-code-or-altimate-code-for-data-engineering/a5d2ee61-e0d3-4b90-9909-376d54ed2949.jpg" alt="Claude Code or Altimate Code for Data Engineering?" /></p>
<p>Claude Code is fast, writes good software code, and can even handle dbt models and other data engineering tasks to certain extent.</p>
<p>At first glance <a href="https://docs.altimate.sh/getting-started/">Altimate Code</a>, the data engineering harness, may seem to do similar things. So, do we need both? Is one a replacement for the other?</p>
<p>We ran an experiment to find out. We used the same prompt, the same model (Claude Opus 4.6), and the same codebase. One run with Claude Code alone, one run with Altimate Code. The results were not close.</p>
<hr />
<h2>What Claude Code Actually Is</h2>
<p>Claude Code is a general-purpose agentic coding tool that reads files, runs shell commands, edits code etc. For data engineering, it draws on Claude's extensive training coverage of SQL dialects and dbt conventions.</p>
<p>But Claude Code is no data engineering expert. It has no deterministic SQL anti-pattern engine, no static lineage tracer, no PII classifier, no schema diff tool that programmatically flags breaking changes.</p>
<p>And there is no evidence the team at Anthropic is focused on making it any better at these tasks.</p>
<h2>What Altimate Code Actually Is</h2>
<p><a href="https://docs.altimate.sh/getting-started/">Altimate Code</a> is an open-source data engineering harness with 100+ specialized tools for building, validating, optimizing, and shipping data products. It uses LLMs (Claude, GPT, Gemini, or any of 17+ providers) as its AI backend, but routes every task through domain-specific tooling that general-purpose agents do not have:</p>
<ul>
<li><p><strong>Live warehouse connection</strong> -- connects directly to various warehouses with auto-discovery from profiles.yml or environment variables.</p>
</li>
<li><p><strong>dbt-native build and test</strong> -- runs real <code>dbt build</code> against your warehouse, materializing tables and executing every data test.</p>
</li>
<li><p><strong>Column-level lineage</strong> -- traces every column from source through joins, CTEs, and subqueries to final output in real time.</p>
</li>
<li><p><strong>PII detection</strong> -- scans schemas across 15+ PII categories (SSN, email, phone, DOB, health data) with confidence scores.</p>
</li>
<li><p><strong>Impact analysis and schema diff</strong> -- calculates blast radius across your full dbt DAG and produces column-level before/after diffs with breaking change classification.</p>
</li>
<li><p><strong>SQL quality grading</strong> -- scores SQL on syntax, style, safety, and complexity (A-F) for objective, reproducible code review.</p>
</li>
<li><p><strong>Enforced agent modes</strong> -- Builder (can modify), Analyst (read-only), Plan (design only) -- enforced at the harness level, not by prompt. You cannot DROP TABLE in Analyst mode regardless of what the LLM suggests.</p>
</li>
<li><p><strong>Project conventions via AGENTS.md</strong> -- team-wide rules loaded into every session's system prompt for consistency across engineers and CI.</p>
</li>
</ul>
<h2>How Claude Code and Altimate Code Work Together</h2>
<p>Claude Code and Altimate Code are not competitors or alternatives .They occupy different layers of the stack. Claude Code is a general-purpose coding agent. Altimate Code is a domain-specific data engineering harness.</p>
<p>When used together, Claude Code handles task orchestration and conversational context while Altimate Code’s tools handle warehouse connectivity, lineage tracing, PII scanning, build execution, and impact analysis. The LLM’s reasoning improves when it has access to specialized tools enabling access to real data, real schemas, and real test results instead of guessing from file contents alone.</p>
<p>The comparison in this post demonstrates why domain-specific tooling matters for data engineering work.</p>
<hr />
<h2>The Experiment: Claude Code vs. Altimate Code</h2>
<p>As an experiment we took a realistic, broken dbt model <code>mart_patient_360</code> from a demo dbt healthcare project <code>medflow-analytics</code> — a scenario that data engineering teams encounter regularly — and gave the exact same prompt to two setups:</p>
<ol>
<li><p>Claude Code standalone and</p>
</li>
<li><p>Altimate Code + Claude Code, same codebase, and same task.</p>
</li>
</ol>
<p><strong>The goal:</strong> to see whether domain-specific data engineering tooling produces meaningfully different outcomes than a general-purpose coding agent when the task involves schema accuracy, HIPAA compliance, build verification, and downstream impact analysis — the things that actually matter in production data work.</p>
<p><strong>Model:</strong> Claude Opus 4.6 was used in both experiments to ensure a fair comparison.</p>
<p><strong>The prompt we used :</strong></p>
<blockquote>
<p><em>The</em> <code>mart_patient_360</code> <em>model is incomplete. Right now it joins patients, encounters, diagnoses, medications, and lab_results but the SELECT is mostly empty — it’s missing the</em> <code>patient_id</code> <em>primary key, has no aggregated metrics, and just exposes raw PII fields like SSN and phone number. I need you to build this out into a proper patient 360 view: add the</em> <code>patient_id</code> <em>key, total encounter count, unique diagnosis count, active medication count, most recent lab result date, days since last visit, and a patient risk tier (high/medium/low based on encounter frequency and diagnosis count). The model is tagged as PII/HIPAA-restricted. Make sure the final model is safe to materialize, fix any compliance issues you see, and tell me what downstream impacts or governance concerns I should be aware of before merging.</em></p>
</blockquote>
<p><strong>Claude Code:</strong></p>
<img src="/blog/claude-code-or-altimate-code-for-data-engineering/c14f12cd-3144-4f50-8c58-2b253ebe2912.png" alt="Screenshot of Claude Code's terminal welcome screen with a user prompt asking it to build out an incomplete mart_patient_360 model, adding a patient ID key, aggregated metrics, and a risk tier, while fixing PII/HIPAA compliance issues before merging." style="display:block;margin:0 auto" />

<p><strong>Altimate Code:</strong></p>
<img src="/blog/claude-code-or-altimate-code-for-data-engineering/c24e57ea-bb2b-48fc-9956-ec2d59b25a8d.png" alt="Screenshot of the Altimate Code interface showing the same patient-360 HIPAA-compliance prompt, under a &quot;Claude Code vs Altimate Code: Head-to-Head Results&quot; heading comparing the two agents' outputs." style="display:block;margin:0 auto" />

<hr />
<h2>Head-to-Head Results: Data Engineering Harness Vs. General Purpose Coding Assistant</h2>
<h3>Claude Code Output:</h3>
<p>Enhanced the model but without execution or proper validation, surfaced limited insights:</p>
<img src="/blog/claude-code-or-altimate-code-for-data-engineering/1841f898-c013-48f3-9912-4b67935202f6.png" alt="Screenshot of the Claude Code output" style="display:block;margin:0 auto" />

<h3>Altimate Code Output:</h3>
<p>Unlike Claude Code, Altimate Code enhanced the dbt model, executed it, did proper validation, and surfaced detailed insights:</p>
<img src="/blog/claude-code-or-altimate-code-for-data-engineering/2335e045-23d6-44d7-8703-6e51fafc7b31.png" alt="Screenshot of the Altimate Code output" style="display:block;margin:0 auto" />

<h2>Detailed Findings</h2>
<h3>1. PII and HIPAA Compliance</h3>
<p>This is where the gap was most visible and most consequential.</p>
<table>
<thead>
<tr>
<th>Aspect</th>
<th>Claude Code (Opus 4.6)</th>
<th>Altimate Code (Opus 4.6)</th>
</tr>
</thead>
<tbody><tr>
<td><strong>SSN handling</strong></td>
<td>Hashed with <code>sha2(ssn, 256)</code> — SSN still flows through the query pipeline.</td>
<td>Removed entirely — SSN is never selected into any CTE. It never touches the query.</td>
</tr>
<tr>
<td><strong>full_name, phone, email, address</strong></td>
<td>Kept in the final model output. Still materialized to Snowflake disk.</td>
<td>Dropped completely from the model with explicit per-column rationale.</td>
</tr>
<tr>
<td><strong>PII verification</strong></td>
<td>None — assumed the code changes were sufficient.</td>
<td>Ran automated <code>altimate_core_classify_pii</code> scan on the output schema. Caught that <code>full_name</code> was still flowing through a CTE even though it wasn’t in the final SELECT. Removed it in a second pass.</td>
</tr>
<tr>
<td><strong>Philosophy</strong></td>
<td>“Mask the PII.” Sensitive data still exists in the table, just obfuscated.</td>
<td>“Eliminate the PII.” The mart never touches it. Consumers who need PII use RBAC on the staging layer.</td>
</tr>
</tbody></table>
<p><strong>Why this matters:</strong> Claude Code’s SHA-256 hash of SSN is a common pattern, but it’s a weaker approach than most teams realize. SSNs are 9 digits — roughly 900 million possible values. Altimate Code’s approach of full elimination is the correct HIPAA-compliant pattern for analytical marts.</p>
<p>In our experiment, Altimate Code’s <code>lineage_check</code> tool revealed that <code>full_name</code> (a PII field) was flowing through a CTE even though it wasn’t in the final SELECT. Claude Code missed this entirely. Altimate Code’s lineage engine claims 100% edge match accuracy across 500 benchmark queries.</p>
<h3>2. Schema Accuracy: Did It Actually Build?</h3>
<table>
<thead>
<tr>
<th>Aspect</th>
<th>Claude Code (Opus 4.6)</th>
<th>Altimate Code (Opus 4.6)</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Columns referenced</strong></td>
<td>Used <code>gender</code>, <code>race</code>, <code>ethnicity</code>, <code>primary_care_provider_id</code> from <code>stg_patients</code> (none of these exist in the actual SQL) plus <code>blood_type</code> (which exists in SQL but isn’t in the YAML). Also grouped <code>stg_diagnoses</code> and <code>stg_medications</code> by <code>patient_id</code> directly.</td>
<td>Only used columns confirmed to exist in the actual staging SQL.</td>
</tr>
<tr>
<td><strong>The problem</strong></td>
<td>The four phantom columns are documented in <code>_staging.yml</code> but <strong>not selected</strong> in <code>stg_patients.sql</code>. The actual SQL only selects: <code>patient_id, full_name, ssn, date_of_birth, phone, email, address, blood_type, insurance_id, created_at</code>. Additionally, <code>stg_diagnoses</code> and <code>stg_medications</code> do not contain <code>patient_id</code> — Claude Code assumed they did.</td>
<td>Cross-referenced the YAML documentation against the actual SQL files AND the seed CSV headers to identify exact available columns.</td>
</tr>
<tr>
<td><strong>Diagnosis join</strong></td>
<td>Grouped <code>stg_diagnoses</code> by <code>patient_id</code> directly.</td>
<td>Joined <code>stg_diagnoses</code> to <code>stg_encounters</code> via <code>encounter_id</code> to get <code>patient_id</code>, then grouped. Same pattern applied for <code>stg_medications.</code></td>
</tr>
<tr>
<td><strong>Would it build?</strong></td>
<td><strong>No:</strong> would fail on at least six missing column references (4 phantom from <code>stg_patients</code>, plus <code>patient_id</code> in both <code>stg_diagnoses</code> and <code>stg_medications</code>).</td>
<td><strong>Yes:</strong> <strong>PASS=40, WARN=0, ERROR=0</strong> across the full project.</td>
</tr>
</tbody></table>
<p><strong>Why this matters:</strong> Claude Code trusted the YAML documentation, which was out of sync with the actual SQL in multiple directions. Some columns were documented but missing from the SQL, while <code>blood_type</code> was the reverse case (in the SQL but undocumented). This is extremely common in real dbt projects. Altimate Code verified against multiple sources (SQL, YAML, seed data) and resolved the discrepancies.</p>
<p>The <code>altimate_core_schema_diff</code> tool produces a column-level before/after comparison with explicit breaking change classification (e.g. <code>[BREAKING] Column 'ssn' removed</code>). In our experiment, this confirmed 16 schema changes with 6 breaking giving the team an exact migration checklist.</p>
<h3>3. Build Verification and Data Validation</h3>
<table>
<thead>
<tr>
<th>Aspect</th>
<th>Claude Code (Opus 4.6)</th>
<th>Altimate Code (Opus 4.6)</th>
</tr>
</thead>
<tbody><tr>
<td><strong>dbt build attempted</strong></td>
<td>No</td>
<td>Yes: <code>altimate-dbt build --model mart_patient_360.</code></td>
</tr>
<tr>
<td><strong>Tests run</strong></td>
<td>Never executed</td>
<td>8 data tests, all passing (unique, not_null, accepted_values).</td>
</tr>
<tr>
<td><strong>Full project build</strong></td>
<td>Never attempted</td>
<td><strong>PASS=40, WARN=0, ERROR=0</strong> — 20 models, 10 seeds, 8 tests, 2 project hooks.</td>
</tr>
<tr>
<td><strong>Data validation</strong></td>
<td>None</td>
<td>Queried Snowflake directly: confirmed 1,000 patients, verified risk distribution (719 low, 278 medium, 3 high), spot-checked high-risk and low-risk patients.</td>
</tr>
<tr>
<td><strong>SQL quality checks</strong></td>
<td>None</td>
<td>Ran <code>sql_analyze</code>, <code>altimate_core_check</code>, and <code>altimate_core_grade.</code></td>
</tr>
</tbody></table>
<p><strong>Why this matters:</strong> Claude Code wrote the code and declared it done. Altimate Code wrote the code, built it on Snowflake, ran every test, queried the output data, and verified the results made clinical sense. In production data engineering, “the SQL looks right” is not the same as “it works.”</p>
<h3>4. Downstream Impact Analysis</h3>
<table>
<thead>
<tr>
<th>Aspect</th>
<th>Claude Code (Opus 4.6)</th>
<th>Altimate Code (Opus 4.6)</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Blast radius assessment</strong></td>
<td>Manually identified <code>vw_patient_summary_deidentified</code> as downstream and updated it</td>
<td>Ran automated <code>impact_analysis</code> — confirmed 0/20 downstream dbt models affected.</td>
</tr>
<tr>
<td><strong>Schema diff</strong></td>
<td>Described breaking changes in a text table.</td>
<td>Ran <code>altimate_core_schema_diff</code> — automated analysis: <strong>16 changes, 6 breaking</strong>, with exact column-level detail.</td>
</tr>
<tr>
<td><strong>Breaking change detail</strong></td>
<td>Listed columns removed.</td>
<td>Categorized each: <code>[BREAKING] Column 'mart_patient_360.ssn' removed</code>, <code>[info] Column 'mart_patient_360.patient_risk_tier' added (VARCHAR).</code></td>
</tr>
<tr>
<td><strong>External consumer warnings</strong></td>
<td>Generic: “verify that Snowflake row-access policies are correctly scoped”.</td>
<td>Specific: BI tools, RBAC enforcement, CI check suggestion for <code>restricted</code> tag containment, non-determinism warning for <code>current_date</code> usage.</td>
</tr>
</tbody></table>
<p><strong>Why this matters:</strong> In production data environments, the most dangerous changes are the ones that look safe in isolation. Altimate Code's impact_analysis tool traverses the full DAG programmatically, and its schema_diff produces a migration checklist that a team lead can review.</p>
<h3>5. Governance Recommendations</h3>
<table>
<thead>
<tr>
<th>Topic</th>
<th>Claude Code (Opus 4.6)</th>
<th>Altimate Code (Opus 4.6)</th>
</tr>
</thead>
<tbody><tr>
<td><strong>date_of_birth</strong></td>
<td>Mentioned Safe Harbor in passing</td>
<td>Specific recommendation: “consider age-banding for de-identified datasets per HIPAA Safe Harbor” — included in YAML column description.</td>
</tr>
<tr>
<td><strong>Non-determinism</strong></td>
<td>Not mentioned</td>
<td>Flagged that <code>days_since_last_visit</code> and <code>active_medication_count</code> use <code>current_date</code>, making the table non-deterministic. Recommended documenting refresh cadence.</td>
</tr>
<tr>
<td><strong>Tag enforcement</strong></td>
<td>Not mentioned</td>
<td>Recommended CI check to prevent <code>restricted</code>-tagged models from being referenced by non-restricted downstream models.</td>
</tr>
<tr>
<td><strong>Risk tier thresholds</strong></td>
<td>Suggested making thresholds dbt vars</td>
<td>Used different (more conservative) thresholds: high tier requires <code>&gt;=5 encounters AND &gt;=3 diagnoses</code> (AND logic), vs. Claude’s <code>&gt;=10 encounters OR &gt;=5 diagnoses</code> (OR logic). Medium tier in both used OR logic.</td>
</tr>
</tbody></table>
<p><strong>Why this matters:</strong> Claude Code offered textbook advice: reasonable, but generic. Altimate Code's recommendations were actionable at the PR level: a specific YAML annotation for Safe Harbor, a specific CI check for tag containment, a specific warning about non-deterministic columns that would produce different results depending on when the pipeline runs.</p>
<p>These are the details that prevent a compliance review from becoming a compliance finding.</p>
<hr />
<h2>The Extra Steps Altimate Code Took</h2>
<p>These are capabilities that Claude Code simply does not have access to:</p>
<table>
<thead>
<tr>
<th>Tool Used</th>
<th>What It Did</th>
<th>Why It Matters</th>
</tr>
</thead>
<tbody><tr>
<td><code>altimate_core_classify_pii</code></td>
<td>Automated PII scan on the final schema — flagged <code>patient_id</code> (0.75 confidence) and <code>date_of_birth</code> (0.9 confidence) as remaining quasi-identifiers</td>
<td>Catches PII that humans miss in code review</td>
</tr>
<tr>
<td><code>lineage_check</code></td>
<td>Traced column-level lineage from sources through CTEs to output</td>
<td>Caught <code>full_name</code> leaking through a CTE even though it wasn’t in final SELECT</td>
</tr>
<tr>
<td><code>impact_analysis</code></td>
<td>Automated blast radius calculation across the full DAG</td>
<td>Confirms safety with certainty, not guessing</td>
</tr>
<tr>
<td><code>altimate_core_schema_diff</code></td>
<td>Column-level before/after diff with breaking change classification</td>
<td>Documents exactly what changes for downstream consumers</td>
</tr>
<tr>
<td><code>sql_execute</code> (warehouse)</td>
<td>Queried actual Snowflake tables to verify data distribution</td>
<td>Validates that the model produces clinically sensible results</td>
</tr>
<tr>
<td><code>altimate-dbt build</code></td>
<td>Full project build + test execution on Snowflake</td>
<td>Proves the code actually works, not just “looks right”</td>
</tr>
</tbody></table>
<hr />
<h2>Summary: The Scorecard</h2>
<table>
<thead>
<tr>
<th>Capability</th>
<th>Claude Code (Opus 4.6)</th>
<th>Altimate Code (Opus 4.6)</th>
</tr>
</thead>
<tbody><tr>
<td>SQL generation quality</td>
<td>Good structure, but used phantom columns</td>
<td>Verified against actual schema — builds cleanly</td>
</tr>
<tr>
<td>PII handling</td>
<td>Masked (hash) — PII still in pipeline</td>
<td>Eliminated — PII never enters the query</td>
</tr>
<tr>
<td>Build verification</td>
<td>Not attempted</td>
<td>Built + tested on Snowflake (PASS=40)</td>
</tr>
<tr>
<td>Data validation</td>
<td>None</td>
<td>Queried warehouse, verified distribution</td>
</tr>
<tr>
<td>Downstream impact</td>
<td>Manual guess about one view</td>
<td>Automated blast radius + schema diff (16 changes, 6 breaking)</td>
</tr>
<tr>
<td>PII audit</td>
<td>None</td>
<td>Automated scan with confidence scores</td>
</tr>
<tr>
<td>Column-level lineage</td>
<td>Not performed</td>
<td>Traced end-to-end, caught PII leak in CTE</td>
</tr>
<tr>
<td>Governance recommendations</td>
<td>Generic HIPAA mention</td>
<td>Specific: RBAC, Safe Harbor age-banding, non-determinism, CI tag enforcement</td>
</tr>
<tr>
<td>Would the model build?</td>
<td>No — missing column references</td>
<td>Yes — full project green</td>
</tr>
</tbody></table>
<h2>In Conclusion: An AI Coding Assistant Needs a Domain Expert Harness to Master Data Engineering</h2>
<p>The takeaway of all this is that <strong>general-purpose AI + domain-specific intelligence</strong> produces categorically better results than either alone. For data engineering work where correctness, compliance, and safety matter, the domain layer is not optional.</p>
<p>Altimate Code's value is not that it replaces Claude Code Its value is that it surrounds Claude Code with 100+ specialized tools that verify, build, test, scan, and validate before declaring the job done. For data engineering teams shipping to production, that difference is the entire gap between "looks right" and "is right."</p>
<hr />
<h2>Steps To Reproduce This Analysis</h2>
<p><strong>We’ve open-sourced the full analysis so you can reproduce it:</strong></p>
<p><strong>Repository:</strong> <a href="https://github.com/altimateanas/altimate_code_enterprise_demos">github.com/altimateanas/altimate_code_enterprise_demos</a></p>
<ol>
<li><p>Clone the repo: <code>git clone https://github.com/altimateanas/altimate_code_enterprise_demos</code></p>
</li>
<li><p>Navigate to <code>medflow-analytics/</code>directory It's a healthcare dbt project running on Snowflake with patient data, claims, encounters, diagnoses, medications, and lab results.</p>
</li>
<li><p>Setup your snowflake target in dbt profiles.yml.</p>
</li>
<li><p>Run the prompt in section "The Experiment: Claude Code vs. Altimate Code" in Claude Code (standalone) then observe the output</p>
</li>
<li><p>Connect Altimate Code and run the same prompt and compare</p>
</li>
</ol>
<p><strong>Make sure to use the same underlying LLM in both runs.</strong></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/claude-code-or-altimate-code-for-data-engineering/a5d2ee61-e0d3-4b90-9909-376d54ed2949.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>We built AI that actually works for data engineering.  We crushed the ADE benchmark.</title>
    <link>https://altimate.ai/blog/introducing-altimate-code</link>
    <guid isPermaLink="true">https://altimate.ai/blog/introducing-altimate-code</guid>
    <pubDate>Thu, 19 Mar 2026 15:58:52 GMT</pubDate>
    <dc:creator>Anand Gupta</dc:creator>
    <category>AI Tool </category>
    <category>data-engineering</category>
    <category>altimateAI</category>
    <description>tl;dr : Today, we are launching Altimate Code, an open-source agentic data engineering harness that far exceeds generic LLMs (and other leading models) on data engineering tasks. Check out the project</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/introducing-altimate-code/04d44fc2-99f4-442b-9df5-80debde510b6.jpg" alt="We built AI that actually works for data engineering.  We crushed the ADE benchmark." /></p>
<p>tl;dr : Today, we are launching Altimate Code, an open-source agentic data engineering harness that far exceeds generic LLMs (and other leading models) on data engineering tasks. <a href="https://github.com/AltimateAI/altimate-code">Check out the project on GitHub</a>, or catch the <a href="https://www.youtube.com/watch?v=g-ACWwz9TGg">March 25th overview and AMA on YouTube</a>.</p>
<hr />
<p>AI agents have transformed how software gets built. But for data engineering, they have fallen short…</p>
<p>An AI coding agent on Replit <a href="https://fortune.com/2025/07/23/ai-coding-tool-replit-wiped-database-called-it-a-catastrophic-failure/">deleted an entire production database</a> during a code freeze, then <a href="https://www.eweek.com/news/replit-ai-coding-assistant-failure/">created 4,000 fake records</a> to fill the empty tables. An <a href="https://www.atscale.com/blog/troubleshooting-snowflake-cortext-analyst/">independent evaluation</a> of Snowflake's Cortex Analyst found 38% logical accuracy. Six out of ten queries were wrong, but compiled and ran just fine. One team got a <a href="https://seemoredata.io/blog/snowflake-cortex-ai/">$5,000 bill from a single Cortex AI query</a> their resource monitors never caught. <a href="https://medium.com/tr-labs-ml-engineering-blog/is-your-ai-agent-lying-with-perfect-sql-3a6a7d69bccf">78% of AI-generated SQL errors are silent wrong joins</a>, queries that return confidently incorrect data.</p>
<p>These aren't edge cases. They're what happens when AI agents operate on data infrastructure without safety layers. No schema validation, no lineage, no cost controls, no permission enforcement. The agent doesn't know your schema. It can't trace what breaks downstream. It doesn't know what a query will cost. And the system prompt telling it "don't drop tables" stops working at 100K context tokens.</p>
<p>The problem isn't the model. It's everything around it.</p>
<h2>The missing layer</h2>
<p>General-purpose coding agents treat SQL like application code. It isn't. SQL operates on schemas that change, across dialects that diverge on every function name, through lineage chains no LLM can reliably trace, with cost implications that scale to thousands of dollars per mistake.</p>
<p>What data engineering needs is a layer of compiled, deterministic tools that operate <em>outside</em> the LLM's reasoning loop. Tools that validate SQL against your actual schema in 2ms, trace column-level lineage through CTEs deterministically, and catch anti-patterns with zero false positives. Not better prompts. Better engines.</p>
<p>That's what we built.</p>
<h2>Introducing Altimate Code</h2>
<p>Today we're open-sourcing <strong>Altimate Code,</strong> a data engineering harness built on <a href="https://github.com/anomalyco/opencode">OpenCode</a>, the open-source coding agent. Built by the team behind <a href="https://marketplace.visualstudio.com/items?itemName=innoverio.vscode-dbt-power-user">dbt Power User</a>, the most widely used dbt VS Code extension.</p>
<p>The core idea: <strong>the LLM reasons; compiled engines validate; neither replaces the other.</strong></p>
<p>We ran dbt Labs' <a href="https://www.getdbt.com/blog/ade-bench-dbt-data-benchmarking">ADE-bench</a>, the open standard for measuring AI agents on real data engineering tasks.</p>
<img src="/blog/introducing-altimate-code/a6f9a3ac-6eb4-4595-aa45-35c20c3ecbcc.png" alt="Pixel-art ALTIMATE CODE logo above a chat prompt asking it to build out an incomplete patient-360 dbt model while fixing PII/HIPAA compliance issues." style="display:block;margin:0 auto" />

<p><strong>A cheaper model with compiled tools outperformed a more expensive model without them.</strong> The difference isn't the model. It's the harness. Further details can be found <a href="https://altimate.ai/benchmarks">here</a>.</p>
<h2>What the harness catches</h2>
<img src="/blog/introducing-altimate-code/c7510620-d478-417c-b2f9-18f716b81447.png" alt="ADE-Bench leaderboard showing Altimate Code (Sonnet 4.6, open source) in first place at 74.4%, ahead of Cortex Code (Opus 4.6, Snowflake-native) at 65.0% and Claude Code (Sonnet 4.6, general-purpose) at about 40%." style="display:block;margin:0 auto" />

<p>Your agent writes a query. Before it touches your warehouse:</p>
<p>The wrong table name that would have triggered a 30-second Snowflake error? <strong>Caught in 2ms</strong> with a fix suggestion. Five agent fix cycles cost 10ms and not 2.5 minutes of warehouse round-trips.</p>
<p>The cartesian join that would have silently inflated your numbers by 100x? <strong>Caught before execution.</strong> 26 compiled anti-pattern rules, zero false positives across 1,077 benchmark queries.</p>
<p>The column your downstream dashboard depends on? <strong>Traced to its source</strong> through every JOIN, CTE, and subquery with 100% edge match on 500 benchmark queries. The agent reasons on verified lineage, not guesses.</p>
<p>The PII in the staging table you're about to expose? <strong>Flagged, with a masking policy recommended.</strong> The SQL injection hiding in a Jinja template? <strong>Flagged.</strong></p>
<p>All compiled. All deterministic. All in milliseconds.</p>
<h2>Making the harness your own</h2>
<p>Engines are the foundation. But what makes Altimate Code <em>yours</em> is what you build on top of them.</p>
<p><strong>Persistent memory</strong> spans across sessions in two scopes: global (your preferences) and project (team knowledge versioned in git). Tell the agent "we never use FLOAT for money columns"… it remembers. Next session, next teammate, the knowledge is there. When one engineer corrects the agent, every teammate inherits the fix on <code>git pull</code>. No Slack message. No wiki update. The correction just propagates.</p>
<p><strong>Governed agent modes</strong> enforce permissions at the engine level, not through prompt instructions that models ignore at long context lengths. The Analyst can't INSERT, UPDATE, DELETE, or DROP. Not because of a system prompt, but because the compiled engine won't execute it. The Builder gets full read/write with your SQL rules applied. The Planner maps tasks without executing.</p>
<p><strong>The compactor</strong> summarizes long sessions while preserving data engineering state: warehouse connections, schema context, dbt project state, lineage findings. Multi-hour sessions maintain continuity across compaction boundaries.</p>
<p><strong>The tracer</strong> captures every LLM call, tool invocation, and warehouse metric locally. No external services. No data leaving your machine. Run <code>/trace</code> for an interactive viewer.</p>
<h2>Why independent?</h2>
<p>Snowflake shipped <a href="https://www.snowflake.com/en/blog/cortex-code-cli-expands-support/">Cortex Code</a>. Databricks launched <a href="https://www.databricks.com/blog/introducing-genie-code">Genie Code</a>. Both recognized that general-purpose agents don't work for data. But both shipped solutions that suit their ecosystem.</p>
<p>Cortex Code won't help you migrate <em>off</em> Snowflake and onto BigQuery. Genie Code is not designed to optimize a Redshift query. Your Airflow DAGs don't run inside Databricks. Your warehouses span multiple providers. Your governance crosses every platform boundary. Your AI agents should too.</p>
<p>Altimate Code connects to Snowflake, BigQuery, Databricks, PostgreSQL, Redshift, DuckDB, MySQL, SQL Server, Oracle, and SQLite. It runs with Anthropic, OpenAI, Google, AWS Bedrock, Azure, Ollama, and OpenRouter. With local models and the local-only tracer, it runs fully air-gapped so no data leaves your machine.</p>
<p>Platform agents will always have telemetry we can't access. We'll always have independence they can't offer. Neither Snowflake nor Databricks will build first-class support for the other's warehouse. Neither will tell your agent a query is unnecessary when their revenue depends on you running it.</p>
<p>Your harness should be yours.</p>
<h2>Try it</h2>
<pre><code class="language-plaintext">npm install -g @altimateai/altimate-code
altimate
</code></pre>
<p>The second command opens the Altimate Code TUI. Type <code>/discover</code> there, and it finds your warehouse connections, tests each one, and offers to index your schemas.</p>
<p>Open source on <a href="https://github.com/AltimateAI/altimate-code">GitHub</a>. Docs at <a href="https://help.altimate.ai/code/getting-started/">altimate-code.ai</a>. Ten data stores. Any LLM. No platform tax.</p>
<h2>What we're building next, and where you can help</h2>
<p>The compiled engines ship today. Here's where we're headed and where we need the community:</p>
<p><strong>Pipeline monitoring</strong> for Airflow and Dagster. We want this to be proactive, not just interactive.</p>
<p><strong>Blast radius analysis.</strong> Before the agent acts, show what breaks downstream.</p>
<p><strong>Decision memory:</strong> extract <em>why things were built</em> from your Git history so agents stop undoing decisions they don't know were made.</p>
<p><strong>Agent Data sandboxes:</strong> changes prove themselves before touching production and many more</p>
<p>Some of these we'll build. Some of them you'll build first. The roadmap, the benchmarks, and every known gap are in the repo. PRs welcome. Issues welcome. Forks welcome.</p>
<p>We'd rather build this in the open than wait for it to be built inside a walled garden. If you're a data engineer who stitches tools together for a living, come break it.</p>
<h2>Want to learn more or get involved?</h2>
<p>Three options:</p>
<ol>
<li><p><a href="https://github.com/AltimateAI/altimate-code">Check out the project on Github</a> - star the repo to support the project</p>
</li>
<li><p><a href="https://altimate.studio/join-agentic-data-engineering-slack">Join us on Slack</a> - we are launching a new Slack channel for our Agentic Data Engineering efforts. <a href="https://altimate.studio/join-agentic-data-engineering-slack">Join us here</a>.</p>
</li>
<li><p>Sign up for <a href="https://youtube.com/live/g-ACWwz9TGg">next week's live overview and AMA</a> on YouTube.</p>
</li>
</ol>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/introducing-altimate-code/04d44fc2-99f4-442b-9df5-80debde510b6.jpg" type="image/jpeg" />
  </item>
  <item>
    <title>Teaching Claude Code the Art of Data Engineering: Introducing Altimate Skills</title>
    <link>https://altimate.ai/blog/teaching-claude-code-the-art-of-data-engineering-introducing-altimate-skills</link>
    <guid isPermaLink="true">https://altimate.ai/blog/teaching-claude-code-the-art-of-data-engineering-introducing-altimate-skills</guid>
    <pubDate>Thu, 22 Jan 2026 20:31:04 GMT</pubDate>
    <dc:creator>Anand Gupta</dc:creator>
    <category>datamates</category>
    <category>altimate</category>
    <category>data-engineering</category>
    <category>AI skills</category>
    <category>aiskills</category>
    <category>snowflake</category>
    <category>dbt</category>
    <category>altimateAI</category>
    <category>AI</category>
    <category>claude.ai</category>
    <category>claude-code</category>
    <category>genai</category>
    <description>Today, we&apos;re open-sourcing Altimate Skills — a collection of Claude Code skills specifically designed for analytics engineers. We are starting with skills for dbt and Snowflake. These encode the workf</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/teaching-claude-code-the-art-of-data-engineering-introducing-altimate-skills/1048fa9e-42f7-45d3-b2e8-47db897f7d4b.jpeg" alt="Teaching Claude Code the Art of Data Engineering: Introducing Altimate Skills" /></p>
<hr />
<p>Today, we're open-sourcing <strong>Altimate Skills</strong> — a collection of <a href="https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview">Claude Code skills</a> specifically designed for analytics engineers. We are starting with skills for dbt and Snowflake. These encode the workflows and best practices that transform AI from a basic code generator into a capable data engineering assistant.</p>
<div class="blog-embed"><iframe src="https://www.youtube.com/embed/kvIo5PmF0Ns" title="YouTube video player" loading="lazy" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>

<p><strong>Key Results:</strong></p>
<ul>
<li><p><strong>+25% improvement</strong> on model creation tasks (40% → 65%)</p>
</li>
<li><p><strong>+22% faster execution</strong> (TPC-H 1TB) with 100% logically equivalent queries generated for SQL optimization.</p>
</li>
<li><p><strong>53% accuracy</strong> on <a href="https://github.com/dbt-labs/ade-bench">ADE-bench</a> (43 real-world dbt tasks)</p>
</li>
<li><p>Skills that actually <strong>teach Claude <em>how</em> to work</strong>, not just <em>what</em> to write</p>
</li>
</ul>
<pre><code class="language-bash"># Get started in 30 seconds
/plugin marketplace add AltimateAI/data-engineering-skills
/plugin install dbt-skills@data-engineering-skills
</code></pre>
<p><strong>GitHub:</strong> <a href="https://github.com/AltimateAI/data-engineering-skills">https://github.com/AltimateAI/data-engineering-skills</a> and ⭐ the repo.</p>
<hr />
<h2>Solving the C<strong>ontext and Workflow Issue</strong></h2>
<p>If you've used Claude Code, Cursor, or any AI coding assistant for dbt development, you've experienced the frustration:</p>
<p><strong>The task:</strong> "Create a staging model for the Stripe payment source."</p>
<p><strong>What you expect:</strong></p>
<pre><code class="language-sql">-- models/staging/stripe/stg_stripe__payments.sql
{{
  config(
    materialized='view',
    schema='staging'
  )
}}

with source as (
    select * from {{ source('stripe', 'payments') }}
),

renamed as (
    select
        id as payment_id,
        amount_cents / 100.0 as amount,
        currency,
        status,
        created_at
    from source
)

select * from renamed
</code></pre>
<p><strong>What you get:</strong></p>
<pre><code class="language-sql">SELECT * FROM {{ source('stripe', 'payments') }}
</code></pre>
<p>No <code>stg_</code> prefix. No <code>{{ source() }}</code> reference. No config block. No CTEs. No understanding of your project's conventions.</p>
<h3>Why This Happens</h3>
<p>The core issue isn't that LLMs lack knowledge — Claude knows dbt syntax perfectly well. The problem is <strong>context and workflow</strong>:</p>
<ol>
<li><p><strong>No project awareness</strong> — Claude doesn't know your naming conventions, folder structure, or existing patterns</p>
</li>
<li><p><strong>No verification loop</strong> — Claude declares "done" after writing code, without running <code>dbt build</code></p>
</li>
<li><p><strong>No convention discovery</strong> — Claude guesses at patterns instead of reading existing models first</p>
</li>
<li><p><strong>Compile ≠ Success</strong> — <code>dbt compile</code> passes, but the model produces the wrong output</p>
</li>
</ol>
<p>This leads to a frustrating cycle: AI writes code → You review and fix → AI loses context → Repeat.</p>
<hr />
<h2>What Are Claude Code Skills?</h2>
<p>Anthorpic introduced <a href="https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview">Claude Skills</a> in October 2025. Skills are markdown files that teach Claude <strong>how to approach tasks</strong>, not just what syntax to use. Think of them as encoding the workflow an experienced analytics engineer follows.</p>
<p>Skills matter because they make Claude more reliable and specialized: you can standardize repeatable work (like formatting outputs, following internal conventions, or running a known process) and reuse it across projects. Claude can also load Skills progressively, starting with lightweight metadata and pulling in deeper instructions only when needed, giving you targeted behavior without bloating context.</p>
<p>Practically, a Skill is typically packaged as a small folder of structured instructions (and optionally templates, scripts, or reference files) that define <em>how</em> Claude should approach a workflow. See our <a href="https://github.com/AltimateAI/data-engineering-skills">data-engineering-skills</a> repo folders as an example.</p>
<p>A skill has two parts:</p>
<p><strong>1. Trigger conditions</strong> — When should this skill activate?</p>
<pre><code class="language-yaml">---
name: creating-dbt-models
description: |
  Guide for creating dbt models. ALWAYS use this skill when:
  (1) Creating ANY new model (staging, intermediate, mart)
  (2) Task mentions "create", "build", "add" with model/table
  (3) Modifying model logic or columns
---
</code></pre>
<p><strong>2. Workflow instructions</strong> — What steps should Claude follow?</p>
<pre><code class="language-markdown"># dbt Model Development

**Read before you write. Build after you write. Verify your output.**

## Critical Rules
1. ALWAYS run `dbt build` after creating models - compile is NOT enough
2. ALWAYS verify output after build using `dbt show`
3. If build fails 3+ times, stop and reassess your approach

## Workflow
### 1. Understand Requirements
- What columns are needed?
- What is the grain (one row per what)?
- What calculations are required?

### 2. Discover Project Conventions
cat dbt_project.yml
find models/ -name "*.sql" | head -20
Read 2-3 existing models to learn patterns...
</code></pre>
<p>When Claude encounters a task that matches the trigger conditions, it automatically applies the skill's workflow.</p>
<hr />
<h2>The Skills We Built</h2>
<h3><a href="https://github.com/AltimateAI/data-engineering-skills/tree/main/skills/dbt">dbt Skills</a></h3>
<table>
<thead>
<tr>
<th>Skill</th>
<th>Purpose</th>
<th>Key Behaviors</th>
</tr>
</thead>
<tbody><tr>
<td><strong>creating-dbt-models</strong></td>
<td>Model creation</td>
<td>Convention discovery → Write → Build → Verify output</td>
</tr>
<tr>
<td><strong>debugging-dbt-errors</strong></td>
<td>Error troubleshooting</td>
<td>Read full error → Check upstream → Apply fix → Rebuild</td>
</tr>
<tr>
<td><strong>testing-dbt-models</strong></td>
<td>Schema tests</td>
<td>Study existing test patterns → Match project style</td>
</tr>
<tr>
<td><strong>documenting-dbt-models</strong></td>
<td>Documentation</td>
<td>Analyze model → Generate descriptions</td>
</tr>
<tr>
<td><strong>migrating-sql-to-dbt</strong></td>
<td>Legacy SQL conversion</td>
<td>Parse SQL → Create proper dbt model</td>
</tr>
<tr>
<td><strong>refactoring-dbt-models</strong></td>
<td>Safe restructuring</td>
<td>Track dependencies → Apply changes → Verify downstream</td>
</tr>
</tbody></table>
<h3><a href="https://github.com/AltimateAI/data-engineering-skills/tree/main/skills/snowflake">Snowflake Skills</a></h3>
<table>
<thead>
<tr>
<th>Skill</th>
<th>Purpose</th>
<th>Key Behaviors</th>
</tr>
</thead>
<tbody><tr>
<td><strong>optimizing-query-text</strong></td>
<td>Performance tuning (from SQL)</td>
<td>Profile query → Identify bottlenecks → Apply patterns</td>
</tr>
<tr>
<td><strong>optimizing-query-by-id</strong></td>
<td>Performance tuning (from query ID)</td>
<td>Fetch query from history → Analyze → Optimize</td>
</tr>
<tr>
<td><strong>finding-expensive-queries</strong></td>
<td>Cost analysis</td>
<td>Query ACCOUNT_USAGE → Identify top spenders</td>
</tr>
</tbody></table>
<hr />
<h2>Deep Dive: How creating-dbt-models Changes Claude's Behavior</h2>
<p>Let's trace through a real task from our benchmark to see the difference.</p>
<blockquote>
<h3>Task: "Create a model called dim_customer that renames id to customer_id and makes it a unique primary key."</h3>
</blockquote>
<h3>Without Skills (Baseline Claude)</h3>
<p><strong>Claude's approach:</strong></p>
<ol>
<li>Write the SQL immediately:</li>
</ol>
<pre><code class="language-sql">SELECT
  id AS customer_id,
  *
FROM customers
</code></pre>
<ol>
<li><p>Run <code>dbt compile</code> → passes</p>
</li>
<li><p>Declare done</p>
</li>
</ol>
<p><strong>Outcome:</strong> Model compiles, but:</p>
<ul>
<li><p>Wrong table reference (raw table vs staging model)</p>
</li>
<li><p>No config block matching project patterns</p>
</li>
<li><p>No verification that the output is correct</p>
</li>
<li><p>No <code>unique</code> test added for primary key</p>
</li>
</ul>
<h3>With creating-dbt-models Skill</h3>
<p>(<a href="https://github.com/AltimateAI/data-engineering-skills/tree/main/skills/dbt/creating-dbt-models">See the specific SKILL.md file here</a>)</p>
<p><strong>Claude's approach:</strong></p>
<p><strong>Step 1: Understand Requirements</strong></p>
<ul>
<li><p>Columns needed: <code>customer_id</code> (renamed from <code>id</code>), plus all other columns</p>
</li>
<li><p>Grain: One row per customer</p>
</li>
<li><p>Constraint: Must be unique on <code>customer_id</code></p>
</li>
</ul>
<p><strong>Step 2: Discover Project Conventions</strong></p>
<pre><code class="language-bash">$ cat dbt_project.yml
# Shows model-paths, naming conventions

$ find models/ -name "*.sql" | head -10
models/staging/stg_customers.sql
models/staging/stg_products.sql
models/marts/dim_products.sql

$ cat models/marts/dim_products.sql
# Learns: CTEs named 'source' and 'final', config blocks, column naming
</code></pre>
<p><strong>Step 3: Find Upstream Models</strong></p>
<pre><code class="language-bash">$ cat models/staging/stg_customers.sql
# Discovers the correct source to reference
</code></pre>
<p><strong>Step 4: Write Model (following discovered patterns)</strong></p>
<pre><code class="language-sql">-- models/marts/dim_customer.sql
{{
  config(
    materialized='table'
  )
}}

with source as (
    select * from {{ ref('stg_customers') }}
),

final as (
    select
        id as customer_id,
        name,
        email,
        created_at
    from source
)

select * from final
</code></pre>
<p><strong>Step 5: Update schema.yml with test</strong></p>
<pre><code class="language-yaml">models:
  - name: dim_customer
    columns:
      - name: customer_id
        tests:
          - unique
          - not_null
</code></pre>
<p><strong>Step 6: Build and Verify</strong></p>
<pre><code class="language-bash">$ dbt build --select dim_customer
# Actually runs the model and tests

$ dbt show --select dim_customer --limit 5
# Verifies output looks correct
</code></pre>
<p><strong>Outcome:</strong> Model matches project conventions, has proper tests, output verified.</p>
<hr />
<h2>Benchmarking: ADE-bench Results</h2>
<p>We evaluated our skills using <a href="https://github.com/dbt-labs/ade-bench">ADE-bench</a>, a framework for evaluating AI agents on analytics engineering tasks created by dbt Labs.</p>
<h3>Test Setup</h3>
<ul>
<li><p><strong>43 tasks</strong> across 5 projects (Airbnb reviews, F1 racing, Asana projects, Analytics engineering, Intercom conversations)</p>
</li>
<li><p><strong>Task types:</strong> Model creation, bug fixing, debugging, refactoring, data analysis</p>
</li>
<li><p><strong>Model:</strong> Claude Sonnet 4.5</p>
</li>
<li><p><strong>Database:</strong> Snowflake</p>
</li>
<li><p><strong>Evaluation:</strong> Automated tests comparing model output to expected results</p>
</li>
</ul>
<h3>Task Difficulty Distribution</h3>
<table>
<thead>
<tr>
<th>Difficulty</th>
<th>Example Task</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Easy</strong></td>
<td>"Fix the surrogate_key deprecation warning."</td>
</tr>
<tr>
<td><strong>Medium</strong></td>
<td>"Create a dim_customer model with unique primary key."</td>
</tr>
<tr>
<td><strong>Hard</strong></td>
<td>"Identify which top-N tables have inconsistent results due to tie.s"</td>
</tr>
</tbody></table>
<h3>Overall Results</h3>
<table>
<thead>
<tr>
<th>Configuration</th>
<th>Accuracy</th>
<th>Tasks Resolved</th>
<th>Avg Runtime</th>
<th>Avg Cost</th>
</tr>
</thead>
<tbody><tr>
<td>Baseline Claude (no skills, no MCP)</td>
<td>46.5%</td>
<td>20/43</td>
<td>152s</td>
<td>$0.33/task</td>
</tr>
<tr>
<td>Claude + Skills</td>
<td>53.5%</td>
<td>23/43</td>
<td>182s</td>
<td>$0.40/task</td>
</tr>
</tbody></table>
<h3>Results by Task Category</h3>
<table>
<thead>
<tr>
<th>Category</th>
<th>Baseline</th>
<th>With Skills</th>
<th>Improvement</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Model Creation</strong></td>
<td>40%</td>
<td>65%</td>
<td><strong>+25 pts</strong></td>
</tr>
<tr>
<td><strong>Bug Fixing</strong></td>
<td>60%</td>
<td>70%</td>
<td>+10 pts</td>
</tr>
<tr>
<td><strong>Debugging</strong></td>
<td>35%</td>
<td>50%</td>
<td>+15 pts</td>
</tr>
<tr>
<td><strong>Refactoring</strong></td>
<td>30%</td>
<td>35%</td>
<td>+5 pts</td>
</tr>
<tr>
<td><strong>Analysis</strong></td>
<td>25%</td>
<td>30%</td>
<td>+5 pts</td>
</tr>
</tbody></table>
<h3>What Worked</h3>
<p><strong>Model creation</strong> saw the biggest improvement. The creating-dbt-models skill's workflow of "discover conventions → write → build → verify" catches errors that baseline Claude misses:</p>
<ol>
<li><p><strong>Convention discovery</strong> prevents wrong naming/structure</p>
</li>
<li><p><strong>Mandatory</strong> <code>dbt build</code> catches runtime errors that <code>compile</code> misses</p>
</li>
<li><p><strong>Output verification</strong> ensures the model produces correct data</p>
</li>
</ol>
<p><strong>Example success — Task</strong> <code>analytics_engineering003</code>:</p>
<blockquote>
<p>"Create a model called 'dim_customer' that renames id to customer_id, and makes that row a unique primary key."</p>
</blockquote>
<ul>
<li><p>Baseline: Created model but wrong column reference, no test</p>
</li>
<li><p>With skills: Discovered existing staging model, matched project patterns, and added proper unique test</p>
</li>
</ul>
<h3>What Didn't Work</h3>
<p><strong>Complex analysis tasks</strong> remain challenging. Tasks requiring deep reasoning about data behavior (like identifying which queries have non-deterministic results due to ties) still need human insight.</p>
<p><strong>Example failure — Task</strong> <code>f1003</code>:</p>
<blockquote>
<p>"Identify which top-N tables have inconsistent results due to ties in the data"</p>
</blockquote>
<p>This task requires:</p>
<ol>
<li><p>Understanding the semantic meaning of "ties"</p>
</li>
<li><p>Analyzing actual data values across 8 models</p>
</li>
<li><p>Reasoning about SQL ordering behavior</p>
</li>
</ol>
<p>Skills can't encode this kind of domain reasoning — they work best for <strong>workflow guidance</strong>, not <strong>analytical judgment</strong>.</p>
<hr />
<h2>The Overhead Trade-off</h2>
<p>Skills add overhead. The "discover conventions" step takes 15-30 seconds of additional LLM calls. Is it worth it?</p>
<table>
<thead>
<tr>
<th>Metric</th>
<th>Without Skills</th>
<th>With Skills</th>
</tr>
</thead>
<tbody><tr>
<td>Avg task time</td>
<td>152 seconds</td>
<td>182 seconds</td>
</tr>
<tr>
<td>Success rate</td>
<td>46.5%</td>
<td>53.5%</td>
</tr>
<tr>
<td>Time to first success</td>
<td>~5-6 min</td>
<td>~3-4 min</td>
</tr>
<tr>
<td>Human intervention needed</td>
<td>High</td>
<td>Low</td>
</tr>
</tbody></table>
<p><strong>Our conclusion:</strong> The 30-second overhead is worth it because:</p>
<ol>
<li><p>Successful tasks need no human review</p>
</li>
<li><p>Failed tasks fail faster (3-failure rule)</p>
</li>
<li><p>Time saved on human review &gt;&gt; time spent on convention discovery</p>
</li>
</ol>
<h2>Benchmarking: SQL Query Optimization</h2>
<p>We evaluated the <code>optimizing-query-text</code> skill on TPC-H SF1000 (1TB dataset).</p>
<h3>Test Setup</h3>
<ul>
<li><p><strong>10 queries</strong> from TPC-H benchmark</p>
</li>
<li><p><strong>Model:</strong> Claude Sonnet 4.5</p>
</li>
<li><p><strong>Evaluation:</strong> Automated comparison of query results + execution time</p>
</li>
</ul>
<h3>Overall Results</h3>
<table>
<thead>
<tr>
<th>Configuration</th>
<th>Pass Rate</th>
<th>Avg Time Improvement</th>
</tr>
</thead>
<tbody><tr>
<td>Baseline Claude (no skills)</td>
<td>80% (8/10)</td>
<td>+25% (on passing queries)</td>
</tr>
<tr>
<td>Claude + Skills</td>
<td><strong>100% (10/10)</strong></td>
<td>+22%</td>
</tr>
</tbody></table>
<h3>What Failed Without Skills</h3>
<p>Baseline failed 2 queries by making "optimizations" that changed what the query returned:</p>
<ul>
<li><p>Changed deduplication behavior, returning extra rows</p>
</li>
<li><p>Renamed columns, breaking downstream compatibility</p>
</li>
</ul>
<hr />
<h2>Installation &amp; Usage</h2>
<h3>Add the Marketplace</h3>
<pre><code class="language-bash">/plugin marketplace add AltimateAI/data-engineering-skills
</code></pre>
<h3>Install Skills</h3>
<p>You can browse and install via the CLI, or directly install plugins:</p>
<pre><code class="language-bash"># Install dbt skills
/plugin install dbt-skills@data-engineering-skills

# Install Snowflake skills
/plugin install snowflake-skills@data-engineering-skills
</code></pre>
<p>After installing, skills activate automatically when you mention relevant tasks.</p>
<h3>Available Skills</h3>
<p><strong>dbt Skills:</strong></p>
<ul>
<li><p><code>creating-dbt-models</code> — Model creation with convention discovery</p>
</li>
<li><p><code>debugging-dbt-errors</code> — Systematic error troubleshooting</p>
</li>
<li><p><code>testing-dbt-models</code> — Schema tests and data quality</p>
</li>
<li><p><code>documenting-dbt-models</code> — Generate descriptions in schema.yml</p>
</li>
<li><p><code>migrating-sql-to-dbt</code> — Convert legacy SQL to dbt models</p>
</li>
<li><p><code>refactoring-dbt-models</code> — Safe restructuring with impact analysis</p>
</li>
</ul>
<p><strong>Snowflake Skills:</strong></p>
<ul>
<li><p><code>optimizing-query-text</code> — Optimize SQL you provide</p>
</li>
<li><p><code>optimizing-query-by-id</code> — Optimize using query ID from history</p>
</li>
<li><p><code>finding-expensive-queries</code> — Find top cost/time queries</p>
</li>
</ul>
<h3>Usage</h3>
<p>Skills activate automatically based on your request:</p>
<table>
<thead>
<tr>
<th>Your Request</th>
<th>Skill Activated</th>
</tr>
</thead>
<tbody><tr>
<td>"Create a new orders model."</td>
<td><code>creating-dbt-models</code></td>
</tr>
<tr>
<td>"Fix this compilation error."</td>
<td><code>debugging-dbt-errors</code></td>
</tr>
<tr>
<td>"Add tests to the customers model."</td>
<td><code>testing-dbt-models</code></td>
</tr>
<tr>
<td>"Document the revenue metrics".</td>
<td><code>documenting-dbt-models</code></td>
</tr>
<tr>
<td>"This query is slow; optimize it."</td>
<td><code>optimizing-query-text</code></td>
</tr>
<tr>
<td>"Why is query X expensive?"</td>
<td><code>optimizing-query-by-id</code></td>
</tr>
<tr>
<td>"What are our most expensive queries?"</td>
<td><code>finding-expensive-queries</code></td>
</tr>
</tbody></table>
<hr />
<h2>Combining Skills with Altimate MCP Tools</h2>
<p>Skills become even more powerful when combined with <a href="https://docs.myaltimate.com/">Altimate's MCP server</a>. The MCP server provides real-time access to your dbt project and data warehouse:</p>
<table>
<thead>
<tr>
<th>MCP Tool</th>
<th>What It Provides</th>
</tr>
</thead>
<tbody><tr>
<td><code>dbt_project_info</code></td>
<td>Project structure, model list, sources</td>
</tr>
<tr>
<td><code>dbt_model_details</code></td>
<td>Column types, dependencies, compiled SQL</td>
</tr>
<tr>
<td><code>dbt_compile</code></td>
<td>Compile models without CLI</td>
</tr>
<tr>
<td><code>snowflake_query_history</code></td>
<td>Recent query executions and stats</td>
</tr>
<tr>
<td><code>snowflake_table_stats</code></td>
<td>Row counts, clustering info</td>
</tr>
</tbody></table>
<p><strong>Example: Skills + MCP workflow</strong></p>
<p>User: "The daily_revenue model is producing wrong numbers."</p>
<p>Claude (with skills + MCP):</p>
<ol>
<li><p><strong>debugging-dbt-errors skill activates</strong></p>
</li>
<li><p>Uses <code>dbt_model_details</code> to get model SQL and dependencies</p>
</li>
<li><p>Uses <code>dbt_compile</code> to check for errors</p>
</li>
<li><p>Queries upstream models to verify input data</p>
</li>
<li><p>Identifies the issue (e.g., missing WHERE clause)</p>
</li>
<li><p>Fixes and rebuilds</p>
</li>
<li><p>Uses <code>dbt show</code> to verify the correct output</p>
</li>
</ol>
<hr />
<h2>What We Learned Building This</h2>
<h3>1. Workflow &gt; Knowledge</h3>
<p>The biggest wins came from encoding <strong>workflows</strong>, not facts. Claude already knows dbt syntax — what it lacks is the discipline to:</p>
<ul>
<li><p>Check existing patterns before writing</p>
</li>
<li><p>Run <code>dbt build</code> instead of <code>dbt compile</code></p>
</li>
<li><p>Verify output after build</p>
</li>
</ul>
<h3>2. The 3-Failure Rule</h3>
<p>We added this to every skill:</p>
<blockquote>
<p>"If build fails 3+ times, STOP. Step back and reassess your entire approach."</p>
</blockquote>
<p>This prevents Claude from making tiny tweaks hoping they work. Instead, it forces a fundamental rethink.</p>
<h3>3. Skills Can't Replace Domain Expertise</h3>
<p>Skills work best for <strong>procedural tasks</strong> with clear success criteria. They struggle with:</p>
<ul>
<li><p>Tasks requiring business context</p>
</li>
<li><p>Ambiguous requirements ("make this better")</p>
</li>
<li><p>Deep analytical reasoning about data behavior</p>
</li>
</ul>
<h3>4. Convention Discovery Is Essential</h3>
<p>The #1 source of Claude errors was mismatched conventions. Simply adding "read 2-3 existing models first" eliminated most of these.</p>
<hr />
<h2>What's Next</h2>
<p>We're actively developing:</p>
<ul>
<li><p><strong>Airflow skills</strong> — DAG development, debugging, testing</p>
</li>
<li><p><strong>Cross-platform migration</strong> — dbt ↔ SQL Server, Oracle</p>
</li>
<li><p><strong>Snowflake cost optimization</strong> — Warehouse sizing, query patterns</p>
</li>
<li><p><strong>Data quality workflows</strong> — Anomaly detection, freshness checks</p>
</li>
</ul>
<h3>Contributing</h3>
<p>Altimate Skills is open source (MIT License). We welcome:</p>
<ul>
<li><p><strong>New skills</strong> for workflows we haven't covered</p>
</li>
<li><p><strong>Improvements</strong> to existing skills based on your team's patterns</p>
</li>
<li><p><strong>Benchmark results</strong> on different datasets</p>
</li>
</ul>
<p><strong>GitHub:</strong> <a href="https://github.com/AltimateAI/data-engineering-skills">https://github.com/AltimateAI/data-engineering-skills</a></p>
<hr />
<h2>Try It Now</h2>
<pre><code class="language-bash"># Add the marketplace
/plugin marketplace add AltimateAI/altimate-skills

# Install the plugins you need
/plugin install dbt-skills@altimate-skills
/plugin install snowflake-skills@altimate-skills
</code></pre>
<p><strong>Resources:</strong></p>
<ul>
<li><p><a href="https://github.com/AltimateAI/data-engineering-skills">GitHub Repository</a> and ⭐ the repo.</p>
</li>
<li><p><a href="https://docs.myaltimate.com/">Altimate MCP Server Docs</a></p>
</li>
<li><p><a href="https://github.com/dbt-labs/ade-bench">ADE-bench Framework</a></p>
</li>
<li><p><a href="https://app.slack.com/client/T0VLPD22H/C05KPDGRMDW">dbt Slack #tools-dbt-power-user</a></p>
</li>
</ul>
<hr />
<p><em>Built by the team at</em> <a href="https://altimate.ai/"><em>Altimate AI</em></a> <em>— Making data engineering delightful.</em></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/teaching-claude-code-the-art-of-data-engineering-introducing-altimate-skills/1048fa9e-42f7-45d3-b2e8-47db897f7d4b.jpeg" type="image/jpeg" />
  </item>
  <item>
    <title>Adaptive Compute vs. Auto Tune: A Practical Guide to Optimizing Snowflake Warehouses</title>
    <link>https://altimate.ai/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses</link>
    <guid isPermaLink="true">https://altimate.ai/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses</guid>
    <pubDate>Wed, 30 Jul 2025 22:41:32 GMT</pubDate>
    <dc:creator>Dana Van Aken</dc:creator>
    <category>altimateAI</category>
    <category>data-engineering</category>
    <category>snowflake</category>
    <category>Snowflake performance</category>
    <category>data-warehousing</category>
    <description>Managing Snowflake warehouses efficiently is a constant balancing act. Set them too large, and you&apos;re burning money on idle compute. Too small, and your queries slow to a crawl, frustrating users and</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses/6da7cca8-4c24-457a-80da-e02f4eb8bff6.jpeg" alt="Adaptive Compute vs. Auto Tune: A Practical Guide to Optimizing Snowflake Warehouses" /></p>
<blockquote><p><strong>Updated 16 Sep 2026.</strong> Snowflake made Adaptive Compute generally available on AWS on 16 June 2026. The GA release renamed the settings this post describes. For the current parameters, billing and conversion limits, read <a href="/blog/adaptive-compute-vs-auto-tune-optimizing-snowflake-warehouses">Adaptive Compute vs Auto-Tune: Optimizing Snowflake Warehouses</a>.</p></blockquote><p>Managing Snowflake warehouses efficiently is a constant balancing act. Set them too large, and you're burning money on idle compute. Too small, and your queries slow to a crawl, frustrating users and missing SLAs. For many organizations, this manual tuning process is time-consuming while still leaving significant cost savings on the table.</p>
<p>Two solutions promise to solve this challenge in very different ways: Snowflake's new <strong>Adaptive Compute</strong> eliminates warehouse management complexity entirely, while <strong>Altimate AI's Auto Tune</strong> brings intelligent automation to standard warehouses with granular cost controls. This guide breaks down how each works, their tradeoffs, and which to choose based on your specific needs.</p>
<h2>What is Adaptive Compute?</h2>
<p>Today, managing Snowflake warehouses requires juggling multiple decisions: choosing the right size (X-Small through 6X-Large), configuring cluster policies, setting auto-suspend timers, and more. Get these wrong, and you're likely to be overpaying for idle compute or suffering from poor query performance.</p>
<p><strong>Adaptive Compute</strong> changes this equation entirely. Instead of fixed-size warehouses, <strong>Adaptive Warehouses</strong> act as pointers to a shared, elastic compute pool that Snowflake manages behind the scenes. When you submit a query to an Adaptive Warehouse, Snowflake automatically:</p>
<ul>
<li><p>Analyzes the query plan and resource requirements</p>
</li>
<li><p>Allocates the right amount of compute from the shared pool</p>
</li>
<li><p>Routes the query to available resources</p>
</li>
<li><p>Scales compute up or down based on actual needs</p>
</li>
</ul>
<p>Think of it like switching from buying dedicated servers to using serverless functions – you stop worrying about infrastructure and focus on your workloads.</p>
<img src="/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses/448aedd0-9d02-4f34-8bd9-e292885bf9c2.png" alt="With Adaptive Warehouses, customers still interact with named warehouses, but under the hood, each warehouse is simply a pointer to a shared compute pool within the account. Queries are automatically routed to appropriately sized compute clusters based on their resource needs and availability." style="display:block;margin:0 auto" />

<p><em><strong>Figure 1:</strong></em> <em>With Adaptive Warehouses, customers still interact with named warehouses, but under the hood, each warehouse is simply a pointer to a shared compute pool within the account. Queries are automatically routed to appropriately sized compute clusters based on their resource needs and availability.</em></p>
<h3>From Many Settings to Just Two</h3>
<p>Snowflake’s standard warehouses require configuring multiple parameters:</p>
<ul>
<li><p>Warehouse size</p>
</li>
<li><p>Minimum and maximum cluster count</p>
</li>
<li><p>Scaling policy (Standard or Economy)</p>
</li>
<li><p>Auto-suspend timing</p>
</li>
<li><p>Auto-resume behavior</p>
</li>
<li><p>Query Acceleration</p>
</li>
</ul>
<p>Adaptive Compute replaces all of these with just two settings:</p>
<ol>
<li><p><strong>Warehouse Credit Limit:</strong> The maximum credits the warehouse can consume per hour. This acts as your primary control lever, determining how many concurrent queries can run based on their compute requirements. When the warehouse reaches its credit limit, additional queries are queued until resources become available.</p>
</li>
<li><p><strong>Target Statement Size (temporary):</strong> An optional hint about your expected query sizes. Currently, Adaptive Compute only supports scaling down for smaller queries, and this setting defines the maximum target size. Note that Snowflake intends to deprecate this setting once Adaptive Compute’s autoscaling capabilities mature[<a href="#references-section">1</a>], so don’t build processes around it.</p>
</li>
</ol>
<img src="/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses/44797494-87ad-4e37-ac25-fb978775b24c.png" alt="Side-by-side Snowflake warehouse creation dialogs: a Standard warehouse with Auto-resume, Auto-suspend and multi-cluster settings on the left, next to an Adaptive warehouse with only a credit limit and target statement size field on the right." style="display:block;margin:0 auto" />

<p><em><strong>Figure 2:</strong></em> <em>Adaptive Compute reduces configuration complexity by replacing multiple tuning settings with just two controls: a Warehouse Credit Limit and an optional Target Statement Size.</em></p>
<p>If you convert a standard warehouse to Adaptive, Snowflake sets the initial Warehouse Credit Limit based on the formula: <code>Warehouse Credit Limit = Current Warehouse Size Credits × Max Cluster Count</code>.</p>
<p>It also sets the Target Statement Size equal to the original warehouse size.</p>
<p>For example, if you convert a Large warehouse (8 credits/hour) with <code>max_clusters=4</code> to Adaptive, you get:</p>
<ul>
<li><p><strong>Warehouse Credit Limit:</strong> 32 credits/hour (8 credits × 4 clusters)</p>
</li>
<li><p><strong>Target Statement Size:</strong> Large</p>
</li>
</ul>
<p>Your Adaptive warehouse can then concurrently run queries totaling up to 32 credits per hour; for example, four Large queries, sixteen Small queries, or any combination fitting within the credit limit.</p>
<h2>Where Adaptive Compute Delivers</h2>
<h3><strong>Simplified Infrastructure Management</strong></h3>
<p>Adaptive Compute removes much of the manual setup required to manage Snowflake warehouses, freeing up data teams to concentrate on driving business outcomes and delivering innovation. This hands-off model is especially beneficial for platform teams managing large fleets of warehouses, and less technical users who don’t want to think about warehouse tuning.</p>
<h3><strong>Smarter Resource Allocation</strong></h3>
<p>Because Snowflake's optimizer has access to detailed query plan metadata (e.g., estimated row counts, join strategies, data volumes), it can predict resource needs more accurately than external tools. Assigning just enough CPU and memory per query also reduces the likelihood of over-provisioning.</p>
<p><strong>Example scenario:</strong> Two very different queries are submitted to the same Adaptive Warehouse simultaneously:</p>
<table>
<thead>
<tr>
<th><strong>Query</strong></th>
<th><strong>Description</strong></th>
<th><strong>Predicted Compute Needs</strong></th>
</tr>
</thead>
<tbody><tr>
<td>A</td>
<td>Complex 5-way join with 100M rows</td>
<td>Gets Large-sized compute</td>
</tr>
<tr>
<td>B</td>
<td>Simple filter on 1000 rows</td>
<td>Gets X-Small-sized compute</td>
</tr>
</tbody></table>
<p>As shown in the table, Adaptive Compute predicts greater compute needs for the Query A (the heavier query) than Query B (the simpler query).</p>
<h3><strong>Seamless Conversion from Standard Warehouses</strong></h3>
<p>Converting to Adaptive Compute is simple and requires no downtime:</p>
<p><code>ALTER WAREHOUSE my_warehouse SET TYPE = 'ADAPTIVE';</code></p>
<p>Running queries complete on the old compute while new queries immediately use adaptive resources. There’s no need to update connection strings, modify scripts, or coordinate downtime windows.</p>
<h3><strong>Solving Warehouse Sprawl</strong></h3>
<p>A common issue is warehouse sprawl, where companies create separate warehouses for different teams, workload types, or usage patterns. For example, a marketing team might operate five different warehouses:</p>
<ul>
<li><p><code>MARKETING_REPORTS_L</code> (idle 22 hours/day)</p>
</li>
<li><p><code>MARKETING_ETL_XL</code> (runs 2 hours nightly)</p>
</li>
<li><p><code>MARKETING_DASHBOARD_L</code> (idle 20 hours/day)</p>
</li>
<li><p><code>MARKETING_ADHOC_M</code> (sporadic usage)</p>
</li>
<li><p><code>MARKETING_TEST_XS</code> (barely used)</p>
</li>
</ul>
<p><strong>The Problem:</strong></p>
<p>Managing many separate warehouses leads to unnecessary costs due to idle compute time and minimum billing increments. Even quick 5-second queries incur charges for a full minute of compute. Across hundreds of warehouses, this adds up to significant wasted spend each month.</p>
<p><strong>The Adaptive Solution:</strong></p>
<p>With Adaptive Compute, the marketing team can convert each of their five warehouses to Adaptive, and still maintain the same warehouse names for accounting purposes. The shared compute pool ensures resources are available when needed without incurring idle time charges across five warehouses.</p>
<h2>Critical Unknowns: What's Still Unclear</h2>
<p>While Adaptive Compute offers clear operational benefits, it’s still in private preview and several important details remain unclear. And these details matter, especially for organizations under tight cost or performance SLAs.</p>
<h3><strong>Limited Cost Control Mechanisms</strong></h3>
<p>Adaptive Compute optimizes for performance and simplicity, not cost reduction. If Target Statement Size is deprecated as planned[<a href="#references-section">1</a>], you'll have only one lever: the Warehouse Credit Limit. Without any settings to guide compute size per query, cost-saving strategies like pushing low-priority workloads to smaller compute are no longer possible.</p>
<p><strong>Consider this scenario:</strong> Your team runs a daily report that takes 2 minutes on Small compute (2 credits/hour = 0.067 credits) or 1.5 minutes on Medium compute (4 credits/hour = 0.10 credits).</p>
<p>With standard warehouses, your team can choose Small to save 33% on credits, but Adaptive Compute might decide on Medium due to the speed improvement, increasing your spend regardless of your priorities.</p>
<p><strong>What you lose:</strong></p>
<ul>
<li><p>Ability to force non-critical workloads onto smaller compute to save money (e.g., running non-critical reports on X-Small warehouses)</p>
</li>
<li><p>Option to set aggressive auto-suspend for development warehouses (e.g., setting 1-minute auto-suspend for ad-hoc warehouses)</p>
</li>
<li><p>Control over running specific workloads on larger warehouses when deadlines require it</p>
</li>
</ul>
<h3><strong>Cache Behavior Uncertainty</strong></h3>
<p>Snowflake’s local disk cache can significantly boost query performance, with warm-cache queries often running 5–10x faster than cold ones. Standard warehouses with longer auto-suspend settings are more likely to retain this cache between queries. But with Adaptive's shared compute model, cache behavior becomes unpredictable, potentially impacting both performance and costs.</p>
<p><strong>Why this matters:</strong></p>
<ul>
<li><p>Dashboard queries that typically benefit from warm cache might see inconsistent performance</p>
</li>
<li><p>ETL pipelines that read the same base tables repeatedly could lose optimization opportunities</p>
</li>
<li><p>Cost implications if queries that previously hit cache now require full table scans</p>
</li>
</ul>
<h3>Monitoring and Debugging Challenges</h3>
<p>With standard warehouses, you can directly observe and control which warehouse a query runs on. With Adaptive Compute, the routing decisions happen behind the scenes, and it’s unclear what additional metadata Snowflake will surface around how those routing decisions are made, such as:</p>
<ul>
<li><p>What size compute ran each query and how routing logic behaved</p>
</li>
<li><p>Whether the router over‑ or under‑sized compute for specific queries</p>
</li>
<li><p>Whether queries are being queued due to credit limits or resource availability</p>
</li>
</ul>
<h3><strong>Impact on Spend</strong></h3>
<p>Snowflake's launch materials for Adaptive Compute emphasize ease of use and performance, with no mention of cost savings[<a href="#references-section">2</a>, <a href="#references-section">3</a>, <a href="#references-section">4</a>]. This positioning suggests Adaptive Compute isn't designed to reduce spend, which is a critical consideration for organizations with FinOps accountability or tight budget constraints.</p>
<h2>How Altimate AI's Auto Tune Delivers Control and Automation</h2>
<p>For organizations that want automation without sacrificing cost control, Altimate AI's Warehouse Auto Tune offers a powerful alternative. It brings intelligent optimization to your existing standard warehouses to optimize size, idle time, and cluster configuration while providing even finer-grained control over speed versus savings.</p>
<img src="/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses/24663eaa-3c07-4d03-be84-ff45f81b1d95.png" alt="Altimate AI Auto Tune dashboard, Performance tab, daily bar chart of Snowflake spend and savings from Jun 26 to Jul 27, 2025, with a tooltip on Jul 23 showing $263.40 total cost and $34.85–$45.38 in Auto Tune savings." style="display:block;margin:0 auto" />

<p><em><strong>Figure 3:</strong></em> <em>Daily cost breakdown showing Auto Tune savings over time. Each bar displays actual spend (yellow) and realized savings (green) from warehouse suspension, scaling, and sizing optimizations. On July 23, 2025, Auto Tune saved between $34.85 and $45.38, with most savings from Warehouse Suspension and Scaling. Total realized savings during the selected period exceeded $1.1K.</em></p>
<h3><strong>Proactive Suspension and Cluster Scaling</strong></h3>
<p>Auto Tune minimizes idle time by scaling back clusters and suspending warehouses before Snowflake's native auto-suspend triggers. It continuously monitors activity and proactively reduces compute allocation during quiet periods.</p>
<h3><strong>Predictive Workload-Based Resizing</strong></h3>
<p>Auto Tune doesn't just react to current load – it predicts upcoming demand based on your historical workload patterns to determine when warehouses can be safely downsized without impacting performance.</p>
<p><strong>How it works in practice:</strong></p>
<p>Let's say you have a Large warehouse that processes heavy ETL jobs from 2-6 AM but runs mostly small queries the rest of the day. Auto Tune identifies this workload pattern and automatically:</p>
<ul>
<li><p>Maintains Large size during the 2-6 AM ETL window</p>
</li>
<li><p>Downsizes to Medium during low-demand periods</p>
</li>
<li><p>Returns to Large before the next ETL window</p>
</li>
</ul>
<h3><strong>Granular Performance Safeguards</strong></h3>
<p>Auto Tune provides multiple mechanisms to protect critical workloads while optimizing costs:</p>
<p><strong>1. Custom Schedule Blocks</strong> Custom schedule blocks define specific time windows where warehouses must maintain a certain size. Examples:</p>
<ul>
<li><p>Weekdays 9-10 AM: Keep <code>EXECUTIVE_DASHBOARD_WH_XL</code> at default size X-Large for C-suite daily reviews to ensure performance</p>
</li>
<li><p>Sunday 2-5 AM: Keep <code>ARCHIVE_ETL_WH</code> downsized to Small while reprocessing past months of data to reduce costs</p>
</li>
</ul>
<p><strong>2. Real-Time Backoff Configuration</strong></p>
<p>Set performance thresholds that automatically reverse downsizing decisions if query latency or queue times exceed acceptable levels. When triggered, the system reverts to default size and pauses auto-resizing for one hour.</p>
<p><strong>Example Backoff Configurations for Different Workload Types:</strong></p>
<table>
<thead>
<tr>
<th><strong>Workload Type</strong></th>
<th><strong>Latency Threshold</strong></th>
<th><strong>Queue Threshold</strong></th>
<th><strong>Rationale</strong></th>
</tr>
</thead>
<tbody><tr>
<td>Customer-facing dashboards</td>
<td>120%</td>
<td>125%</td>
<td>Minimal tolerance for delays</td>
</tr>
<tr>
<td>Internal analytics</td>
<td>150%</td>
<td>150%</td>
<td>Balanced cost/performance</td>
</tr>
<tr>
<td>Batch ETL jobs</td>
<td>180%</td>
<td>170%</td>
<td>Cost savings prioritized</td>
</tr>
</tbody></table>
<h3><strong>Transparency and Control Over Decisions</strong></h3>
<p>Auto Tune provides full visibility into every optimization decision:</p>
<ul>
<li><p>Daily/weekly/monthly spend trends with savings clearly separated by agent</p>
</li>
<li><p>Detailed logs explaining why each resizing decision was made</p>
</li>
<li><p>Calendar view of all scheduled and completed optimization windows</p>
</li>
</ul>
<img src="/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses/798f097c-7ae7-42aa-95c2-8b9d2a355511.png" alt="Auto tune history timeline listing warehouse resize and suspend events by DataPilot, with one entry expanded showing the reasoning for downsizing from Large to Medium based on light query workload." style="display:block;margin:0 auto" />

<p><em><strong>Figure 4:</strong></em> <em>Auto Tune history log showing recent warehouse actions taken. The agents resized warehouses dynamically based on query patterns, including downsizing from Large to Medium size to reduce cost without impacting performance.</em></p>
<h3><strong>Warehouse Eligibility and Smart Targeting</strong></h3>
<p>Auto Tune automatically evaluates each warehouse to determine if it's a good candidate for resizing optimization. Eligible warehouses typically have:</p>
<ul>
<li><p>Periods of low utilization with mainly small queries</p>
</li>
<li><p>Predictable daily or weekly patterns</p>
</li>
<li><p>Meaningful compute spend to optimize</p>
</li>
</ul>
<p>This ensures resizing agents only focus on warehouses where they can deliver real value and help cut costs.</p>
<h2>Making the Right Choice: Adaptive vs. Auto Tune</h2>
<p>Here are a few pointers for choosing the right solution.</p>
<h3><strong>Choose Adaptive Compute When:</strong></h3>
<ul>
<li><p><strong>Simplicity is paramount:</strong> You want to eliminate warehouse management entirely</p>
</li>
<li><p><strong>Workloads are unpredictable:</strong> Highly variable query patterns make sizing difficult</p>
</li>
<li><p><strong>Performance matters most:</strong> You're willing to pay more for consistent speed</p>
</li>
<li><p><strong>You're consolidating many underutilized warehouses:</strong> The reduction in idle time offsets other costs</p>
</li>
</ul>
<h3><strong>Choose Auto Tune When:</strong></h3>
<ul>
<li><p><strong>Cost control is critical:</strong> You have specific spending targets to hit</p>
</li>
<li><p><strong>Workloads follow patterns:</strong> Your queries have predictable daily/weekly cycles</p>
</li>
<li><p><strong>You need granular control:</strong> Different workloads require different cost/performance tradeoffs</p>
</li>
<li><p><strong>You want transparency:</strong> Detailed visibility into optimization decisions and savings</p>
</li>
</ul>
<h3><strong>Hybrid Approach</strong></h3>
<p><strong>Many organizations will benefit from using both solutions strategically.</strong> For example:</p>
<ul>
<li><p>Convert your <code>DATA_SCIENCE_SANDBOX</code> warehouse to Adaptive Compute since data scientists run unpredictable queries at random times</p>
</li>
<li><p>Keep your <code>PRODUCTION_ETL</code> warehouse on standard with Auto Tune, reducing spend through predictable downsizing during known quiet periods</p>
</li>
<li><p>Use Adaptive for all development/test warehouses to eliminate idle charges</p>
</li>
<li><p>Apply Auto Tune to customer-facing warehouses where you need cost control with performance guarantees</p>
</li>
</ul>
<h2>Final Thoughts</h2>
<p>Snowflake's Adaptive Compute and Altimate AI's Auto Tune represent two philosophies for warehouse optimization: total simplicity versus intelligent control. Adaptive Compute eliminates management overhead but sacrifices cost optimization levers. Auto Tune maintains the flexibility of standard warehouses while adding automation that typically reduces costs by 10-20%.</p>
<p>Start by analyzing your warehouse utilization patterns and cost targets. If predictable savings matter more than operational simplicity, Auto Tune is likely your best choice. If you're drowning in warehouse management complexity and can accept higher costs for simplicity, Adaptive Compute offers compelling benefits. For most organizations, a hybrid approach will deliver the best of both worlds.</p>
<p>If your team already has tools in place for analyzing warehouse usage patterns, monitoring cost targets, and automating warehouse optimization, you're all set. If not, we can help you with the analysis, optimization, and choosing between Adaptive and standard warehouses based on your needs. <a href="https://app.myaltimate.com/contactus">Reach out to us</a> for a no-cost POC.</p>
<h2>References</h2>
<ol>
<li><p><a href="https://reg.snowflake.com/flow/snowflake/summit25/sessions/page/catalog/session/1741712659023001GszH">What's New: Faster Insights with Snowflake Standard Warehouse - Gen2 and Adaptive Compute</a>. Snowflake Summit 2025 Session Catalog. June 3, 2025.</p>
</li>
<li><p><a href="https://www.snowflake.com/en/news/press-releases/snowflake-unveils-next-wave-of-compute-innovations-for-faster-more-efficient-warehouses-and-ai-driven-data-governance/">Snowflake Unveils Next Wave of Compute Innovations For Faster, More Efficient Warehouses and AI-Driven Data Governance</a>. Snowflake press release, June 3, 2025.</p>
</li>
<li><p><a href="https://www.snowflake.com/en/blog/adaptive-compute-smarter-warehouses/">Introducing Even Easier-to-Use Snowflake Adaptive Compute with Better Price/Performance</a>. Snowflake Blog, June 3, 2025.</p>
</li>
<li><p><a href="https://medium.com/snowflake/how-snowflakes-adaptive-warehouse-is-revolutionizing-data-operations-at-pfizer-f90f1730ef0c">How Snowflake’s Adaptive Warehouse Is Revolutionizing Data Operations at Pfizer</a>. Snowflake Builders Blog on Medium; Matt Massey, June 3, 2025.</p>
</li>
</ol>
<hr />
<p>Deliver more performance and cost savings with Altimate AI's cutting-edge AI teammates. These intelligent teammates come pre-loaded with the insights discussed in this article, enabling you to implement our recommendations across warehouses, tables, and millions of queries effortlessly. Ready to see it in action? Request a recorded demo by <a href="https://app.myaltimate.com/contactus">sending us a chat message</a>) and discover how AI teammates can transform your data teams.</p>
<p><a href="https://app.myaltimate.com/contactus"><img src="/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses/d9ad5daf-6edc-4c94-a697-80f6cb79cbc5.png" alt="Promotional banner reading ‘AI Data Teammates that work for you 24/7’ beside a screenshot of the Auto Tune savings dashboard, with a Book a Demo button." /></a></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses/6da7cca8-4c24-457a-80da-e02f4eb8bff6.jpeg" type="image/jpeg" />
  </item>
  <item>
    <title>Supercharging Cursor IDE: How the dbt Power User Extension’s Embedded MCP Server Unlocks AI-Driven dbt Development</title>
    <link>https://altimate.ai/blog/supercharging-cursor-ide-how-the-dbt-power-user-extensions-embedded-mcp-server-unlocks-ai-driven-dbt-development</link>
    <guid isPermaLink="true">https://altimate.ai/blog/supercharging-cursor-ide-how-the-dbt-power-user-extensions-embedded-mcp-server-unlocks-ai-driven-dbt-development</guid>
    <pubDate>Fri, 21 Mar 2025 02:51:16 GMT</pubDate>
    <dc:creator>Anand Gupta</dc:creator>
    <category>cursor ai</category>
    <category>dbt</category>
    <category>data-engineering</category>
    <category>altimateAI</category>
    <category>#ai-tools</category>
    <category>AI</category>
    <description>Introduction
We’re excited to announce a major new capability in the dbt Power User VSCode extension: an embedded Model Context Protocol (MCP) server. This MCP server is now built directly into the ex</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/supercharging-cursor-ide-how-the-dbt-power-user-extensions-embedded-mcp-server-unlocks-ai-driven-dbt-development/49891252-c36a-48cc-9e28-589ba5ea1d33.jpeg" alt="Supercharging Cursor IDE: How the dbt Power User Extension’s Embedded MCP Server Unlocks AI-Driven dbt Development" /></p>
<h2>Introduction</h2>
<p>We’re excited to announce a major new capability in the <strong>dbt Power User</strong> VSCode extension: an embedded <strong>Model Context Protocol (MCP)</strong> server. This MCP server is now built directly into the extension, acting as a bridge between AI-powered development tools and your dbt project. The motivation behind implementing an embedded MCP server is to enable seamless communication between AI assistants (like those in Cursor IDE) and dbt, eliminating the friction of context switching. In practical terms, this means your AI coding assistant can query your dbt project’s schema, compile models, run tests, and more – all through a standardized protocol – leading to faster development workflows and greater efficiency for dbt developers.</p>
<p>By leveraging the MCP server, dbt Power User can expose rich project context and operations to AI agents in real-time. This empowers data engineers to automate repetitive tasks (like looking up column definitions or running model builds) and accelerates development. The embedded MCP server unlocks new AI-driven workflows for dbt, from intelligent autocompletion to on-demand documentation generation, all while keeping the interaction localized and secure within your development environment.</p>
<h2>Technical Architecture and Cursor IDE Integration</h2>
<p>At a high level, the MCP server runs as a lightweight web service within the dbt Power User extension environment. The server spins up automatically when you open a dbt project (if you have enabled the MCP feature) and listens on a local port. It selects an available port dynamically at launch to avoid conflicts, and registers itself with Cursor by updating Cursor’s MCP configuration. Once running, the Cursor IDE detects the MCP server and establishes a connection so its AI assistant can invoke dbt-related “tools” exposed by the server.</p>
<img src="/blog/supercharging-cursor-ide-how-the-dbt-power-user-extensions-embedded-mcp-server-unlocks-ai-driven-dbt-development/64322c3e-e90b-4fff-810e-ea4e6a17b8b1.png" alt="Architecture diagram of the dbt Power User MCP server: Cursor IDE’s user interface and MCP Client connect over SSE to the MCP server’s Service Core and Tool Registry, which drives a dbt Project Container that parses Catalog.json, Manifest.json and Project Files, calls dbt Core and dbt Cloud, and watches the file system for changes." style="display:block;margin:0 auto" />

<p><strong>Server Components and Design:</strong> The MCP server architecture is composed of a few key components working in tandem:</p>
<ul>
<li><p><strong>Server Core:</strong> the core HTTP server (built with the MCP SDK) that handles incoming requests and responses. It defines the MCP endpoints and protocol handling (e.g. registering available tools, managing sessions, etc.). The server core orchestrates requests from Cursor’s AI and ensures each is routed to the appropriate handler in the extension.</p>
</li>
<li><p><strong>Tool Registry:</strong> a registry of <strong>tools</strong> – individual operations or actions related to dbt. Each tool has a name and a function implementing its behavior. When the server starts, it registers a suite of tools (detailed in the next section) that allow the AI to perform various dbt tasks. The Tool Registry essentially maps MCP requests to the extension’s internal methods or dbt CLI calls. It also defines metadata for each tool (like input parameters and descriptions) that Cursor’s AI can utilize to formulate requests.</p>
</li>
<li><p><strong>SSE Transport:</strong> the server uses <strong>Server-Sent Events (SSE)</strong> for real-time communication back to the client. After Cursor connects to the MCP server, it maintains an open SSE channel. When a tool is executed, results (and any interim output or logs) are sent as a stream of events over this channel to Cursor. This means the AI can receive data or status updates from long-running tasks in real time, without polling. For example, if you execute a model run via the AI, the MCP server can stream back logs or a success/failure message as soon as it’s available. Using SSE for output ensures a responsive, event-driven interaction between the extension and the AI assistant.</p>
</li>
</ul>
<img src="/blog/supercharging-cursor-ide-how-the-dbt-power-user-extensions-embedded-mcp-server-unlocks-ai-driven-dbt-development/21274320-18a7-4b37-9fb5-02818ed815de.png" alt="Simplified diagram of Cursor IDE’s AI assistant exchanging MCP tool requests with the MCP server, which queries the dbt Artifact Manager and runs models through the dbt Integration to reach the data warehouse." style="display:block;margin:0 auto" />

<p><em>Architecture of the MCP Server integration with Cursor.</em></p>
<p><em><strong>The diagram shows the Cursor IDE’s AI assistant interacting with the MCP server via tool requests.</strong></em> <em>The MCP server (within the dbt Power User extension) processes these requests using its registered tools. It interacts with in-memory dbt project artifacts for quick context and, when needed, invokes the dbt Integration module (which in turn may query the data warehouse) to fulfill the request. Results and logs are returned back to the AI client in real-time via SSE.</em></p>
<p><strong>Communication Flow:</strong> The end-to-end flow of a typical interaction involves several steps that connect the AI to your dbt project:</p>
<ol>
<li><p><strong>AI Initiates a Tool Request:</strong> Within Cursor, the AI assistant decides to call a tool (for example, “get the SQL definition of model X” or “run tests for model Y”) and sends a request through the MCP protocol.</p>
</li>
<li><p><strong>MCP Server Receives the Request:</strong> The server core matches the incoming request to one of the registered tools in its registry and hands off execution to that tool’s handler.</p>
</li>
<li><p><strong>Tool Execution:</strong> The tool’s handler runs inside the extension process. It may fetch information from the in-memory dbt artifacts (e.g. to get a model’s definition or lineage) or execute a dbt operation. The handler leverages the extension’s existing capabilities – for example, calling a function in the extension that wraps dbt operations to perform the task.</p>
</li>
<li><p><strong>In-Memory Artifact Access:</strong> If the tool needs to read project structure (models, sources, tests, etc.), it queries the up-to-date in-memory representation of the dbt project (more on this in the next section). This avoids expensive disk or CLI operations for retrieving metadata. If the tool needs to run SQL or dbt operations, it might invoke the dbt integration module and use the database connections configured in the dbt profile.</p>
</li>
</ol>
<p>In essence, the MCP server turns the dbt extension into a real-time API for your dbt project. Cursor’s AI no longer operates in a vacuum – it can actively query your project’s state and perform operations, treating the dbt project as an interactive context it can reason about. All of this happens locally within your development environment, leveraging the work the extension is already doing to maintain dbt context.</p>
<h2>In-Memory dbt Artifacts Lifecycle and Performance Optimization</h2>
<p>One of the standout benefits of the MCP server is that it can serve data to the AI assistant <strong>directly from memory</strong>, without constantly hitting your filesystem or database. The dbt Power User extension maintains an in-memory representation of your project’s artifacts as you work. This includes the parsed project manifest (models, sources, tests, exposures, etc. along with their relationships), and metadata like the active target and project name. By tapping into these in-memory artifacts, the MCP server can answer many questions instantly and run operations more efficiently.</p>
<p><strong>Creation and Initialization:</strong> When you open a dbt project in VS Code, the extension immediately initializes and parses the project. It loads manifest information (by invoking dbt’s parse operation under the hood and translating it to its own in-memory representation through its own parser) to build a graph of models and references in memory. This means the extension knows about all your model definitions, sources, tests, and their lineage as soon as the project is ready. At the moment the MCP server starts (which typically coincides with project load or when you enable the feature), it attaches to this ready-to-use project context. The server core may wait until the dbt project is fully initialized and then mark its tools as available for the AI. Essentially, <strong>the server boots up after the dbt context is prepared</strong>, ensuring the AI always sees a consistent project state.</p>
<p><strong>Live Updates:</strong> As you modify files or the project state changes, the in-memory artifacts are updated incrementally. The extension listens to file system events and dbt execution outcomes – for example, if you edit a model file, it can re-parse that model and update the manifest graph in memory. Likewise, running <code>dbt deps</code> will refresh the list of installed packages in memory. The MCP server subscribes to these internal events. If the manifest is updated or a new run is completed, the server can invalidate or refresh relevant cached data. This way, tools like “get children models of X” will always use the latest information. The lifecycle is managed such that <strong>any time the dbt project changes, the in-memory state and the MCP server’s view of it remain in sync</strong>. This is much faster than re-running <code>dbt</code> commands for each query and ensures the AI doesn’t get stale data.</p>
<p><strong>Efficient Querying:</strong> Because the data is in memory, tools that retrieve info (e.g. listing models, showing a model’s SQL, computing lineage) execute extremely quickly. There’s no need to spawn a subprocess or read from disk for these – the extension can simply look up the Python/TypeScript object representing that model. Even complex lineage traversals or dependency graphs can be resolved by the extension’s code using pre-computed relationships. This optimization is critical for performance: it allows the AI to ask a series of detailed questions about your project without incurring heavy overhead. For example, an AI reasoning about why a model’s test failed can rapidly pull the model’s SQL, its parent models, and the test definition via multiple MCP tool calls in seconds, whereas doing this via CLI repeatedly would be far slower.</p>
<p><strong>Cleanup and Lifecycle End:</strong> The MCP server’s lifetime is tied to your VS Code session and project. If you close the project or disable the extension, the server is stopped and the in-memory artifacts are freed. The implementation ensures that sockets are closed and event listeners are disposed to avoid resource leaks. Notably, the server core exposes a clean <strong>dispose()</strong> method that the extension calls on shutdown, which shuts down the SSE stream and prevents further tool calls.</p>
<p>Overall, the approach of leveraging in-memory artifacts means that the MCP server can provide a <strong>fast, rich context</strong> to the AI. It capitalizes on the work already being done by the dbt Power User extension’s internal DBT parser and project tracker. This not only speeds up AI interactions but also avoids unnecessary load on your data warehouse – the AI can get a lot of information without executing a single query, unless absolutely necessary for the task.</p>
<h2>Capabilities Unlocked: Tools Provided by the MCP Server</h2>
<p>The MCP server exposes a robust set of tools that the AI assistant can use. These tools cover most day-to-day dbt tasks and are grouped into a few categories for clarity. Below is a breakdown of major capabilities and examples of tools in each category:</p>
<h3>Project &amp; Environment Management Tools</h3>
<ul>
<li><strong>Project Information:</strong> Usually the AI will fetch all the dbt projects and its roots first, to know on which project it should work. The AI will use the root of the project as a parameter to the other tools. For instance, a tool <code>GET_PROJECT_NAME</code> returns the dbt project name for the given root, and <code>GET_SELECTED_TARGET</code> returns which target/profile is active. This is useful for the AI to contextually understand which environment it’s working with (production or development).</li>
</ul>
<h3>Model and Source Exploration Tools</h3>
<ul>
<li><p><strong>Model SQL and Schema:</strong> Tools in this category allow the AI to fetch the content or properties of dbt models and sources. For example, a <code>COMPILE_QUERY</code> tool can return the raw SQL of a model file, and a <code>GET_COLUMNS_OF_SOURCE</code> could return details about a source (like database/schema and columns as defined in YAML). With these, the AI can, say, read the logic of a model to help debug or suggest changes.</p>
</li>
<li><p><strong>Lineage and Dependency Queries:</strong> We provide tools like <code>GET_CHILDREN_MODELS</code> and <code>GET_PARENT_MODELS</code>, which return the immediate downstream and upstream models of a given model. The AI can use these to understand the dependency graph – for instance, finding what will be impacted if a model is changed or which upstream data sources feed into it. Internally, these tools leverage the manifest graph in memory to quickly compute the relationships. Additionally, there are count-based queries (like a tool to count the number of models depending on a source) to aid impact analysis.</p>
</li>
<li><p><strong>Column Lineage and Documentation:</strong> (Upcoming) The extension already has features for column-level lineage and documentation. Through MCP, we intend to expose tools so the AI can answer questions like “which models use column X from source Y” or even retrieve documentation strings for a model or column. This will bridge the gap between documentation and code by letting the AI pull in documented context as needed.</p>
</li>
</ul>
<h3>SQL Compilation &amp; Execution Tools</h3>
<ul>
<li><p><strong>Compile SQL:</strong> The AI might want to see how dbt renders a model’s SQL with Jinja templating. The <code>COMPILE_QUERY</code> tool takes a query (and optionally the model it is derived from) and returns the compiled SQL, exactly as dbt would generate it. This is extremely useful for checking logic or debugging macros – the AI can get the SQL that would run on the warehouse, without actually running it. It uses dbt’s compilation engine (via the extension’s interface to dbt Core) under the hood.</p>
</li>
<li><p><strong>Execute Arbitrary SQL:</strong> Sometimes the AI will need to run a query to answer a question (for example, “preview the first 10 rows of model X”). The <code>EXECUTE_SQL</code> tool (with a configurable row limit) allows running a SQL query against the project’s data warehouse connection and returns results, ensuring we don’t pull massive datasets by accident. The AI could use this to validate assumptions or provide sample data to the user. Users must explicitly permit this feature, as executing SQL will share data with the AI.</p>
</li>
<li><p><strong>Run dbt Models:</strong> For full pipeline execution, we offer tools to run or build models. The <code>RUN_MODEL</code> tool triggers <code>dbt run</code> for a specific model (and optionally its dependencies), while <code>BUILD_MODEL</code> can run the model and its tests (equivalent to <code>dbt build</code> for that model). There’s also a <code>BUILD_PROJECT</code> for running the entire project (<code>dbt build</code>). These commands execute in the background through the extension’s job runner. The AI can thus initiate a model run or a full project build from within the conversation – for example, “Re-run the revenue model to see if the issue is fixed.”</p>
</li>
</ul>
<h3>Testing and Validation Tools</h3>
<ul>
<li><p><strong>Execute Tests:</strong> The server provides a <code>RUN_TEST</code> tool to execute a specific dbt test by name, as well as <code>RUN_MODEL_TEST</code> to run all tests associated with a particular model. This allows the AI to verify data quality or detect if recent changes broke any tests. For instance, after modifying a model, the AI might call <code>RUN_MODEL_TEST</code> to ensure all tests still pass and then report the results. Test results or failures will be returned via the event stream.</p>
</li>
<li><p><strong>SQL Validation:</strong> (Planned) Even without running on the warehouse, the extension can do a lightweight SQL parse/validation. A tool is available to validate a SQL query (checking for syntax errors, missing refs, etc.) without executing it. This is similar to the extension’s existing <strong>SQL Lint</strong> feature, now accessible to the AI. It can prevent the AI from running a bad query by first validating it and catching errors.</p>
</li>
<li><p><strong>Performance Analysis:</strong> (Planned) We aim to add tools that use dbt’s compilation stats or query planner insights to help the AI assist in performance tuning. For example, a tool to show the <strong>compiled query explain plan</strong> (if the warehouse supports <code>EXPLAIN</code>) or to estimate the cost of a query. Such tools would let the AI caution the user if a query might be expensive or if a model lacks proper pruning filters, etc.</p>
</li>
</ul>
<h3>Package Management and Repository Tools</h3>
<ul>
<li><p><strong>Install Packages:</strong> Managing dbt packages is made easier with tools like <code>INSTALL_DEPS</code> which runs <code>dbt deps</code> to install the packages listed in <code>packages.yml</code>. There’s also an <code>ADD_DBT_PACKAGES</code> tool that can add new packages on the fly. For example, if the AI suggests using a package (like dbt-utils), it could call <code>ADD_DBT_PACKAGES</code> with the package name and version – the extension will add it to <code>packages.yml</code> and run <code>dbt deps</code> internally to install it, returning the result. This showcases agentic behavior: the AI can not only suggest but also take action to modify your project structure (with your permission).</p>
</li>
<li><p><strong>Upgrade dbt Version:</strong> Although not explicitly a tool in this release, the infrastructure could allow the AI to assist in upgrading the dbt version or dependencies. For example, by reading <code>requirements.txt</code> or checking the installed dbt version, and then running pip installs. This would likely be added as a safe tool in future once we ensure such actions are gated behind user approval.</p>
</li>
<li><p><strong>Git Operations:</strong> While primarily focused on dbt tasks, the larger vision includes enabling some project-level Git interactions via MCP (for example, checking out a new branch for a fix, or opening a pull request). The current server does not directly include Git tools, but it lays the groundwork for integrating such capabilities alongside dbt tasks, so the AI could orchestrate end-to-end workflows (code change -&gt; run model -&gt; test -&gt; commit).</p>
</li>
</ul>
<p>All these tools are defined in the extension and registered with the MCP server at startup. When Cursor’s AI is formulating a plan to help you, it queries the MCP server for an index of available tools (the MCP protocol allows the client to discover tools and their input schema). The AI sees something like “I have a tool called <code>get_children_models</code> that needs a <code>table</code> name” and it can then decide to use it if the user asks a question about model dependencies.</p>
<h2>Under the Hood: Port Management, Error Handling, and Security</h2>
<p>Building an embedded server inside an IDE extension comes with its own engineering challenges. We put significant effort into making sure the MCP server runs smoothly without disrupting your workflow.</p>
<p><strong>Port Management:</strong> Since the MCP server is local, it needs to choose a port to listen on. We default to letting the OS assign an open port (by binding to port 0, which yields an ephemeral port). Once the server is listening, the extension logs the chosen port. If for some reason the port is not reachable or Cursor cannot connect, the extension will surface an error message. We also handle the case where the server might need to restart (for example, if you re-initialize the project) by cleaning up the old server and starting a new one potentially on a new port. The extension ensures there is only one MCP server instance per workspace to avoid port conflicts. In the future, we may allow a fixed port configuration if users want to expose the server to other tools, but in this beta it’s fully managed and isolated.</p>
<p><strong>Error Handling and Resilience:</strong> The MCP server includes robust error handling so that failures in tools do not crash the server or hang the AI. Each tool execution is wrapped in try/catch logic. If a tool throws an exception (say, dbt fails to compile a query due to a syntax error), the error is caught and sent back as an error event to the AI, and the server remains up for subsequent requests. We’ve instrumented comprehensive logging via the extension’s output channel (the “dbt Power User” output panel in VS Code) to record any exceptions or problematic requests. This makes it easier to debug if something goes wrong – both for us as developers and for users who can check the logs. Overall, the server is designed to be <strong>long-running and robust</strong>, recovering gracefully from errors. In our tests, issues like missing profiles or syntax errors are caught and reported back to the AI without terminating the server.</p>
<p><strong>Security Measures:</strong> Since the MCP server allows automated actions on your project, we have restricted its accessibility to ensure safety. The server <strong>binds only to localhost</strong> and is not accessible from external machines. This means only processes on your computer (like the Cursor IDE) can communicate with it, mitigating risk of any outside interference. Additionally, the server enforces that requests conform to the expected MCP schema – it will reject any malformed requests or unknown tool calls rather than executing them arbitrarily. We also incorporated a simple authentication check in this beta: the MCP server feature will only start if certain preconditions are met (for instance, verifying that you have a valid Altimate API key configured, which is used to enable AI features in the extension). This is mainly to gate the feature during beta and ensure usage can be monitored and supported. In the future, we plan to add more sophisticated security, such as an authentication token for the MCP connection or user consent prompts in VS Code before executing potentially destructive actions (like modifying files or running DDL statements). It’s important to note that the AI agent in Cursor will only use tools in ways you allow – you’re always in control and can disable or limit certain tools if desired. We recommend keeping the extension and Cursor up-to-date to get the latest security improvements. As the community and usage of MCP servers grow, we’ll continue to harden the server (for example, adding rate limiting or sandboxing if the scenario requires it).</p>
<p><strong>Resource Usage:</strong> Running an MCP server is lightweight. It piggybacks on the extension’s process and uses minimal additional memory (mostly just for the HTTP server overhead). The in-memory artifact store is already in place for the extension’s normal operation. We’ve observed negligible impact on VS Code’s performance when the server is idle. During heavy use (like a lot of model runs triggered by AI), there is some CPU and memory use, but it’s equivalent to you running those dbt commands manually. When idle, the server simply holds open a socket for Cursor. If needed, you can always stop the server by disabling the feature in settings, which immediately frees the port and associated resources.</p>
<p><strong>Future Enhancements:</strong> In upcoming releases, we plan to enhance both the capabilities and the internals of the MCP server. On the capability side, we’re looking at adding more tools (as mentioned, possibly Git operations, documentation queries, etc.) and integrating deeper with other systems (imagine the AI triggering an Airflow DAG after a successful dbt run, via a future Airflow MCP server). We’re also considering a plugin mechanism where users could write custom MCP tools for their own macros or operations and have the server load them. Finally, as the MCP protocol evolves (it’s an open standard in active development), we will adapt our server to remain compliant and take advantage of new features. For example, Anthropic’s Claude models recently embraced MCP natively, and we expect more LLMs to follow – our goal is to have the dbt MCP server work with any AI agent that speaks MCP, not just Cursor’s.</p>
<h2>Conclusion: Our Vision Toward an AI-Integrated Data Platform</h2>
<p>The introduction of the MCP server in the dbt Power User extension is a significant step toward an <strong>AI-integrated data development platform</strong>. We’ve turned the VS Code + dbt environment into an AI-accessible service, enabling smarter assistance and automation. This capability is not an isolated feature – it’s part of our broader vision to integrate AI with all facets of the modern data stack. In the near future, you can expect similar integrations with <strong>Snowflake and Postgres</strong> (for example, an AI agent that can profile or manipulate your warehouse data), with <strong>Airflow</strong> (an AI that can inspect DAGs or trigger workflows), and more. Our <strong>DataPilot platform</strong> is evolving into an ecosystem of AI “teammates” that collaborate across tools. The dbt MCP server is one of these teammates, focused on analytics engineering, and it will collaborate with others (imagine an AI assistant that understands your data warehouse, your pipelines, and your dbt models collectively).</p>
<p>We invite you to try out the MCP server. Since it’s a beta release, we greatly value your feedback. Join our community Slack channel (<a href="https://getdbt.slack.com/archives/C05KPDGRMDW"><code>#tools-dbt-power-user</code></a> on dbt Slack) to share your experiences or ask any questions. . If you need help setting it up or want to explore how this could fit into your team’s workflow, please <a href="https://app.myaltimate.com/contactus"><strong>reach out to us</strong></a> . We’re also eager to collaborate with teams interested in pushing the boundaries of AI in data engineering. Whether you have ideas for new MCP tools or want to integrate our platform with your own, let’s start a conversation. Together, let’s redefine what a “power user” can do by combining the strengths of dbt with the intelligence of AI. This launch is just the beginning, and we’re excited to build a more connected, intelligent data platform with your input.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/supercharging-cursor-ide-how-the-dbt-power-user-extensions-embedded-mcp-server-unlocks-ai-driven-dbt-development/49891252-c36a-48cc-9e28-589ba5ea1d33.jpeg" type="image/jpeg" />
  </item>
  <item>
    <title>Could AI Teammates Be the Secret to Efficient Snowflake Cost Management?</title>
    <link>https://altimate.ai/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management</link>
    <guid isPermaLink="true">https://altimate.ai/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management</guid>
    <pubDate>Wed, 13 Nov 2024 15:21:53 GMT</pubDate>
    <dc:creator>John Ryan</dc:creator>
    <category>snowflake administration</category>
    <category>agentic AI</category>
    <category>Artificial Intelligence</category>
    <category>snowflake</category>
    <category>Snowflake performance</category>
    <category>ai-teammates</category>
    <description>In the past five years, Snowflake has disrupted the database, data storage, and analytics industry by massively simplifying the entire data and analytics landscape. However, a new wave of innovation i</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management/4f08497b-47c6-43da-96bc-8a3047f5b8fe.jpeg" alt="Could AI Teammates Be the Secret to Efficient Snowflake Cost Management?" /></p>
<p>In the past five years, Snowflake has disrupted the database, data storage, and analytics industry by massively simplifying the entire data and analytics landscape. However, a new wave of innovation is horizon - Artificial Intelligence and AI Teammates.</p>
<p>This article won't discuss <a href="https://research.ibm.com/blog/what-is-generative-AI">Generative AI</a>, which is (shockingly) already old news, but how AI Teammates working with AI Agents can collaborate alongside your (human) Snowflake System Administrator to help maximize performance and optimize spending on your Snowflake system.</p>
<p>After reading this article, you’ll realize just how powerful this technology is and what a potentially massive game-changer it presents.</p>
<h2>What is an Agentic AI?</h2>
<p>Unless you've been living under a rock for the past two years, you'll be well acquainted with <a href="https://chatgpt.com/">Chat-GPT</a> (other <a href="https://bestarion.com/generative-ai-chatbots/#:~:text=Jasper%20AI,of%20text%20quickly%20and%20efficiently.">AI Chatbots</a> are available), but these are simply passive assistants that quietly wait for your questions and generate text.</p>
<p>That's not denigrate the impact of <a href="https://www.snowflake.com/resource/generative-ai-and-llms-for-dummies/?utm_source=google&amp;utm_medium=paidsearch&amp;utm_campaign=em-gb-en-nb-genaillm-exact&amp;utm_content=go-rsa-evg-eb-generative-ai-and-llms-for-dummies&amp;utm_term=c-g-large%20language%20model-e-690007389282&amp;gad_source=1&amp;gbraid=0AAAAADCzRJUdbdjyUGTGfqHV7XQ5NYv_t&amp;gclid=EAIaIQobChMI4LfK1tGSiQMVEYuDBx0LvAnxEAAYAyAAEgKlXvD_BwE">Large Language Models</a> (LLMs), as a recent <a href="https://www.mckinsey.com/capabilities/mckinsey-digital/our-insights/the-economic-potential-of-generative-ai-the-next-productivity-frontier#key-insights">McKinsey Report</a> indicates that generative AI will add up to $4 trillion to the global economy with up to 70% less employee work required. Indeed, Artificial Intelligence is well on the way to being integrated into almost <a href="https://hogonext.com/how-to-apply-ai-effectively-for-data-warehousing/">every aspect</a> of Data Warehousing.</p>
<p>However, unlike Chat GPT that passively waits for user requests, an AI Teammate works alongside existing staff to monitor query patterns, identify potential issues and offer actionable tuning suggestions. They act as an artificially intelligent advisor, perhaps using machine learning to refine recommendations based on administrator feedback.</p>
<p>AI teammates work autonomously to recommend real-time system configuration and processing adjustments, reacting to events and recommending remedial actions to improve Snowflake customer experience or optimize cost.</p>
<p>Whereas an AI Teammate provides a consulting role, communicating with System Admins in natural language, <a href="https://www.ibm.com/think/topics/ai-agents">AI Agents</a> work autonomously to handle the low-level monitoring, analyzing query patterns and resource usage. In many ways, AI Agents are the back-room workers, providing data to be analyzed and interpreted by the AI Teammates which in turn support the Snowflake Admins.</p>
<p>Taken together, these are often referred to as <a href="https://aisera.com/blog/agentic-ai/#:~:text=Agentic%20AI%20uses%20reinforcement%20learning,reactive%20approach%20of%20Gen%20AI.">Agentic AI</a>.</p>
<h2>Key Features of “AI Teammates” and “Agentic AI”</h2>
<p>It's all well and good using jargon like “AI Agents” - but what makes a solution “<a href="https://www.ssonetwork.com/intelligent-automation/articles/what-is-agentic-ai#:~:text=Agentic%20AI%20refers%20to%20a,without%20requiring%20direct%20human%20intervention.">Agentic</a>” as opposed to, (for example), a Python script that uses machine learning to identify and alert users of potential problems.</p>
<p>Here's a list of the key features an “<a href="https://www.ssonetwork.com/intelligent-automation/articles/what-is-agentic-ai#:~:text=Agentic%20AI%20refers%20to%20a,without%20requiring%20direct%20human%20intervention.">Agentic AI</a>” system.</p>
<ul>
<li><p><strong>Dynamic Problem Solving</strong>: Instead of relying on fixed scripts, in exactly the same way Chat-GPT can currently generate and execute python code, AI agents will generate source code and scripts to analyze data and solve problems . AI Teammates work just like a real person — assessing the situation, deciding what needs to be done, and then executing the plan.</p>
</li>
<li><p><strong>Reduced Technical Skills</strong>: IT automation typically needs technical experts (DBAs and System Admins) to configure and maintain it through scripting. In contrast, Agentic AI allows anyone, including non-coders, to instruct the system in natural language. For example, a user could give the AI an objective like “reduce warehouse costs by reducing idle time” and the AI would figure out the best way to do that, without needing predefined scripting.</p>
</li>
<li><p><strong>Autonomous Operation</strong>: Agentic AI doesn’t need constant supervision. Once given a goal, it will continuously monitor for opportunities to act and take the next steps without waiting for further instructions.</p>
</li>
<li><p><strong>Real-World Interaction</strong>: These AI systems will connect with external tools and databases, pulling in real-time information, and even executing actions like sending emails or making configuration changes. For example, an AI Teammate tasked with reducing Snowflake Virtual Warehouse costs could automatically resize warehouses in real-time to maintain a balance between cost and performance.</p>
</li>
<li><p><strong>Efficiency &amp; Adaptability</strong>: These systems can handle complex workflows by breaking down tasks into smaller steps, calling different tools, and even calling upon AI Agents to handle specific tasks. As AI Teammates are largely autonomous, they are highly efficient needing little human interaction and constantly adapt to changing circumstances.</p>
</li>
</ul>
<h2>How can AI Teammates work on Snowflake?</h2>
<p>AI Teammates can play a vital role in optimizing a complex Snowflake Data Warehouse deployment by automating performance tuning tasks. Here are some practical examples of how Agentic AI could be deployed:</p>
<h3><strong>Tuning Query Performance</strong></h3>
<ul>
<li><p><strong>Identifying Slow Queries</strong>: An AI Teammate could continuously monitor query elapsed times against an objective, prioritizing performance over cost. It would then suggest optimizations, such as <a href="https://articles.analytics.today/snowflake-cluster-keys-and-micro-partition-elimination-best-practices">improving partition pruning</a> or moving a given workload to a different <a href="/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses">warehouse size</a>.</p>
</li>
<li><p><strong>Query Rewriting</strong>: If a query can be rewritten for better performance (e.g., using specific functions like LIMIT to <a href="https://articles.analytics.today/boost-your-snowflake-query-performance-with-these-10-tips">reduce data scanning</a>), the AI Teammate could automatically suggest or implement these changes after analyzing the query execution plan. Of course, this may need a “human in the loop” to verify, test, and deploy the changed code.</p>
</li>
</ul>
<h3><strong>Virtual Warehouse Management</strong></h3>
<p>The screenshot below illustrates how AI Agents deployed by Altimate AI automatically monitor and tune system configuration to identify potential cost savings and implement configuration changes to eliminate waste.</p>
<p><a href="https://altimate.ai/"><img src="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management/ea54c3af-410a-45a2-979f-fbd7914bd3ae.png" alt="Line chart of AI Agent Decisions per day from Oct 14–21, 2024, with tabs to switch to Query Execution Time, Total Bytes Scanned, Query Queuing Time, and Query Count." style="display:block;margin:0 auto" /></a></p>
<ul>
<li><p><strong>Warehouse Configuration</strong>: AI Teammates can continuously monitor <a href="https://articles.analytics.today/snowflake-virtual-warehouses-what-you-need-to-know">virtual warehouse</a> usage patterns and (for example), automatically adjust the AUTO_SUSPEND, WAREHOUSE SIZE or CLUSTER COUNT settings to optimize efficiency. For instance, if a warehouse remains idle longer than expected, the AI Teammate could reduce the auto-suspend timeout or automatically resize warehouses during off-peak hours to reduce costs.</p>
</li>
<li><p><strong>New Feature deployment:</strong> Agentic AI could automatically detect and recommend potential improvements using new Snowflake features. For example, an AI Teammate tasked with maintaining strict performance targets could recommend deploying Snowflake Query Acceleration or Search Optimization Service to improve query performance. This reduces the need for System Administrators to constantly research, understand, and test new Snowflake features, reducing the dependency upon highly skilled (and expensive) resources.</p>
</li>
</ul>
<h3>Managing Snowflake Cluster Keys</h3>
<ul>
<li><p><strong>Identifying Clustering Opportunities:</strong> <a href="https://articles.analytics.today/snowflake-cluster-keys-and-micro-partition-elimination-best-practices">Snowflake Cluster Keys</a> can significantly impact Snowflake query performance, but deployment is more an art than a science. An AI Teammate could automatically analyze query patterns and data distribution to recommend adding, modifying, or removing cluster keys. For instance, if certain columns are frequently used in filter conditions but are not well clustered, the system could recommend creating cluster keys on those columns to speed up query performance.</p>
</li>
<li><p><strong>Monitoring Clustering Efficiency:</strong> As query workloads change over time, once appropriate cluster keys may become less efficient over time. For example, if a data pipeline changes, adds frequent <code>update</code> operations, or changes the data cardinality, this could make clustering less cost-effective. An AI Teammate could monitor the situation and recommend or even automatically deploy changes to improve query performance and optimize cost.</p>
</li>
</ul>
<h3>Dynamic Workload Allocation</h3>
<p><a href="https://hashnode.com/edit/cm0a6anfv000509l4h9qk86ui"><img src="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management/325303f1-47a0-4cab-8c48-8e087c8c9018.png" alt="Triangle diagram showing three competing warehouse goals — Control Cost, Maximize Throughput, and Maximize Query Performance — connected by bidirectional arrows illustrating the trade-offs between them." /></a></p>
<p>The diagram above illustrates the overall challenge faced by System Administrators. Despite constantly increasing system workloads, we need to balance the conflicting needs to maximize system throughput (for example loading and transforming data), with maximizing end-user query performance (for example, delivering query results to analytics), and optimizing spend. Agentic AI can help with this challenge by automating system monitoring and adjusting workloads as needed.</p>
<p>The diagram below illustrates a typical mixed workload frequently found on Snowflake MEDIUM size warehouses.</p>
<p><a href="https://hashnode.com/edit/cm0a6anfv000509l4h9qk86ui"><img src="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management/53d64c65-2e85-45d8-8bf8-60fea0785299.png" alt="Diagram of a mixed workload over a 24-hour period: one long low-frequency job (yellow), an hourly job (red), a several-times-an-hour job (blue), and a many-times-an-hour job (green), overlapping across the day." /></a></p>
<p>While it's not obvious, research into Snowflake Workload Segmentation demonstrates that the above workload would be more efficiently deployed over two or four warehouses, separating workloads by size and frequency. This has the potential to improve system performance and cost efficiency significantly.</p>
<p>Most customers deploy <a href="/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses">workload separation</a> by team, which leads to poor utilization and high spending. AI Teammates constantly monitor jobs, recommending or even moving them to an appropriate warehouse size to achieve the best balance of throughput and cost efficiency.</p>
<p>For example, high-priority analytical workloads could be processed on larger warehouses while smaller, less important workloads could be shifted to more cost-effective, smaller warehouses configured for batch processing and prioritizing throughput and spend over individual query performance.</p>
<h3><strong>Proactive Snowflake Monitoring and Alerts</strong></h3>
<p>The screenshot below illustrates automated Snowflake cost monitoring across all sectors, including Warehouse computing, Storage, and Snowflake Serverless processing. AI agents can build upon basic monitoring to alert administrators proactively or take action.</p>
<img src="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management/a555bb5d-3575-4944-9a4b-ce71d16b61f6.png" alt="Daily total-cost bar chart from Oct 14–20, 2024, broken into compute (blue), storage (yellow), and serverless (purple) segments, with compute consistently the largest share of spend." style="display:block;margin:0 auto" />

<p><strong>Anomaly Detection</strong>: AI teammates can track the system’s performance and detect anomalies such as sudden spikes in query times, sudden increases in storage usage, or unexpected credit consumption.</p>
<p>Once detected, the system could either notify System Admins or attempt to automatically resolve the issue (e.g., by suggesting or implementing query optimizations).</p>
<p>In one case, a major Snowflake customer in the UK accidentally spent over $120,000 due to a simple manual configuration change that took a week to identify and resolve, which could have been automatically identified by an AI Teammate within seconds, potentially avoiding a significant bill.</p>
<h3><strong>End-to-End ELT Optimization</strong></h3>
<p>According to Snowflake, automated data transformation tasks account for around 80% of customer spending. However, tuning increasingly complex pipelines can be remarkably resource-intensive, often requiring an army of highly skilled data engineers.</p>
<p>The diagram below illustrates the challenge with a simple transformation pipeline with potentially conflicting delivery timelines. The challenge comes from optimizing data delivery within the required SLA, but avoiding unnecessary processing.</p>
<p><a href="https://articles.analytics.today/how-snowflake-dynamic-tables-simplify-etl-pipelines"><img src="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management/0f9d99f7-0b69-4329-9780-442b32d8bdf5.png" alt="Diagram showing hourly Sales data and daily Stores data each transformed separately, then merged into one daily-refreshed table delivered to an analyst, illustrating mismatched pipeline refresh frequencies." /></a></p>
<p>In one example, a Snowflake customer in Munich, Germany was able to reduce overall system cost by 50% simply by suspending real-time analytics during out of hours. In short, if nobody is consuming the data, there's no need to produce it.</p>
<p>AI Teammates can help in the following ways:</p>
<ul>
<li><p><strong>Transformations and Load Efficiency</strong>: AI Teammates can analyze transformation pipelines, looking for inefficiencies or bottlenecks. They can recommend breaking down complex SQL statements into smaller tasks or <a href="https://articles.analytics.today/boost-your-snowflake-query-performance-with-these-10-tips">parallelizing operations</a> to improve load and transformation speeds.</p>
</li>
<li><p><strong>Dynamic Table Optimization</strong>: Snowflake's <a href="https://articles.analytics.today/how-snowflake-dynamic-tables-simplify-etl-pipelines">Dynamic Tables</a> massively simplify and streamline transformation pipelines with opportunities to dynamically change processing frequency and warehouse deployment. AI Teammates can automatically monitor both workload size and data consumption and adjust the pipeline configuration to balance and optimize performance and cost.</p>
</li>
<li><p>The diagram below illustrates one potential tuning step in which the ETL pipeline can be automatically adjusted to match changing the frequency at which data must be refreshed. In this case, a critical data feed is refreshed every five minutes. Once deployed, an AI Teammate can <a href="/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables">automatically adjust the refresh frequency</a> for example reducing the frequency during out-of-hours to optimize cost.</p>
</li>
</ul>
<p><a href="https://articles.analytics.today/how-snowflake-dynamic-tables-simplify-etl-pipelines"><img src="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management/8d198b78-a8e4-4580-a4ce-eb46f9cd09c5.png" alt="Diagram showing Sales and Stores data each transformed on a downstream schedule, then merged and delivered to an analyst every 5 minutes, illustrating a real-time refresh requirement." /></a></p>
<h2><strong>Summary &amp; Conclusion:</strong></h2>
<p>AI Teammates in a Snowflake environment can act as intelligent assistants that continuously monitor and optimize various aspects of a Snowflake deployment.</p>
<p>They can provide actionable recommendations and potentially even implement changes themselves—whether it’s tuning queries, managing warehouse resources, or optimizing storage usage. This can lead to improved performance, reduced costs, and more efficient use of Snowflake’s powerful features, all with minimal manual intervention from human operators.</p>
<p>In conclusion, having spent nearly 10 years as a Senior Solution Architect much of that time working for Snowflake UK, I’ve a fair understanding of the huge challenges that Snowflake System Administrators face. I firmly believe that AI Teammates are indeed the secret to efficient Snowflake cost and performance management.</p>
<p>However, unlike the <a href="https://en.wikipedia.org/wiki/AI_takeover">pessimistic view</a> of Artificial Intelligence which warns about the machines taking over, the fact that AI Teammates work collaboratively with DBAs and Admins mean they’ll simply make an almost impossible task way more effective.</p>
<hr />
<p>Deliver more performance and cost savings with Altimate AI's cutting-edge AI teammates. These intelligent teammates come pre-loaded with the insights discussed in this article, enabling you to implement our recommendations across millions of queries and tables effortlessly. Ready to see it in action? Request a recorded demo by just sending a chat message (<a href="https://app.myaltimate.com/contactus">here</a>) and discover how AI teammates can transform your data teams.</p>
<p><a href="https://www.notion.so/altimate/Blog-Post-Demo-Hook-12041b89292680e09a26f8c718dbaad4?pvs=4"><img src="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management/d9ad5daf-6edc-4c94-a697-80f6cb79cbc5.png" alt="Promotional banner reading ‘AI Data Teammates that work for you 24/7’ beside a screenshot of the Auto Tune savings dashboard, with a Book a Demo button." style="display:block;margin:0 auto" /></a></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management/4f08497b-47c6-43da-96bc-8a3047f5b8fe.jpeg" type="image/jpeg" />
  </item>
  <item>
    <title>Write Better Data Docs Faster</title>
    <link>https://altimate.ai/blog/write-better-data-docs-faster</link>
    <guid isPermaLink="true">https://altimate.ai/blog/write-better-data-docs-faster</guid>
    <pubDate>Thu, 19 Sep 2024 07:22:34 GMT</pubDate>
    <dc:creator>Thomas Schmidt</dc:creator>
    <category>dbtpoweruser</category>
    <category>poweruserfordbt</category>
    <category>dbt</category>
    <category>datapilot</category>
    <category>altimateAI</category>
    <category>analytics</category>
    <category>vscode extensions</category>
    <category>dataengineering</category>
    <category>#ai-tools</category>
    <category>AI</category>
    <description>Once upon a time, an analyst in the trouble
Imagine Leila, an analyst, asked to build a monitoring dashboard for finance - given a tight deadline. While searching for a useful dataset, she comes across a table called “sh_monthly_revenue” that seems p...</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/write-better-data-docs-faster/636afb0c-e89a-4e39-9349-d2597f224b4b.webp" alt="Write Better Data Docs Faster" /></p>
<h2 id="heading-once-upon-a-time-an-analyst-in-the-trouble">Once upon a time, an analyst in the trouble</h2>
<p>Imagine Leila, an analyst, asked to build a monitoring dashboard for finance - given a tight deadline. While searching for a useful dataset, she comes across a table called “sh_monthly_revenue” that seems perfect based on its name and the columns it contains. However, there’s little documentation available, and the person who created it has already left the company. With time ticking, she makes a few assumptions based on the column names and dives into the analysis.</p>
<p>Weeks later, after presenting the dashboard findings, one of the business stakeholders points out that the data does not match the numbers in the financial reports at all. It turned out that the dataset she used wasn’t appropriate since it only covered revenue from a subset of customers, leading to incorrect assumptions and, ultimately, flawed conclusions. This scenario didn’t just waste time and resources - it also damaged Leila’s credibility and may have led to misguided business decisions.</p>
<p>If this sounds familiar, you’re not alone. Many data professionals - whether analysts, data scientists, or engineers - have found themselves in a similar situation. Poor documentation doesn’t just slow down work; it can lead to significant errors with far-reaching consequences. On the other hand, writing and maintaining comprehensive documentation can be a tedious and time-consuming task.</p>
<p>In this post, we’ll explore best practices for writing better documentation for your data models and how GenAI can help make the process less tedious and time-consuming. </p>
<h2 id="heading-good-documentation-matters-for-many-reasons">Good documentation matters for many reasons</h2>
<p>It’s easy to overlook documentation when you're in the final stages of building a data model, eager to push your work into production. We've all been there: you’ve just completed a model you’re proud of, and you’re ready to ship it out the door. But then comes the task of writing documentation (and possibly adding a few data tests). This critical step often gets rushed or skipped altogether, yet there are compelling reasons to take the time to do it right:</p>
<ul>
<li><p>Reduces time spent on data discovery</p>
</li>
<li><p>Reduces dependency on tribal knowledge</p>
</li>
<li><p>Reduces Ad-hoc questions you get from data consumers</p>
</li>
<li><p>Your org makes you follow governance and best practices guidelines ^_^</p>
</li>
</ul>
<p>Understanding why documentation matters is just the first step. The real challenge lies in consistently applying best practices to ensure your documentation is both comprehensive and usable. Let’s explore how you can achieve this with a few best practice tips.</p>
<h2 id="heading-best-practices-for-writing-excellent-data-documentation">Best practices for writing excellent data documentation</h2>
<p>Creating effective data documentation isn’t just about listing columns and definitions - it’s about ensuring that anyone who interacts with your data can understand and use it correctly, even if they have no prior context. Here are some best practices to help you design documentation that’s both comprehensive and user-friendly:</p>
<h3 id="heading-always-consider-the-readers-perspective">“Always Consider the Reader’s Perspective”</h3>
<p>When documenting a data model, it’s easy to fall into the trap of writing from your perspective, assuming that others will inherently understand the nuances you do. Instead, try to <strong>put yourself in the shoes of someone without prior knowledge of the dataset</strong>. When it comes to writing the docs for your model, you can follow these guidelines:</p>
<ul>
<li><p><strong>Clearly outline the Purpose and Utility:</strong> Define the key questions this dataset is designed to answer and the specific use cases it supports. This context helps users understand the data’s intent and how best to leverage it.</p>
</li>
<li><p><strong>Identify Caveats:</strong> Highlight any limitations or potential pitfalls associated with the data, such as missing information, known inaccuracies, or situations where the data might be misleading. These warnings are crucial for preventing misuse.</p>
</li>
<li><p><strong>Specify Granularity:</strong> Detail the level of detail provided by the data, whether it’s aggregated daily, weekly, or monthly, or at the transaction level or summarized. Understanding the granularity helps users determine the dataset’s appropriateness for their needs. In the case of columns, include information about primary keys, etc.</p>
</li>
<li><p><strong>Explain Contextual Background:</strong> Provide the reasoning behind the table’s creation, including any business processes or decisions that shaped its structure. This background helps users appreciate the dataset’s origins and relevance within the broader business context.</p>
</li>
<li><p><strong>Highlight Key Dimensions and Metrics:</strong> Point out the most important dimensions (such as date, location, and product) and metrics (like sales, revenue, and click-through rate) within the dataset. Explain how these elements interact and any specific considerations for their use. In the case of categorical columns, you can possibly include details about accepted values. </p>
</li>
<li><p><strong>Optimize for AI and Semantic Search:</strong> As AI tools become more integrated into data management, ensure your documentation includes relevant business terms, acronyms, and synonyms associated with the data. This optimization enhances discovery and usability, particularly for AI-driven tools like semantic search engines or analytics agents.</p>
</li>
</ul>
<p>Here is an example of how this could look like for our model from above:</p>
<p><img src="/blog/write-better-data-docs-faster/AD_4nXcKvq4t1tRZgpto-0wh9XNYWqhJcxTmhGTTaTLDZ5JrsgskbuGHbVRkn2hUKYayCUdmWnQjn_S6kBcXrP_4H3PuSBF87MhxLZLdolKlL9IAN-3Q4BUNFaRg62q3RncNZxCP5chG_6A3S5IgfWbmUc64Xlkh.jpg" alt="Screenshot of a dbt schema.yml file showing an AI-generated model description for daily_product_sales, including example use cases, caveats, key dimensions and metrics, additional context, and keyword tags." alt /></p>
<h2 id="heading-make-documentation-less-painful-by-using-ai">Make documentation less painful by using AI</h2>
<p>Despite your best efforts, documentation can still be time-consuming and tedious, especially when balancing tight deadlines and complex data models. This is where generative AI (GenAI) comes into play, turning what once felt like a chore into a largely automated and streamlined process. </p>
<p>Tools like the <a target="_blank" href="https://docs.myaltimate.com/document/generatedoc/">Power User for dbt (DataPilot)</a> are designed to handle the heavy lifting of documentation, automatically generating detailed table and column descriptions from your existing data models. These tools use the metadata context available in your environment automatically like schema information, column lineage etc. and write so good documentation that has surprised me many times. Some of the key features include:</p>
<ul>
<li><p><strong>Effortlessly Document Hundreds of Columns:</strong><br />  Have 900 columns to document? No problem. With <strong>bulk generation</strong>, you can quickly create reliable descriptions for every column, allowing you to focus your efforts on refining and curating the details that matter most.</p>
</li>
<li><p><strong>Tailored Documentation for Different Audiences:</strong><br />  The extension allows you to <strong>generate documentation for different user personas</strong>. Use technical language for your intermediate layer tables and a more business-friendly tone for end-user-facing tables. This ensures that each audience gets the information they need in the most effective format.</p>
</li>
<li><p><strong>Seamless Integration with Your Workflow:</strong><br />  The tool <strong>integrates directly with your dbt YAML schemas</strong>, injecting newly generated documentation into existing schemas or updating current documentation with just a few clicks. All this happens directly within the model SQL file, so you can avoid those days when your IDE tabs blow up like confetti due to the number of open file tabs.</p>
</li>
</ul>
<p>More details can be found <a target="_blank" href="https://docs.myaltimate.com/document/generatedoc/">here</a></p>
<p>Overall, documentation is an important aspect of analytics engineering and it’s essential that we follow best practices, otherwise, we run the risk of writing documentation for namesake or not writing it at all! GenAI based automation is going to be the major boon in this area, it has its kinks but early signs are very promising making me quite excited for the future!</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/write-better-data-docs-faster/636afb0c-e89a-4e39-9349-d2597f224b4b.webp" type="image/webp" />
  </item>
  <item>
    <title>Can AI Agents reduce Snowflake Cost using Dynamic Tables?</title>
    <link>https://altimate.ai/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables</link>
    <guid isPermaLink="true">https://altimate.ai/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables</guid>
    <pubDate>Sat, 07 Sep 2024 07:25:12 GMT</pubDate>
    <dc:creator>John Ryan</dc:creator>
    <category>Snowflake Costs</category>
    <category>snowflake</category>
    <category>ai agents</category>
    <category>Artificial Intelligence</category>
    <description>In my previous article on Dynamic Tables, I explained their purpose, to help simplify building transformation pipelines for either batch or real time data feeds in Snowflake. In this article, I&apos;ll explain what they cost to run and how Artificial Inte...</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables/459f1d62-c8a1-4a4e-b796-10d83512baa3.jpeg" alt="Can AI Agents reduce Snowflake Cost using Dynamic Tables?" /></p>
<p>In my previous article on Dynamic Tables, I explained their purpose, to help simplify building transformation pipelines for either batch or real time data feeds in Snowflake. In this article, I'll explain what they cost to run and how <a target="_blank" href="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management">Artificial Intelligent Agents</a> can be used to automatically monitor, alert and even deploy remedial action to control cost.</p>
<p>Skeptical? Read on to see how to reduce the annual cost of running three Dynamic Tables from $6.3m to just $26,280.</p>
<h2 id="heading-dynamic-tables-cost-components">Dynamic Tables Cost Components</h2>
<p>It may not be obvious but Dynamic Tables include multiple cost elements including:</p>
<ul>
<li><p><strong>Cloud Compute:</strong> Dynamic Tables are automatically refreshed on a repeating sequence depending upon the TARGET_LAG. For example, once per minute or once per hour.</p>
</li>
<li><p><strong>Data Storage:</strong> Like any table, Dynamic Tables store data, and this will be billed at £23 per terabyte per month.</p>
</li>
<li><p><strong>Warehouse Cost:</strong> Every time the Dynamic Table is refreshed it (currently) needs a <a target="_blank" href="https://articles.analytics.today/snowflake-virtual-warehouses-what-you-need-to-know">Virtual Warehouse</a> to execute the SQL, and this is billed on a per-second basis with a minimum of 60 seconds.</p>
</li>
</ul>
<p>Let's consider each of these elements and it's potential impact upon the overall cost of ownership.</p>
<h2 id="heading-cloud-compute-cost">Cloud Compute Cost</h2>
<p>This is by far the least expensive of the three cost elements and results from the automatic scheduling executed in the <a target="_blank" href="https://docs.snowflake.com/en/user-guide/intro-key-concepts#cloud-services">Cloud Services</a> layer. Determined by the TARGET_LAG, the DT "wakes up" and checks if there any changes in the upstream table(s). This is likely to be thousands of a dollar each time, and for 99% of customers is free, unless it becomes more than 10% of your daily warehouse cost.</p>
<p>In short, don't worry about this.</p>
<h2 id="heading-dynamic-table-storage-cost">Dynamic Table Storage Cost</h2>
<p>While you need to store data in Snowflake (and therefore you'll be billed a passthru cost of £23 per terabyte), it's not clear that Dynamic Tables add to the <a target="_blank" href="https://articles.analytics.today/how-to-cut-snowflake-data-storage-costs-with-zero-copy-clones">storage cost</a>. Consider the diagram below.</p>
<p><img src="/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables/d46b86b5-66e5-4fa5-9ddd-997a95f959f5.png" alt="Diagram showing two source tables T1 and T2 feeding two dynamic tables T3 and T4, which both feed a third dynamic table T5 delivered to an end user." alt class="image--center mx-auto" /></p>
<p>In the above diagram tables T1 and T2 are default tables, wheres T3, T4 and T5 are dynamic tables. If we assume T1 and T2 hold 1TB of data storage, and the transformation to T3 and T4 is simply to perform a basic data quality correction (for example, setting in incorrect SALES_TYPE column to NULL when the values are incorrect), then tables T3 and T4 will equally hold around 1TB of storage.</p>
<p>If the results of T3 and T4 are then combined using a JOIN operation into a single table T5 - ready for querying, this adds another 2TB to storage.</p>
<p>In total we store 6TBs of storage.</p>
<p>However, if we were not using Dynamic Tables, then tables T1 and T2 could be deleted down each time the new entries where processed. Likewise, once the process to join the tables and produce T5 was complete, tables T3 and T4 could be deleted.</p>
<p>This means, a solution without Dynamic Tables could deploy the same functionality in 2TBs compared to 6 TBs.</p>
<p>Data storage is a relatively minor cost on most Snowflake systems, but it's a cost worth understanding.</p>
<h2 id="heading-dynamic-tables-warehouse-cost">Dynamic Tables Warehouse Cost</h2>
<p>This is almost certainly the greatest cost associated with Dynamic Tables, although unlike the data storage example above, there's no additional cost when compared to a transformation pipeline without DTs.</p>
<p>Effectively, each time a Dynamic Table triggers a refresh (provided there's changed data in the upstream tables), Snowflake executes the associated SQL on a Virtual Warehouse. However, even this has a potential gotcha. Consider again the diagram below.</p>
<p><img src="/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables/03f5b2a6-bc24-4933-ac5f-a325a7f7c9b0.png" alt="Diagram of a Sales and Stores pipeline where each source feeds a downstream dynamic table, merging into a final dynamic table that refreshes every 1 minute for the end user." alt class="image--center mx-auto" /></p>
<p>The diagram above illustrates the same transformation pipeline, with two source tables and three dynamic tables. Notice that two of the tables are marked as Downstream? This means their refresh rate is determined by the downstream table - in this case a table refreshed every minute.</p>
<p>Let's assume new data is automatically inserted into the Sales table using <a target="_blank" href="https://docs.snowflake.com/en/user-guide/data-load-snowpipe-intro">Snowpipe</a> which runs on a 24x7 basis. The Stores data is however, refreshed once per day.</p>
<p>Can you see what might happen to the cost profile of this simple transformation pipeline?</p>
<p>As new sales are automatically loaded into the Sales table (T1), Dynamic Tables T3 and T5 are automatically refreshed based upon the one minute TARGET_LAG.</p>
<p>Let's assume all Dynamic Tables were initially deployed on an XSMALL warehouse, this incredibly simple transformation pipeline would cost up to $1,576,800 per year. Worse still, if the warehouse was subsequently <a target="_blank" href="https://articles.analytics.today/snowflake-virtual-warehouses-is-bigger-faster-but-more-expensive">increased</a> in size to a MEDIUM, this would increase to a shocking $6.3m a year for a single warehouse.</p>
<p>Around four years ago, I did a consultancy visit to a customer in Munich Germany who had deployed a similar pipeline, also running 24x7 and were shocked by the high cost. The customer justified the 24x7 operation because the system tracked global internet based sales, and could therefore receive sales 24x7.</p>
<p>After some time on the whiteboard to map out the equally simple pipeline, I understood the problem and asked the customer - "<strong><em>So, where are your Data Analysts based</em></strong>".</p>
<p>I'm sure they thought it was a stupid question, as their reply was like talking to a five year-old. "<strong><em>Here in Munich, John</em></strong>".</p>
<p>In response, I asked whether the Data Analysts were looking at the data at 4am, and if not, why were we processing data at 4am and paying for a virtual warehouse to wake up every minute leading to a huge bill?</p>
<p>Finally, I also questioned, why they were continuously processing data every minute. What action would the analysts take that needed the data to be as little as one minute stale?</p>
<p>In conclusion, the same transformation pipeline cost, even on a MEDIUM size warehouse could be cut by 50%, simply by suspending the Dynamic Table refresh from 8pm to 8am using a <a target="_blank" href="https://docs.snowflake.com/en/sql-reference/sql/create-task">Snowflake Task</a>.</p>
<p>We could further reduce the cost by a factor of four by executing the following SQL statements.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">alter</span> dynamic <span class="hljs-keyword">table</span> T3 
   <span class="hljs-keyword">set</span> warehouse = DT_XSMALL_WAREHOUSE;
<span class="hljs-keyword">alter</span> dynamic <span class="hljs-keyword">table</span> T4
   <span class="hljs-keyword">set</span> warehouse = DT_XSMALL_WAREHOUSE;
</code></pre>
<p>The two simple SQL statements move the refresh operation to an XSMALL warehouse costing 25% of the cost. Of course, we'd need to check the refresh performance was acceptable, but assuming an INCREMENTAL refresh method, this should be pretty fast to complete.</p>
<p>Finally, we should question whether the Data Analytics <strong>really need</strong> the data refreshed every minute. Executing the following SQL would reduce costs by a factor of 60.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">alter</span> dynamic <span class="hljs-keyword">table</span> T5
   <span class="hljs-keyword">set</span> target_lag = <span class="hljs-string">'1 Hour'</span>;
</code></pre>
<blockquote>
<p>"Never give a user what they <strong>ask for</strong>, give them what they <strong>need</strong>" - Dr. David Pearson.</p>
</blockquote>
<h2 id="heading-can-artificial-intelligence-help">Can Artificial Intelligence Help?</h2>
<p>As I've described before, a new breed of <a target="_blank" href="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management">Artificial Intelligent Agents</a> can be used to tirelessly monitor, alert or even adjust system configuration. It's like having an Artificially Intelligent Database Administrator proactively tuning your system.</p>
<p>However, the challenge of tuning a multi-petabyte analytic platform which charges using a pay-for-use basis is more challenging that you'd expect.</p>
<p><img src="/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables/afef2d09-b0a6-43a7-9a80-b332486ec93d.png" alt="Triangle diagram showing the three competing priorities in managing a Snowflake platform — control cost, maximize throughput, and maximize query performance — each pulling against the other two." alt class="image--center mx-auto" /></p>
<p>The diagram above illustrates the primary challenge, balancing the need to maximize throughput of large (mainly batch) transformation jobs, and maximizing performance of end-user queries while also optimizing spend.</p>
<p>There are also some critical facts about Snowflake which need to be understood:</p>
<ol>
<li><p>Around 80% of the cost of running a Data Warehouse comes from repeating automated jobs. The majority of these tend to be batch oriented and many prioritize throughput over performance - the need to regularly deliver data, perhaps once per hour or once per day.</p>
</li>
<li><p>Years of research with over 50 Snowflake customers and thousands of queries against real customer data have demonstrated that most customers have a poor <a target="_blank" href="/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses">virtual warehouse deployment</a> strategy which potentially leads to significant cost overspend.</p>
</li>
<li><p><a target="_blank" href="https://articles.analytics.today/how-snowflake-dynamic-tables-simplify-etl-pipelines">Snowflake Dynamic Tables</a> have the fastest growth in uptake of any Snowflake feature and are likely to become the gold standard for data transformation on Snowflake. However, unlike hand-coded ELT jobs, the warehouse size and execution frequency can be easily adjusted as these are entirely configurable in the Dynamic Table definition.</p>
</li>
</ol>
<p>Taking both the problem (balancing throughput, performance and cost), with the configurable nature of Dynamic Tables means it's possible to automatically monitor and even change system configuration in real-time using <a target="_blank" href="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management">Agenic AI</a>.</p>
<p><img src="/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables/da531430-f6fc-4a5e-bbae-f2c156e49d2f.png" alt="Step chart showing the number of automated AI agent configuration decisions made on a Snowflake Dynamic Table pipeline per day over about a month." alt class="image--center mx-auto" /></p>
<p>The screenshot above shows the frequency of AI Agent decisions used to monitor and adjust Snowflake to maximize performance and optimize costs.</p>
<p>For example, if an ELT pipeline normally needs a MEDIUM sized warehouse but regular end-of-month processing would justify an X4LARGE, an <a target="_blank" href="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management">AI Agent</a> could automatically identify the opportunity and even change the configuration subject to System Administrator approval. This would not only deliver results over 100 times faster, but it would avoid a common mistake made by almost every Snowflake customer, using an i<a target="_blank" href="/blog/adaptive-compute-vs-auto-tune-a-practical-guide-to-optimizing-snowflake-warehouses">nappropriate virtual warehouse size</a>, and effectively the largest possible machine for the highest expected workload.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>While the cost of Cloud Services compute and even storage for Dynamic Tables is likely to negligible, we need to consider the cost of running a virtual warehouse.</p>
<p>With just three SQL statements, we reduced the maximum cost of this simple transformation pipeline from $6.3m per year down to $26,280.</p>
<p>To summarize what we learned:</p>
<ul>
<li><p><strong>Cloud Compute and Storage</strong> costs can (in most cases) be ignored. They shouldn't add significant cost to a pipeline deployed using a Dynamic Table.</p>
</li>
<li><p><strong>Warehouse Costs</strong> however, can be remarkably high and lead to an eye-watering annual bill if deployed without thought.</p>
</li>
<li><p><strong>Snowflake is not expensive!</strong> Like any tool, if used incorrectly it can lead to a poor outcome. Applying some common sense goes a long way.</p>
</li>
<li><p><strong>TARGET_LAG:</strong> Is critical in determining the frequency with which a Dynamic Table query is executed. If the data changes frequently, it can lead to significant cost. Carefully choose a TARGET_LAG based on how fresh you <strong>need</strong> the data. Don't just set it to once per minute because you can.</p>
</li>
<li><p><strong>Dynamically Change the lag:</strong> You can set up a simple schedule to suspend Dynamic Table refreshes or adjust the TARGET_LAG during off-peak or holiday periods. Suspending the refresh overnight will immediately reduce the costs by up to 50%.</p>
</li>
</ul>
<p>Finally, in addition to manually adjusting Dynamic Table configuration, we could deploy <a target="_blank" href="/blog/could-ai-teammates-be-the-secret-to-efficient-snowflake-cost-management">AI Agents</a> to autonomously monitor, alert or even tune Dynamic Tables to automatically achieve the almost impossibly complex goal of balancing the requirements of throughput, performance and cost.</p>
<hr />
<p>Deliver more performance and cost savings with Altimate AI's cutting-edge AI teammates. These intelligent teammates come pre-loaded with the insights discussed in this article, enabling you to implement our recommendations across millions of queries and tables effortlessly. Ready to see it in action? Request a recorded demo by just sending a chat message (<a target="_blank" href="https://app.myaltimate.com/contactus">here</a>) and discover how AI teammates can transform your data teams.</p>
<p><a target="_blank" href="https://app.myaltimate.com/contactus"><img src="/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables/d9ad5daf-6edc-4c94-a697-80f6cb79cbc5.png" alt="Promotional banner reading &quot;AI Data Teammates that work for you 24/7&quot; with a Book a Demo button, next to a screenshot of the Auto Tune dashboard showing realized and estimated savings on a Snowflake warehouse." alt /></a></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/can-ai-agents-reduce-the-cost-of-snowflake-dynamic-tables/459f1d62-c8a1-4a4e-b796-10d83512baa3.jpeg" type="image/jpeg" />
  </item>
  <item>
    <title>How I Cut dbt Development Time by 20% with the Power User Vscode Extension</title>
    <link>https://altimate.ai/blog/how-i-cut-dbt-development-time-by-20-with-the-power-user-vscode-extension</link>
    <guid isPermaLink="true">https://altimate.ai/blog/how-i-cut-dbt-development-time-by-20-with-the-power-user-vscode-extension</guid>
    <pubDate>Sun, 14 Apr 2024 23:47:22 GMT</pubDate>
    <dc:creator>Anand Kumar</dc:creator>
    <category>dbt</category>
    <category>datapilot</category>
    <category> analytics tools</category>
    <category>devtools</category>
    <category>vscode extensions</category>
    <description>Working with data in any capacity—be it as a data/analytics engineer, data scientist, or data analyst—inevitably dealing with the need for documentation. Whether it&apos;s clarifying unclear fields, understanding dataset structures, or seeking explanation...</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/how-i-cut-dbt-development-time-by-20-with-the-power-user-vscode-extension/56f8f767-b124-4eaa-ab9e-8d96c5d5b03e.webp" alt="How I Cut dbt Development Time by 20% with the Power User Vscode Extension" /></p>
<p>Working with data in any capacity—be it as a data/analytics engineer, data scientist, or data analyst—inevitably dealing with the need for documentation. Whether it's clarifying unclear fields, understanding dataset structures, or seeking explanations for data discrepancies, clear and comprehensive documentation is important. In the constantly evolving data world, where accuracy and clarity are non-negotiable, tools like dbt (data build tool) emerge as lifesavers.</p>
<p>Recognizing the importance of clear documentation in the data world, dbt™ makes documentation significantly easier through its dbt™ docs feature.</p>
<p>dbt provides a way to generate documentation for your dbt™ project. The documentation for your project includes:</p>
<ul>
<li><p>Project Information: including model code, a DAG of your project, any tests you've added to a column, and more.</p>
</li>
<li><p>Data warehouse Information: including column data types, and table sizes. This information is generated by running queries against the information schema.</p>
</li>
</ul>
<p>A standout feature of dbt™ lies in its capability to enhance documentation comprehensively. Users can add detailed descriptions to models, columns, sources, and other project elements, enriching the documentation with context and clarity. This not only aids in understanding the data structures but also streamlines collaboration and knowledge sharing within teams.</p>
<p>Here's an example of how dbt™ models can be documented:</p>
<pre><code class="lang-yaml">
<span class="hljs-attr">version:</span> <span class="hljs-number">2</span>

<span class="hljs-attr">models:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">events</span>
    <span class="hljs-attr">description:</span> <span class="hljs-string">This</span> <span class="hljs-string">table</span> <span class="hljs-string">contains</span> <span class="hljs-string">clickstream</span> <span class="hljs-string">events</span> <span class="hljs-string">from</span> <span class="hljs-string">the</span> <span class="hljs-string">marketing</span> <span class="hljs-string">website</span>

    <span class="hljs-attr">columns:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">event_id</span>
        <span class="hljs-attr">description:</span> <span class="hljs-string">This</span> <span class="hljs-string">is</span> <span class="hljs-string">a</span> <span class="hljs-string">unique</span> <span class="hljs-string">identifier</span> <span class="hljs-string">for</span> <span class="hljs-string">the</span> <span class="hljs-string">event</span>
        <span class="hljs-attr">tests:</span>
          <span class="hljs-bullet">-</span> <span class="hljs-string">unique</span>
          <span class="hljs-bullet">-</span> <span class="hljs-string">not_null</span>

      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">user-id</span>
        <span class="hljs-attr">quote:</span> <span class="hljs-literal">true</span>
        <span class="hljs-attr">description:</span> <span class="hljs-string">The</span> <span class="hljs-string">user</span> <span class="hljs-string">who</span> <span class="hljs-string">performed</span> <span class="hljs-string">the</span> <span class="hljs-string">event</span>
        <span class="hljs-attr">tests:</span>
          <span class="hljs-bullet">-</span> <span class="hljs-string">not_null</span>
</code></pre>
<p><strong>Overcoming Documentation Challenges</strong></p>
<p>Despite the robust dbt™ docs feature, documentation often takes a backseat due to the inherent gap between project work and the documentation process. After completing a model, users frequently find themselves navigating to various directories to locate and manually edit schema YAML files for documentation purposes. This manual approach is time-consuming and prone to errors, relying heavily on individual skills and consistency.</p>
<p><strong>Introducing Power User for dbt Extension: A Game-Changer in Documentation</strong></p>
<p>To address these challenges and streamline the documentation workflow, Altimate AI introduces the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=innoverio.vscode-dbt-power-user">Power User for dbt</a> vscode extension. This extension leverages AI capabilities to revolutionize documentation generation, making it a seamless and efficient process. Specifically, Altimate AI is designed to emulate the behavior of human engineers by leveraging contextual insights drawn from schema, sources, column-level lineage, metadata, and existing documents to create tailored documentation, rather than just generating generic documentation.</p>
<p>Within the documentation editor, users can access a range of functionalities:</p>
<ol>
<li><p><strong>Model Documentation</strong>: Users can edit individual model documentation directly within the editor, eliminating the need for manual YAML editing. Additionally, AI-driven generation allows for instant and accurate descriptions, tailored to specific use cases such as professional or more casual documentation styles</p>
<p> <img src="/blog/how-i-cut-dbt-development-time-by-20-with-the-power-user-vscode-extension/e72f8a02-7db3-4bcf-883c-ab502b590b07.png" alt="Screenshot of the dbt Power User documentation editor for the orders model, with the Documentation Editor tab circled, showing an AI-generated model description and a Sync with the Database button above the column list." alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Column Documentation</strong>: The extension enables users to generate detailed documentation for individual columns, automatically saving them in the 'schema.yml' file with the appropriate syntax. This automation not only accelerates development but also ensures consistency and accuracy across documentation.</p>
<p> <img src="/blog/how-i-cut-dbt-development-time-by-20-with-the-power-user-vscode-extension/aeb5acc4-4e29-4fd1-8e72-2527b84f12c9.jpeg" alt="Side-by-side view of the dbt Power User documentation editor generating column descriptions for a sales model next to the resulting schema.yml, with AI-written descriptions and data types for each column." alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Multiple Languages Documentation</strong>: Users have the flexibility to create documentation in several languages, including French, English, Dutch, and German. This feature enables the generation of content that caters to diverse linguistic needs.</p>
</li>
<li><p><strong>Persona-Specific Documentation:</strong> The extension offers a variety of presets designed for different audiences. Users can select the persona that best matches their needs, whether it be a technical user, business user, or general user. For general users, the documentation is crafted without a specific persona focus, ensuring it is accessible and understandable to a broad audience.</p>
</li>
</ol>
<p><strong>Impact of Effective Documentation in dbt™</strong></p>
<p>Quality documentation significantly improves how models are used and reduces unnecessary communications between teams, boosting productivity. Using the dbt Power User extension, you can save at least two minutes per column in documentation tasks. Depending on the size and complexity of the models, this efficiency can lead to a reduction of 10%-20% in development expenses. This not only translates to substantial cost savings but also frees up engineers to focus on more critical tasks.</p>
<p><strong>Harnessing the Power of AI for Documentation Excellence</strong></p>
<p>Maintaining documentation in a dynamic data environment presents a substantial challenge. As business requirements expand and projects evolve, the task of updating documentation to reflect changes in models, schemas, or sources becomes increasingly complex and resource-intensive. This constant need for updates can significantly drain time and productivity. Hence, the integration of AI-driven documentation generation within dbt Power User extension represents a significant advancement in data documentation practices. By automating tedious tasks and offering customizable options, dbt™ enables engineers to concentrate on development work while ensuring that the documentation stays comprehensive and up-to-date.</p>
<p><strong>Final Thoughts</strong></p>
<p>In the rapidly changing world of data management, understanding the essence of quality documentation has never been more critical, dbt Power User extension documentation capabilities shine as a beacon of efficiency and excellence. By leveraging advanced technologies like AI, dbt Power User extension not only simplifies the documentation process but also promotes data transparency, collaboration, and innovation. Embracing these powerful tools paves the way for enhanced productivity, informed decision-making, and data-driven success.</p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/how-i-cut-dbt-development-time-by-20-with-the-power-user-vscode-extension/56f8f767-b124-4eaa-ab9e-8d96c5d5b03e.webp" type="image/webp" />
  </item>
  <item>
    <title>Optimizing Snowflake Queries : Expert Strategies for Data Engineers and Analysts</title>
    <link>https://altimate.ai/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts</link>
    <guid isPermaLink="true">https://altimate.ai/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts</guid>
    <pubDate>Sun, 28 Jan 2024 21:01:29 GMT</pubDate>
    <dc:creator>John Ryan</dc:creator>
    <category>Snowflake performance</category>
    <category>Performance Tuning</category>
    <category>snowflake</category>
    <category>data-engineering</category>
    <category>data analyst</category>
    <category>generative ai</category>
    <category>AI</category>
    <description>For data teams, the clock is always ticking. In a business landscape defined by rapidly expanding datasets, slow queries can grind insights to a halt. That&apos;s why performance tuning is especially critical when working with a platform like Snowflake. T...</description>
    <content:encoded><![CDATA[<p><img src="https://altimate.ai/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/3bc6e31d-4dc7-49e5-9e4e-cc8cadce929c.webp" alt="Optimizing Snowflake Queries : Expert Strategies for Data Engineers and Analysts" /></p>
<p>For data teams, the clock is always ticking. In a business landscape defined by rapidly expanding datasets, slow queries can grind insights to a halt. That's why performance tuning is especially critical when working with a platform like Snowflake. This platform, renowned for its lack of traditional indexes, presents unique challenges and opportunities for optimizing query performance. To navigate these uncharted waters, data engineers and analysts need a mastery of specialized optimization tactics. Join me as we dive into the art of writing fast code that unlocks the full capabilities Snowflake offers. We’ll review examples ranging from basic query tuning to more advanced optimizations that can mean the difference between swift analytics and stalled projects.</p>
<h2 id="heading-snowflake-performance-tuning-strategy">Snowflake Performance Tuning Strategy</h2>
<p>Before we start, let’s put the overall performance-tuning strategy in context.  The diagram below illustrates the typical data processing pipeline you’ll see on any Snowflake platform, which consists of the following:</p>
<ul>
<li><p><strong>Data Loading:</strong> This involves copying data from Cloud Storage into a Table Landing zone.  This normally uses the Snowflake COPY or SNOWPIPE commands.</p>
</li>
<li><p><strong>Data Transformation:</strong>  Data from multiple sources and loading into Data Integration and Data Delivery zones.  This involves the execution of Insert, Update, or Merge statements to clean, manipulate, and transform the data ready for consumption.</p>
</li>
<li><p><strong>Data Querying &amp; Consumption:</strong>  The data by end user dashboards, reports, or analysis.  This typically involves SELECT statements against the Data Delivery zone.</p>
</li>
</ul>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/2895c1aa-1647-4c35-81f0-1b92ac6b61c5.png" alt="Diagram of a Snowflake data pipeline: a source system loads files through cloud storage staging into a Table Landing zone, through two ETL steps into Data Integration and Data Delivery zones, before reaching the end user." alt class="image--center mx-auto" /></p>
<p>It’s worth considering the above because the approach and solutions tend to differ. Let’s consider each in turn.</p>
<h2 id="heading-data-delivery">Data Delivery</h2>
<p>As indicated above, data delivery is all about quickly using SELECT statements to deliver results to end-users.  This means it's vital SQL is tuned for maximum performance.  When tuning query performance, the first place to look is the query profile.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/5cf4a64f-0099-4ded-a83d-89217106c831.png" alt="Query profile overview panel showing total execution time split by processing, local disk I/O, remote disk I/O, synchronization, and initialization, with remote disk I/O highlighted at 88.6% of the 5.1-second runtime." alt class="image--center mx-auto" /></p>
<p>The screenshot above illustrates the first place to check for performance issues.  Many assume this indicates the time spent, but it's the time waiting for resources.</p>
<p>The above case shows the query spent just 10% of its time waiting on CPU resources, almost zero (0.2%) of the time waiting for Local Disk I/O to complete, but nearly 90% of the time waiting on Remote Disk I/O.</p>
<p>Reviewing the overall Snowflake hardware architecture illustrated in the diagram below is helpful to understand what this means.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/fa996e5a-9937-420d-81bd-76a2339aae39.png" alt="Diagram of Snowflake's architecture layers — cloud services (access control), compute services (virtual warehouse), and cloud storage — showing how different teams' queries flow through access control to a shared virtual warehouse and storage." alt class="image--center mx-auto" /></p>
<p>The above diagram shows how queries submitted to Snowflake are handled by the Cloud Services Layer, determining the best way to execute the query.  The SQL is then passed to a Virtual Warehouse, a physical computer with CPU cores, memory, and SSD (Local) storage.</p>
<p>When queries are executed, the data is read from Remote Storage, cached in SSD, and results computed and returned to the user.</p>
<p>The key insight here is that (SSD) Local Storage is hundreds of times faster than Remote (disk) storage.  One of the most effective ways to maximize query performance is limiting Remote Disk accesses.</p>
<p>The most effective way to reduce remote disk I/O is using the query WHERE clause to filter out rows. Complex SQL queries often include a series of Common Table Expressions (CTEs or inline views), and the best practice is to filter out rows as early as possible.  The fewer rows fetched from the Remote Disk, the faster the query executes.</p>
<p>The next step in tuning Snowflake query performance is to review the query statistics illustrated in the screenshot below.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/25c3900b-0838-4817-905d-247da9bdf125.png" alt="Query statistics panel highlighting partitions scanned (710) out of a total of 3,911 partitions, alongside scan progress, bytes scanned, and percentage scanned from cache." alt class="image--center mx-auto" /></p>
<p>Snowflake stores data in 16MB blocks called micro partitions and automatically prunes these to maximize query performance, but it's entirely dependent upon the WHERE clause.  If (for example), a query includes no WHERE clause, Snowflake will need to fetch the entire table from Local or Remote storage with a significant impact upon performance.</p>
<h2 id="heading-tuning-the-query-where-clause">Tuning the query WHERE clause</h2>
<p>You can make simple changes to the WHERE clause to maximize query performance.  Take, for example, the following SQL statement:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">select</span> *
<span class="hljs-keyword">from</span> SNOWFLAKE_SAMPLE_DATA.TPCH_SF1000.ORDERS
<span class="hljs-keyword">where</span> to_char(o_orderdate,<span class="hljs-string">'DD-MON-YYYY'</span>) = <span class="hljs-string">'01-APR-1992'</span>;
</code></pre>
<p>The above query returns ORDERS placed on 1st April 1992.  However, we limited Snowflake's ability to prune query performance automatically because we formatted the O_ORDERDATE as a character in the WHERE clause.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">select</span> *
<span class="hljs-keyword">from</span> SNOWFLAKE_SAMPLE_DATA.TPCH_SF1000.ORDERS
<span class="hljs-keyword">where</span> o_orderdate = <span class="hljs-keyword">to_date</span>(<span class="hljs-string">'01-APR-1992'</span>,<span class="hljs-string">'DD-MON-YYYY'</span>);
</code></pre>
<p>The above query produces the same result ten times faster, completing in under four seconds instead of nearly 40 seconds.  The reason is we left the O_ORDERDATE column unmodified.</p>
<p>Surprisingly, despite converting a DATE to a CHARACTER field, Snowflake can still perform some partition pruning.  However, modifying WHERE clause columns using a user-defined function will almost certainly lead to a full table scan.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">select</span> *
<span class="hljs-keyword">from</span> orders
<span class="hljs-keyword">where</span> format_date_udf(o_orderdate,<span class="hljs-string">'DD-MON-YYYY'</span>) = <span class="hljs-string">'01-APR-1992'</span>;
</code></pre>
<p>The above query will perform even worse as Snowflake cannot evaluate the output of a User-Defined Function and will always lead to a full table scan.</p>
<h2 id="heading-tuning-sort-operations">Tuning Sort Operations</h2>
<p>Designing an analytics solution without including an ORDER BY or GROUP BY clause in the query is almost impossible.  However, sorts are the most computationally expensive operations and are often the most significant cause of query performance issues.</p>
<p>Often, data analysts need to determine whether a given column is unique and will execute the following SQL:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">select</span> <span class="hljs-keyword">count</span>(<span class="hljs-keyword">distinct</span> l_orderkey)
<span class="hljs-keyword">from</span> snowflake_sample_data.tpch_sf1000.lineitem;
</code></pre>
<p>However, the following query will execute around 600% faster with an accuracy of around 99%:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">select</span> count_approx_distinct(l_orderkey)
<span class="hljs-keyword">from</span> snowflake_sample_data.tpch_sf1000.lineitem;
</code></pre>
<p>The COUNT_APPROX_DISTINCT is one of a series of approximation functions that accurately estimate large data volumes orders of magnitude faster.</p>
<h2 id="heading-dealing-with-high-cardinality-data">Dealing with high-cardinality data</h2>
<p>While dealing with large data volumes is often necessary, you should be especially careful when sorting high cardinality data, for example, by a unique key.  Take, for example, the following SQL statements, which appear similar but have wildly different query performance.</p>
<h3 id="heading-query-1-unique-key">Query 1 - Unique Key</h3>
<pre><code class="lang-sql"><span class="hljs-keyword">select</span> o_orderkey,
       <span class="hljs-keyword">sum</span>(o_totalprice)
<span class="hljs-keyword">from</span> orders
<span class="hljs-keyword">group</span> <span class="hljs-keyword">by</span> <span class="hljs-number">1</span>;
</code></pre>
<h3 id="heading-query-2-low-cardinality">Query 2 - Low Cardinality</h3>
<pre><code class="lang-sql"><span class="hljs-keyword">select</span> o_orderpriority,
       <span class="hljs-keyword">sum</span>(o_totalprice)
<span class="hljs-keyword">from</span> orders
<span class="hljs-keyword">group</span> <span class="hljs-keyword">by</span> <span class="hljs-number">1</span>;
</code></pre>
<p>You may be surprised to find that query 2 (Low Cardinality) runs around 22 times faster than query 1 (Unique Key), as illustrated in the screenshot below:</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/d305518c-b8d6-434c-bc66-1048845ebc17.png" alt="Side-by-side query profile comparison of a GROUP BY on a unique high-cardinality key versus a low-cardinality key: the high-cardinality query takes 6 minutes 4 seconds and spills 27.52GB to local storage, while the low-cardinality query finishes in 11 seconds with no spilling." alt class="image--center mx-auto" /></p>
<p>The reason for the huge query performance difference is that Query 1 - Unique Key (which takes over six minutes to complete), includes a GROUP BY on a column with 1.5 billion unique values whereas Query 2 - Low Cardinality (executing in 11 seconds) has just five distinct values.</p>
<p>In this case, the best practice is to be aware of the high cost of sort operations and avoid GROUP BY or ORDER BY operations on highly unique keys.</p>
<h2 id="heading-using-the-snowflake-limit-or-top-option">Using the Snowflake LIMIT or TOP option</h2>
<p>There are sometimes use cases where we need to ORDER very large data volumes by unique keys, but it’s still possible to improve query performance using the simple LIMIT or TOP options on SELECT statements.</p>
<p>Consider the following SQL statements:</p>
<h3 id="heading-query-1-order-by-every-row">Query 1 - Order by Every Row</h3>
<pre><code class="lang-sql"><span class="hljs-keyword">select</span> *
<span class="hljs-keyword">from</span> lineitem
<span class="hljs-keyword">order</span> <span class="hljs-keyword">by</span> l_quantity;
</code></pre>
<h3 id="heading-query-2-order-by-with-limit">Query 2 - Order by With Limit</h3>
<pre><code class="lang-sql"><span class="hljs-keyword">select</span> *
<span class="hljs-keyword">from</span> lineitem
<span class="hljs-keyword">order</span> <span class="hljs-keyword">by</span> l_quantity
<span class="hljs-keyword">limit</span> <span class="hljs-number">10</span>;
</code></pre>
<p>Using the LIMIT 10 option on Query 2 (only first ten rows), leads to an 11 times improvement in query performance from over 17 minutes to just 1m 35s.</p>
<p>The reason for the huge difference in query performance is revealed in the Query Plan.  Query 1 (Order by every row) on the left includes a <strong>Sort</strong> operation that returns 600 million rows, whereas Query 2 (order by with limit) on the right uses a <strong>SortWithLimit</strong> operation to reduce the entries from 600m to just 10.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/3fb85130-b7cd-44bc-adbb-71c81ec432dd.png" alt="Side-by-side query plan comparison of ORDER BY versus ORDER BY with LIMIT on 600 million rows: without a limit, the Sort step processes all 600 million rows at 34.8% of runtime, while SortWithLimit with a LIMIT 10 only carries 10 rows forward and drops the sort cost to 0.1%." alt class="image--center mx-auto" /></p>
<p>Another significant contributor to the query performance is that the Order by with limit scans half the number of micro-partitions and eliminates spilling to storage, significantly reducing query execution time.</p>
<h2 id="heading-spilling-to-storage">Spilling to Storage</h2>
<p>The diagram below illustrates the internal structure of an XSMALL virtual warehouse.  It (currently) consists of eight CPU cores, gigabytes of memory, and hundreds of gigabytes of fast SSD storage attached to slower Remote Storage.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/46f4fec1-af60-41d5-a4ff-8201a020905d.png" alt="Diagram of an X-Small Snowflake virtual warehouse's internal structure, showing its eight CPU cores, RAM chips, and SSD local storage connected to remote cloud storage." alt class="image--center mx-auto" /></p>
<p>hen Snowflake executes a query with an ORDER BY or GROUP BY clause, it must sort the results it attempts to complete in super-fast main memory.  However, sorting large data volumes in a smaller warehouse runs out of memory and needs to spill working data to SSD, which is thousands of times slower.</p>
<p>When sorting even bigger data volumes, it may need to spill to Remote Storage, which is many hundreds of times slower again.</p>
<p>It’s good practice to avoid spilling to storage where possible, but how to do this?</p>
<p>There are several Snowflake best practice tuning strategies to avoid spilling to storage, including:</p>
<ol>
<li><p><strong>Reduce sort volume:</strong>  Similar to the best practices above, this involves using the WHERE clause to filter out results as early as possible to reduce the number of sorted rows.</p>
</li>
<li><p><strong>Use a LIMIT:</strong>  As we can see above, a LIMIT clause is pushed down into the query, eliminating spilling to storage with a huge improvement in Snowflake query performance.</p>
</li>
<li><p><strong>Scale Up:</strong> The diagram below illustrates the internal structure of a MEDIUM-size warehouse, which includes four servers**.**  By scaling up to a larger warehouse, we can spread the workload across multiple servers, which gives (in this case) four times the memory and SSD, which is the simplest way to resolve the issue.</p>
</li>
<li><p><strong>Cluster the Data:</strong>  A final (although sometimes challenging) approach involves clustering the data by the sort key.  This often eliminates the SORT operation and can have a massive impact on query performance.</p>
</li>
</ol>
<h2 id="heading-clustering-the-data">Clustering the Data</h2>
<p>The quickest and most simple way of clustering data is to sort it by one or more columns.  The SQL snippet below will produce a sorted version of a table:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">insert</span> overwrite <span class="hljs-keyword">into</span> orders
<span class="hljs-keyword">select</span> *
<span class="hljs-keyword">from</span> orders
<span class="hljs-keyword">order</span> <span class="hljs-keyword">by</span> o_orderdate;
</code></pre>
<p>The above query replaces the contents of the ORDERS table with data sorted by ORDER DATE, which means any GROUP BY or ORDER BY won’t need to sort the data.  This approach is, however, not without its drawbacks, and it’s worth reading the article <a target="_blank" href="https://www.analytics.today/blog/snowflake-clustering-best-practice">Snowflake Clustering Keys Best Practice</a> for further guidance.</p>
<h2 id="heading-maximizing-snowflake-data-transformation-performance">Maximizing Snowflake Data Transformation Performance</h2>
<p>Data Transformation involves fetching, cleaning, merging, and transforming data into a form suitable for end-user consumption, and this often accounts for 60-80% of the overall system cost.  It, therefore, must be the primary focus for Snowflake query tuning.  In addition to producing results faster, tuning transformation jobs can significantly impact Snowflake's cost.</p>
<h2 id="heading-avoid-row-by-row-processing">Avoid row-by-row-processing</h2>
<p>Data Engineers and Data Scientists have the option to execute procedural code against Snowflake using Python, Java, Javascript and Snowflake Scripting in addition to Scala using Snowpark. There's a risk however, that coding in a language which supports LOOPS, leads to repeated single-row query execution - also know as "Row-by-Row" processing.</p>
<blockquote>
<p>Row by Row Processing - is "Slow-by-Slow" - <a target="_blank" href="https://asktom.oracle.com/Misc/slow-by-slow.html">Tom Kyte</a></p>
</blockquote>
<p>One of the most important query-tuning best practices on Snowflake is to avoid row-by-row processing.  Unlike on-premises databases like Oracle, Snowflake is designed primarily for set-at-a-time processing of large data volumes rather than single-row inserts, updates, or deletes.</p>
<p>Take the following row-by-row solution, which takes around ten seconds to copy just ten rows into the CUSTOMER table:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">declare</span>
v_counter <span class="hljs-built_in">number</span>;
<span class="hljs-keyword">begin</span>
  <span class="hljs-keyword">for</span> v_counter <span class="hljs-keyword">in</span> <span class="hljs-number">1</span> <span class="hljs-keyword">to</span> <span class="hljs-number">10</span>, <span class="hljs-keyword">do</span>
     <span class="hljs-keyword">insert</span> <span class="hljs-keyword">into</span> customer
     <span class="hljs-keyword">select</span> *
     <span class="hljs-keyword">from</span> snowflake_sample_data.tpcds_sf100tcl.customer
     <span class="hljs-keyword">limit</span> <span class="hljs-number">1</span>;
  <span class="hljs-keyword">end</span> <span class="hljs-keyword">for</span>;
<span class="hljs-keyword">end</span>;
</code></pre>
<p>Then, consider the following set-at-a-time query that copies data from the same table in 9.4 seconds on an XSMALL warehouse.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">insert</span> <span class="hljs-keyword">into</span> customer
<span class="hljs-keyword">select</span> *
<span class="hljs-keyword">from</span> snowflake_sample_data.tpcds_sf100tcl.customer
<span class="hljs-keyword">limit</span> <span class="hljs-number">15000000</span>;
</code></pre>
<p>In conclusion, using set-at-a-time queries, Snowflake can process fifteen million rows simultaneously as row-by-row processing copies ten rows.  That’s a performance improvement of 1.5 million times.</p>
<p>The only exception to the above scenario is when dealing with Snowflake Hybrid Tables, designed for OLTP-type applications processing single-row DML operations in milliseconds.</p>
<h2 id="heading-scale-up-for-larger-data-volume">Scale up for larger Data Volume.</h2>
<p>This best practice is true for almost any end-user or transformation queries and involves executing long-running queries on a larger virtual warehouse.</p>
<p>In principle, provided the query workload can be distributed across all the available servers, any query will run twice as fast on the next warehouse size.  Consider the following table showing the benchmark results of copying a 1.3 TB table on different warehouse sizes.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/09622cd1-d387-49db-bc7e-be4c4199c11e.png" alt="Table showing query elapsed time and percentage improvement across Snowflake warehouse sizes, from 4 hours on XSMALL down to 60 seconds on X6LARGE, with roughly 80 to 100 percent improvement at each size increase." alt class="image--center mx-auto" /></p>
<p>The results above demonstrate very large data volumes can be scaled from an XSMALL warehouse running for four hours to an X6LARGE in just 60 seconds.  Notice the improvement is around 76% to 100% each time.  This is the most important key performance indicator (KPI) when warehouse sizing.  Provided the workload completes around twice as fast each time, it’s worth trying the workload on the next size up.</p>
<p>The challenge of identifying the optimum warehouse size is illustrated in the diagram below.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/5135263c-472f-4f7d-abb4-3091ba638f78.png" alt="Chart plotting query execution time against warehouse size from XSMALL to X2LARGE, showing execution time dropping 67 to 115 percent faster at each larger size while query cost stays roughly flat." alt class="image--center mx-auto" /></p>
<p>The above diagram shows the performance of a benchmark query executed on an XSMALL to X2LARGE warehouse.  In this case, the query processed a relatively small data volume (several gigabytes), and although each time we scaled up to a larger warehouse, (for example from an XSMALL to a SMALL), the query was executed twice as fast.</p>
<p>Since the charge rate per second doubles with warehouse size, we can conclude that each step where the performance is at least double, that the cost will remain the same.</p>
<blockquote>
<p>Snowflake has an amazing super-power. You can often get the same work done twice as fast for the same cost. - <a target="_blank" href="https://kentgraziano.com/snowflake-resources/">Kent Graziano</a> (The Data Warrior)</p>
</blockquote>
<p>However, each time the performance gain is less than 100%, it costs slightly more, although of course you get the extra performance improvement.</p>
<p>For example, running the query on an XLARGE warehouse would cost 12% more than a LARGE warehouse for an 88% performance improvement.</p>
<p>The real insight here, however, is that the query time is reduced from 80 minutes on an XSMALL warehouse to just 8 minutes on a LARGE for the same cost.</p>
<p>Be aware though, there's almost no performance benefit in scaling up relatively simple, short running queries. The best approach is to execute your workload (all the queries for a given job or set of dashboard users), on a warehouse size, and then scale up until the performance improvement is less than 100%.</p>
<h2 id="heading-maximizing-snowflake-data-loading-performance">Maximizing Snowflake Data Loading Performance</h2>
<p>One of the single biggest mistakes made by data engineers is assuming a COPY operation will execute faster on a bigger virtual warehouse.  The correct answer is, yes, it will, but it depends.</p>
<p>If you execute the following SQL to load data files from the @SALES stage, Snowflake will use the currently assigned virtual warehouse to load data into the SALES table.  Let’s assume you use a MEDIUM-size warehouse to maximize load performance.</p>
<pre><code class="lang-sql">copy into sales
from @sales_stage;
</code></pre>
<p>If you’ve only a single file to load, the diagram below illustrates how Snowflake executes the COPY operation using a single CPU.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/7ac58bf0-c764-4720-bc48-0397313acba9.png" alt="Diagram of a single CSV file loading into a multi-cluster Snowflake warehouse: only one of four clusters' CPU, RAM, and SSD is activated, while the other three sit idle, illustrating why a single-file COPY can't use additional clusters." alt class="image--center mx-auto" /></p>
<p>In summary, this won’t improve COPY performance and will take the same time to load on a MEDIUM-size warehouse as an XSMALL.</p>
<p>If you deliver hundreds of files, each file will be loaded in parallel on a separate CPU core with massive load performance.  As a MEDIUM size warehouse has four servers, each with eight CPU cores, you can load up to 32 files in parallel, effectively improving load performance by 3,200%.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/e35a9e8b-6693-425f-b0fa-55a96c928581.png" alt="Diagram of many files loading in parallel into the same multi-cluster warehouse, with all four clusters' CPU, RAM, and SSD active simultaneously, illustrating how splitting data into more files lets a COPY operation use every available cluster." alt class="image--center mx-auto" /></p>
<p>Be aware, however, it’s best practice to ensure data files are sized between 100-250MB, which means you’ll need a huge volume of data to justify splitting files.  It’s, therefore, good practice to use just two warehouses to load all data into Snowflake.   One XSMALL warehouse for single files (data loads of up to 250MB compressed), and another MEDIUM or larger warehouse for huge data loads split into file chunks of up to 250MB.</p>
<p>Remember, an XSMALL warehouse can load just eight files in parallel; during very busy times, you may be loading more than eight files in parallel.  It’s, therefore, also a best practice to configure data-loading warehouses to use the Snowflake scale-out feature.  The SQL statement below illustrates how:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">create</span> warehouse load_vwh <span class="hljs-keyword">with</span>
   Warehouse_size = XSMALL
   min_cluster_count = <span class="hljs-number">1</span>
   max_cluster_count = <span class="hljs-number">8</span>
   auto_suspend = <span class="hljs-number">30</span>;
</code></pre>
<p>The diagram below illustrates how the solution works.  It shows how multiple parallel COPY operations are executed on a single XSMALL warehouse.  As the number of operations reaches eight parallel loads, Snowflake automatically adds additional servers to cope with the additional workload.</p>
<p><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/ee651d0d-e65c-4e78-9c53-2799e5dacef0.png" alt="Diagram of three CSV files each loading in parallel through their own compute instance within a single X-Small multi-cluster warehouse into separate destination tables, illustrating how Snowflake scales out clusters as concurrent COPY operations increase." alt class="image--center mx-auto" /></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In conclusion, Snowflake deploys a revolutionary hardware and software architecture to maximize query performance, supporting scaling up (to a larger warehouse) and out (for more concurrent queries). Using the simple query performance strategies outlined in this article can greatly impact overall query performance, often for very little effort.</p>
<hr />
<p>Deliver more performance and cost savings with Altimate AI's cutting-edge AI teammates. These intelligent teammates come pre-loaded with the insights discussed in this article, enabling you to implement our recommendations across millions of queries and tables effortlessly. Ready to see it in action? Request a recorded demo by just sending a chat message (<a target="_blank" href="https://app.myaltimate.com/contactus">here</a>) and discover how AI teammates can transform your data teams.</p>
<p><a target="_blank" href="https://app.myaltimate.com/contactus"><img src="/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/d9ad5daf-6edc-4c94-a697-80f6cb79cbc5.png" alt="Promotional banner reading &quot;AI Data Teammates that work for you 24/7&quot; with a Book a Demo button, next to a screenshot of the Auto Tune dashboard showing realized and estimated savings on a Snowflake warehouse." alt /></a></p>]]></content:encoded>
    <enclosure url="https://altimate.ai/blog/optimizing-snowflake-queries-expert-strategies-for-data-engineers-and-analysts/3bc6e31d-4dc7-49e5-9e4e-cc8cadce929c.webp" type="image/webp" />
  </item>
</channel>
</rss>
