3 weeks ago
Dear Databricks Community and experts, I'm creating AI/BI Dashboards using Genie LLM's /importBI function and I want the optimize my dataset by reducing my rows to 100K and size to 100MB. However, since I couldn't find a clear explanation in any resource on how to determine the number of rows in my dashboards and its size in MB, I decided ask here and hope you can help me regarding to this question. Thank you in advance.
3 weeks ago - last edited 3 weeks ago
Thereโs currently no row-count or size metric in the AI/BI Dashboard editor, but you can get both numbers for any dataset by running its SQL through the SQL Statement Execution API and reading the response manifest.
1. Statement Execution API
databricks api post /api/2.0/sql/statements \
--json '{
"warehouse_id": "YOUR_WAREHOUSE_ID",
"statement": "SELECT ....",
"disposition": "EXTERNAL_LINKS",
"format": "JSON_ARRAY",
"wait_timeout": "50s"
}'In the response, look at manifest:
I validated this through few experiments covering different row counts, wider datasets, JSON/Arrow formats, API limits, and SQL aggregation. The API consistently returned the relevant metrics.
2. System tables and Query History API
I also checked system.query.history, the Query History REST API and SQL Query Profile.
These expose useful statistics such as produced_rows, read_bytes, execution duration and query source. Few Caveats:
3: Dashboard API: no measured sizes
Have tested the dashboard endpoint, they return dashboard IDs, names, warehouse details, dataset SQL, visualization and filter definitions, and layout configuration. None of the responses includes measured row counts or byte counts.
It's a good idea if AI/BI dashboard expose dataset level statistics either in data tab/ Programmatic access via Dashboard API, especially for dashboards generated automatically using /importBI to assess dataset volume. Hopefully Databricks will consider adding this feature in future releases.
3 weeks ago - last edited 3 weeks ago
@data_pulse Nice answer, the API trick is handy.
@Mertokcu - A couple of things that might help too.
Worth knowing that 100K rows / 100 MB isn't a hard limit. It's where the dashboard decides where filtering happens.
The quickest way I've found to check which side you're on is Query History. Open it, click a few filters on the dashboard, and see if new queries show up wrapped in a WITH clause. If they do, you're over. If nothing new appears, you're under and running in the browser.
For just the row count, SELECT COUNT(*) FROM (<your dataset query>) in the SQL editor does it.
And if you're trying to get under the limit after /importBI, check the SQL it generated. Migrated datasets are often a SELECT * over a wide table. Picking only the columns your charts use and doing the GROUP BY in the dataset query usually cuts the size a lot, since columns add up just as much as rows.
3 weeks ago
@Mertokcu AI/BI Dashboards don't enforce a hard limit on dataset size - 100K rows and 100MB figures represent a performance threshold rather and not a cap. When the dataset stays at or under that threshold, the results are pulled directly into the browser where filtering and aggregation run client side with browser caching. Once a dataset exceeds 100K rows or 100MB, the behavior changes - the dataset SQL gets wrapped in a WITH clause and processed on the SQL warehouse backend, with individual visualization queries becoming visible in the query history. More details here
2 weeks ago
Hi, 100K rows and 100MB aren't hard limits. They're the threshold for browser-side filtering:
Under both: the dataset loads into the browser, so filters and cross-filtering are instant.
Over either: filtering runs on the SQL warehouse, so every interaction sends a query.
Bigger datasets still work, just with more queries. Most charts also only render 15K rows, so aggregate where you can.
Row count Run SELECT COUNT(*) FROM (<your dataset query>), or check query history for your dashboard. By default only admins can query this table, and records can take up to an hour to appear.
SELECT start_time, produced_rows, statement_text
FROM system.query.history
WHERE query_source.dashboard_id = '<your-dashboard-id>'
ORDER BY start_time DESC;
Size in MB There's no direct figure. read_bytes is how much data was scanned, not the result size. To check:
On the published dashboard, change a field filter to a value you haven't used recently. Use a filter, not a parameter, since parameter changes always run a query.
Open Query History.
If no new query appears, you're under the threshold. If you see new queries wrapped in WITH, you're over.
To get under it
Only select the columns you need. Wide text columns are often what pushes it past 100MB.
Pre-aggregate to the level your charts show.
Use WHERE clauses or parameters to cut down the data early.
Add LIMIT 100000 as a safety cap, with an ORDER BY so you keep the rows that matter, like the most recent. Keep in mind that LIMIT just drops rows, so totals and charts only reflect what's left. Use it as a backstop, not instead of filtering or aggregating. It also won't help with the 100MB side.
Check the datasets /importBI generates for any SELECT *.
Docs: