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

Use system cursors for measurement, series, and tag key meta queries. #8752

Merged
merged 1 commit into from
Aug 30, 2017

Conversation

benbjohnson
Copy link
Contributor

@benbjohnson benbjohnson commented Aug 28, 2017

Overview

This pull request changes several meta queries to use the new system cursors instead of the higher level system iterators used before. This allows the queries to filter based on time (with only shard-level time granularity).

SHOW SERIES
SHOW MEASUREMENTS
SHOW TAG KEYS

This does not include SHOW TAG VALUES or SHOW FIELD KEYS.

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

@@ -1066,6 +1066,12 @@ type SelectStatement struct {
// Removes the "time" column from the output.
OmitTime bool

// Removes measurement name from resulting query. Useful for meta queries.
StripName bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of adding these two options, but I don't see an alternative at the moment.

Copy link
Contributor

@joelegasse joelegasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One possibly minor nit about recompiling a regex on every query.


func rewriteSources2(sources Sources, database string) Sources {
if len(sources) == 0 {
sources = Sources{&Measurement{Regex: &RegexLiteral{Val: regexp.MustCompile(`.+`)}}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than recompiling the regex every time, the compilation can be done in an init() function, then Regexp.Copy() can be used here.

@benbjohnson benbjohnson merged commit 57d42ac into influxdata:master Aug 30, 2017
@benbjohnson benbjohnson deleted the 1479-meta-queries branch August 30, 2017 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants