Performance with SQLite plugin

I’m using the frser-sqlite-datasource and wonder about the performance.

I’m using “large” datasets usually displaying last 24 hours with one data point every 15s, so up to 5760 datapoints per query.

Updating the graph takes up to 1 minute according to chrome dev tools.
However if execute the same query directly in sql-cli, it takes less then 0,2 seconds.

I already tried to reduce the amount of data points via grouping by minute, effectively only resulting in one quarter of data points. Surprisingly that reduces the result size drastically by about 1/8, but almost doesn’t affect response time, which basically stays the same. Query executed directly in sql is still <0.2 seconds.

Does this lost then happen in the plugin?
But i wonder, why even reducing the amount of points seems not to affect the performance either.

Update: for whatever reason reducing the result amount brings the time down to ~25 seconds, which is still damn slow considering the pure sql query only takes milliseconds.
Also i figured out using $__unixEpochGroupSeconds still takes 35-40 seconds, so seems much slower then group using sql itself.

It could be happening in the plugin, in grafana or both.

For questions on the plugin, probably best to ask the developer(s) in their github

Or write your own sqlite api in nodejs and test out this theory by using your sqlite rest api in grafana