* 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
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.
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.
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