Get Single Table Run Multiple Queries

Can we create stage table on Grafana? Prepare a query, it retrieves a table than design dashboard panels work on that stage table so Grafana doesn’t have to go SQL Server for each panel. It will improve query performance when working on slow queries.

I have inventory table on SQL Server and I want to make a dashboard give a summarized informations. For example, InstanceCount, Server Count, CPU Count, Memory Count, Disk Resources making some aggregations on different stat panel on grafana dashboard. So, it cousing performance issues because grafana runs queries parallel on a view for each stat panel.

Query behind Stat1 Panel:

SELECT COUNT(*) AS [InstanceCount] FROM (
SELECT DISTINCT [InstanceName]
FROM [Inventory_view] WITH (NOLOCK)
) AS SUB

Query behind Stat2 Panel:

SELECT COUNT(*) AS [ServerCount] FROM (
SELECT DISTINCT [ServerName]
FROM [Inventory_view] WITH (NOLOCK)
) AS SUB

on SQL Server I see 2 queries run but it doesn’t have to. I want to run 1 query on SQL Server to get Inventory_view table as filtered to grafana internal db and selected columns with my query. Than I can run different dashboard panel queries on it. I should set period or trigger on dashboard to get updated data.