Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetInfluxDBStructureAsync seems to be inneficient in some cases #77

Open
SkyGTRx5 opened this issue Oct 14, 2019 · 3 comments
Open

GetInfluxDBStructureAsync seems to be inneficient in some cases #77

SkyGTRx5 opened this issue Oct 14, 2019 · 3 comments

Comments

@SkyGTRx5
Copy link

SkyGTRx5 commented Oct 14, 2019

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).

@mvadu
Copy link
Contributor

mvadu commented Oct 15, 2019

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

@SkyGTRx5
Copy link
Author

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

@mvadu
Copy link
Contributor

mvadu commented Oct 16, 2019

Give me few days, I will push an intermediate version with just this part of refactored code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants