<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Tracing SQL costs in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/tracing-sql-costs/m-p/142253#M4659</link>
    <description>&lt;P&gt;you are right, no column named product. instead you need to use sku_name containing 'SQL Serverless' OR product_features containing 'serverless'.&lt;/P&gt;&lt;P&gt;To join those 2 tables, you are right, no obvious single key available.&lt;/P&gt;&lt;P&gt;instead use time windows and warehouse-ID and join as below.&lt;/P&gt;&lt;P&gt;Billing table Query history table Remarks&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;workspace_id&lt;/TD&gt;&lt;TD&gt;workspace_id&lt;/TD&gt;&lt;TD&gt;Ensure same workspace&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;sku_name&lt;/TD&gt;&lt;TD&gt;(filter to SQL queries)&lt;/TD&gt;&lt;TD&gt;Ensure SQL Serverless&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;usage_start_time / usage_end_time&lt;/TD&gt;&lt;TD&gt;start_time / end_time&lt;/TD&gt;&lt;TD&gt;Time‑window correlation&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;product_features.warehouse_id (if present)&lt;/TD&gt;&lt;TD&gt;warehouse_id&lt;/TD&gt;&lt;TD&gt;Match warehouse&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Fri, 19 Dec 2025 13:10:03 GMT</pubDate>
    <dc:creator>Raman_Unifeye</dc:creator>
    <dc:date>2025-12-19T13:10:03Z</dc:date>
    <item>
      <title>Tracing SQL costs</title>
      <link>https://community.databricks.com/t5/administration-architecture/tracing-sql-costs/m-p/142219#M4656</link>
      <description>&lt;P&gt;Hello, Databricks community!&lt;/P&gt;&lt;P&gt;In our Account Usage Dashboard, the biggest portion of our costs are labeled simply "SQL".&lt;/P&gt;&lt;P&gt;We want to drill deeper to see where the SQL costs are coming from.&lt;/P&gt;&lt;P&gt;By querying the `system.usage.billing` table we see that it's mostly serverless SQL queries driving the costs. However almost every field in both `product_features`, `usage_metadata`, and `identity_metadata` (even `run_as`)&amp;nbsp;are `null`.&lt;/P&gt;&lt;P&gt;Is this an error or intended behavior? If intended, how can we attribute used DBU quantities to specific queries or users to find out what is driving our costs?&lt;/P&gt;&lt;P&gt;Best regards, Simen&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2025 08:43:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/tracing-sql-costs/m-p/142219#M4656</guid>
      <dc:creator>simenheg</dc:creator>
      <dc:date>2025-12-19T08:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Tracing SQL costs</title>
      <link>https://community.databricks.com/t5/administration-architecture/tracing-sql-costs/m-p/142229#M4657</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/201450"&gt;@simenheg&lt;/a&gt;&amp;nbsp;- first of all, It’s not an error as Serverls SQL often produces null metadata fields.&lt;/P&gt;&lt;P&gt;So you will need to follow below steps for the cost&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use SQL Warehouse Query History&lt;/LI&gt;&lt;LI&gt;join billing data with SQL query history - system.billing.usage.usage_date,&amp;nbsp;system.billing.usage.workspace_id,&amp;nbsp;system.billing.usage.product = "SQL Serverless" - You can correlate with system.query.history (or the UI equivalent)&lt;/LI&gt;&lt;LI&gt;Now you use&amp;nbsp;SQL → Warehouses → (select warehouse) → Monitoring → Cost breakdown&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Above is a manual way to comprehend the cost.&lt;/P&gt;&lt;P&gt;You could always do tagging and bundle it up with predefined query based on your needs&lt;/P&gt;&lt;P&gt;Offical doc link -&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/admin/system-tables/serverless-billing?utm_source=copilot.com" target="_blank"&gt;https://docs.databricks.com/aws/en/admin/system-tables/serverless-billing?utm_source=copilot.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2025 10:55:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/tracing-sql-costs/m-p/142229#M4657</guid>
      <dc:creator>Raman_Unifeye</dc:creator>
      <dc:date>2025-12-19T10:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Tracing SQL costs</title>
      <link>https://community.databricks.com/t5/administration-architecture/tracing-sql-costs/m-p/142249#M4658</link>
      <description>&lt;P&gt;Thanks for your reply, Raman!&lt;/P&gt;&lt;P&gt;I have a couple of follow up questions.&lt;/P&gt;&lt;P&gt;I looked into joining `system.billing.usage` and `system.query.history` as you suggested, but ran into a problem: There is no column in our `system.billing.usage` table named `product`. Also, which column(s) should the two tables be joined on?&lt;/P&gt;&lt;P&gt;From the official documentation you linked to, the following is stated:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;The identity_metadata column includes the run_as field, which shows the user or service principal whose credentials were used to run the workload.&lt;/P&gt;&lt;P&gt;However in our case, the `run_as` field is almost always `null`, contrary to what the documentation says, so we don't know which user of service principal ran the query.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2025 12:23:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/tracing-sql-costs/m-p/142249#M4658</guid>
      <dc:creator>simenheg</dc:creator>
      <dc:date>2025-12-19T12:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Tracing SQL costs</title>
      <link>https://community.databricks.com/t5/administration-architecture/tracing-sql-costs/m-p/142253#M4659</link>
      <description>&lt;P&gt;you are right, no column named product. instead you need to use sku_name containing 'SQL Serverless' OR product_features containing 'serverless'.&lt;/P&gt;&lt;P&gt;To join those 2 tables, you are right, no obvious single key available.&lt;/P&gt;&lt;P&gt;instead use time windows and warehouse-ID and join as below.&lt;/P&gt;&lt;P&gt;Billing table Query history table Remarks&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;workspace_id&lt;/TD&gt;&lt;TD&gt;workspace_id&lt;/TD&gt;&lt;TD&gt;Ensure same workspace&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;sku_name&lt;/TD&gt;&lt;TD&gt;(filter to SQL queries)&lt;/TD&gt;&lt;TD&gt;Ensure SQL Serverless&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;usage_start_time / usage_end_time&lt;/TD&gt;&lt;TD&gt;start_time / end_time&lt;/TD&gt;&lt;TD&gt;Time‑window correlation&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;product_features.warehouse_id (if present)&lt;/TD&gt;&lt;TD&gt;warehouse_id&lt;/TD&gt;&lt;TD&gt;Match warehouse&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 19 Dec 2025 13:10:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/tracing-sql-costs/m-p/142253#M4659</guid>
      <dc:creator>Raman_Unifeye</dc:creator>
      <dc:date>2025-12-19T13:10:03Z</dc:date>
    </item>
  </channel>
</rss>

