Merge pull request #11161 from influxdata/enhancement/improve-meta-query-speed

Improve meta query for tags
pull/11169/head
Brandon Farmer 2019-01-16 13:30:59 -08:00 committed by GitHub
commit 041161a646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -38,11 +38,15 @@ async function findKeys(
const query = `from(bucket: "${bucket}")
|> range(start: -${SEARCH_DURATION})${tagFilters}
|> drop(columns: ["_time", "_start", "_stop", "_value"])
|> keys()
|> group()
|> distinct()
|> keep(columns: ["_value"])${searchFilter}${previousKeyFilter}
|> filter(fn: (r) =>
r._value != "_time" or
r._value != "_start" or
r._value != "_stop" or
r._value != "_value")
|> sort()
|> limit(n: ${LIMIT})`