InfluxDB dynamic downsampling in Main UI based on selected period

I have Item that captures Grid Power consumed every 10s, the updates are stored in Influx DB.

When I use Main UI chart component period longer than day is miserably slow e.g. 1 month takes 45 seconds to open and downloads 2.4MB of data.

In comparison when I query data with any other tool like Chronograf or Grafana it is instantaneous (40ms). The reason is that these tools group by and avg() over intervals that change based on the selected date range so the number of data points is constant.
E.g. SELECT mean("value") AS "mean_value" FROM "openhab"."autogen"."Inverter_Grid_Power" WHERE time > :dashboardTime: AND time < :upperDashboardTime: AND "item"='Inverter_Grid_Power' GROUP BY time(:interval:) FILL(null)

I couldn’t find any setting in OpenHab Chart UI. I’m not sure if persistence abstraction even supports it, even when I select Period-Fixed and Aggregate on Chart Widget it still fetches all datapoints and does aggregation on the UI side.

I think this is a major oversite especially since users often run it on less powerful hardware like RasspberryPi, it would improve the general responsiveness of the system I noticed that even trendlines are many times slower it seems they do aggregation after fetching all points in period.

I cannot say anything about the integration of any function in the MainUI. But this is how I solved the problem.