-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
"list series" should allow filtering using a regular expression #376
Conversation
You can kind of do this right now using the select from regex queries. Like: select * from /some_regex/ limit 1 However, there is an open issue with the performance of doing a limit 1 query. It should be VERY fast, but #364 will track progress on fixing that. The purpose of the system database is less about describing schema and more about storing performance and log information. Although maybe that would make sense? Not sure. |
Being able to use a regex for "list series" (or whatever method of getting series names) would be useful in general. A method that returns only a part of the series name would be very useful in particular for grafana and mavino's patch grafana/grafana#375 for templated filters. |
the ability to get all series matching a certain expression would be great for graphite-influxdb. |
also I would appreciate the ability to not only retrieve series names (matching a regex), but also their respective column names. perhaps it would also make sense to filter not only on series names, but also on column names. ( see vimeo/graphite-influxdb#4) |
having this would shave a few hundred ms off every graphite-influxdb /render request, which would be pretty great! |
This will be trivial to implement after I merge in #689, which should be later this week. |
the below seems correct but i couldn't quite figure out how to best update the query parsing stuff to pass the regex into this function. anyone else wants to do that part? :)
|
You'll have to modify the query.yacc and possibly some other stuff. You can probably get it done by modeling it after how the drop series query is done since it has one argument: https://github.com/influxdb/influxdb/blob/master/parser/query.yacc#L171-L175 |
Is there an ETA for regex in 'list series' to be supported? We are waiting for this feature. Thanks. |
i've been trying to work on it but i got stuck on some yacc errors. https://gist.github.com/Dieterbe/f84a2aaf5ce7c49663a7 and haven't made progress since then. i'm hoping somebody else just beats me to it ;) maybe you can have a look. |
I'm checking with my team to see if we want to jump in on this and lend a hand. |
Is there a design doc on how this feature is to be implemented? How will regex searches be implemented efficiently? There is some concern on my team about whether this can be done or not. Thanks. |
i already got the regex stuff down (see the diff above), it's just a matter of parsing |
@ddieterly The naive way would just be to loop through the series names and see which ones match. They're all kept in memory so it should be fairly fast. How often would you be issuing list series queries? |
This particular query is initiated by user interaction. So, probably not very often. I think your ’naïve' solution is a good one. Thanks. |
Hey @pauldix, do y'all plan on adding this feature into the InfluxDB source code and if so is there a ETA? |
@TheOriginalAK47 no ETA, but this is a fairly important feature. I have a few other things on my plate but I'll try to take a look soon. Unless you can have a look at @Dieterbe's work and help him with the query language part? @Dieterbe, do you have this on a branch somewhere? |
i put my WIP stuff here |
"list series" should allow filtering using a regular expression
Looks good, we'll push with the next 0.8 rc. Syntax: |
awesome. looks great. thanks @jvshahid ! |
That's a good point, I think we can get rid of the extra slice by just filtering on the fly. Which I initially wanted to do, but forgot for some reason. |
You know a way to not even create 1 extra array? I'm intrigued. meantime I decided to try this out
simple benchmark:
result: no significant improvement. |
(btw, with my influx-cli program you can type |
The "list series" command should allow the return of a subset of series based on a regular expression similar to the way this is possible for select statements like "list series /stats..*/i;".
Since issue #351 talks about introducing a system database I'm wondering if it would perhaps be possible to get rid of the special "list series" syntax altogether and instead take an approach similar to MySQL's information_schema and use something like "select name from system.db.testdb.timeseries where name =~ /stats..*/".