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

Improve SHOW TAG KEYS performance. #9073

Merged
merged 1 commit into from
Nov 7, 2017

Conversation

benbjohnson
Copy link
Contributor

@benbjohnson benbjohnson commented Nov 7, 2017

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

@benbjohnson benbjohnson requested a review from e-dard November 7, 2017 15:58
@ghost ghost assigned benbjohnson Nov 7, 2017
@ghost ghost added the review label Nov 7, 2017
Copy link
Contributor

@e-dard e-dard left a comment

Choose a reason for hiding this comment

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

Just a couple of suggestions.

@@ -932,6 +934,98 @@ func (e *StatementExecutor) executeShowSubscriptionsStatement(stmt *influxql.Sho
return rows, nil
}

func (e *StatementExecutor) executeShowTagKeys(q *influxql.ShowTagKeysStatement, ctx *query.ExecutionContext) error {
var dis []meta.DatabaseInfo
if q.Database != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that q.Database can be empty. The StatementRewriter should have set it I think. Did you encounter a case where it was empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you're right. Not sure where I was thinking it could be empty. Fixed in 156f25a.

}
dis = []meta.DatabaseInfo{*di}
} else {
dis = e.MetaClient.Databases()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think SHOW TAG VALUES should work across databases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 156f25a.

tsdb/store.go Outdated
switch e := e.(type) {
case *influxql.BinaryExpr:
// Remove time clause from condition
if ref, ok := e.LHS.(*influxql.VarRef); ok && strings.ToLower(ref.Val) == "time" {
Copy link
Contributor

Choose a reason for hiding this comment

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

The time clause should already be removed by influxql.ConditionExpr in the StatementExecutor I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in 156f25a.

Copy link
Contributor

@e-dard e-dard left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@benbjohnson benbjohnson merged commit af99311 into influxdata:master Nov 7, 2017
@ghost ghost removed the review label Nov 7, 2017
@benbjohnson benbjohnson deleted the show-query-perf-2 branch November 7, 2017 19: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.

2 participants