Commit Graph

11 Commits (e62efaf751b851e6c610c2229a10b70730bfb338)

Author SHA1 Message Date
Sam Arnold 17b9ea8723
feat: Add WITH KEY to show tag keys (#20793)
* fix: Change from RewriteExpr to PartitionExpr

Also remove some dead code

* feat: WITH KEY implementation

* feat: query rewriting for WITH KEY in SHOW TAG KEYS
2021-02-25 08:38:29 -05:00
Sam Arnold de1a0eb2a9
feat: use count_hll for 'show series cardinality' queries (#20745)
Closes: https://github.com/influxdata/influxdb/issues/20614

Also fix nil pointer for seriesKey iterator

Fix for bug in: https://github.com/influxdata/influxdb/issues/20543

Also add a test for ingress metrics
2021-02-10 16:00:16 -05:00
Ayan George 6808702703
refactor(query): reuse matchAllRegex (#18146)
matchAllRegex is a global variable containing the precompiled regex that
matches ".+".

Prior to this commit, it was used in only one place and we called its
.Copy() method.

According to the docs, .Copy() is no longer needed for safe concurrent
access:

  Deprecated: In earlier releases, when using a Regexp in multiple
  goroutines, giving each goroutine its own copy helped to avoid lock
  contention. As of Go 1.12, using Copy is no longer necessary to avoid
  lock contention. Copy may still be appropriate if the reason for its
  use is to make two copies with different Longest settings.

Since we require Go 1.13 or later now and we're not calling the
Longest() method, this patch removes the .Copy() call.

Now that we have a reusable matchAllRegex value, this patch then
replaces all instances of regexp.MustCompile(`.+`) with matchAllRegex.
This will elminate runtime regex compilations.
2020-05-18 18:45:33 -04:00
Adam Perlin d6e34bb3e0 fix(query): make show series exact cardinality count only distinct series 2019-07-24 16:39:05 -07:00
Ben Johnson 156f25ac23
Improve SHOW TAG KEYS performance. 2017-11-07 10:59:19 -07:00
Edd Robinson 9f7a6ab044 refactor for external influxql package 2017-11-06 19:15:01 +00:00
Edd Robinson fbcb299b8a Support WHERE time clause in SHOW TAG VALUES
This commit adds time support to SHOW TAG VALUES. Time can be used as
both a lower and upper boundary. However, there are some caveats.

For the `inmem` index, filtering by time will still return all results
because the index data is shared across shards.

For the `tsi1` index, filtering by time will only work down to the shard
lever. Specifically, when querying by time all shards within that time
range will be used to generate the results.
2017-11-06 19:15:01 +00:00
Edd Robinson b2a3b8837f Remove time from SHOW MEASUREMENTS 2017-11-06 19:15:00 +00:00
Edd Robinson 98d584b63f Use index for SHOW X meta queries
When a meta query does not include a time component then it can be
answered exclusively by the index. This should result in a much faster
query execution that if the TSM engine was engaged.

This commit rewrites the following queries such that they make use
of the index where no time component is present:

  - SHOW MEASUREMENTS
  - SHOW SERIES
  - SHOW TAG KEYS
  - SHOW FIELD KEYS
2017-11-06 19:15:00 +00:00
Stuart Carnie f3d45ba301 influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
Stuart Carnie 7435725e05 move RewriteStatement and neldermead to influxdb/query package 2017-10-30 10:24:15 -07:00