InfluxDB.Client.Net
InfluxDB.Client.Net copied to clipboard
GetInfluxDBStructureAsync seems to be inneficient in some cases
Hi, recently you've made an update and closed my open issue about the most convinient way to count the entries. So, now it's possible to receive all detailed database structure using GetInfluxDBStructureAsync(dbName) on client. But I think this is kinda inneficient in cases, when I want to get only the details for particular measurement, since it provides a lot redundunt info for others and, what the most important, this operation is quite expensive in terms of time consuming. It calculates the data for all the measurements, but I suppose, the more common task is just to get the info for particuar one. Maybe its reasonable to create a method like GetMeasurmentDetailsAsync(string dbName, string measurementName).
That is the idea, in the v1.0 of the library I am planning to move few of these methods to their individual IInflux
objects, so IInfluxMeasurement
will have a method to get this data for itself. Also keep in mind Influx measurements are child of retention policy, not database. So you can have different Measurements with same name under different retention policies, so all of these methods have to take that into consideration too. For now please use the GetInfluxDBStructureAsync
So, I tried to use it, replaced my previous implementation of counting entries and it... just confirmed my concerns. This method is almost useless in case of having big database. For instance, we have dozens of measurements and many of them contain from one to several millions entries, so receiving the database structure takes unacceptable amount of time(honestly I just stopped my unit test after 2 minutes of waiting on getting the database structure line). In case of my previous implementation this test passes for about 700ms
Give me few days, I will push an intermediate version with just this part of refactored code.