CREATE TABLE test (
  ts timestamp(3) time index,
  host STRING,
  val BIGINT,
  PRIMARY KEY(host),
);

Affected Rows: 0

INSERT INTO TABLE test VALUES
    (0, '10.0.160.237:8080', 1),
    (0, '10.0.160.237:8081', 1);

Affected Rows: 2

SELECT * FROM test;

+---------------------+-------------------+-----+
| ts                  | host              | val |
+---------------------+-------------------+-----+
| 1970-01-01T00:00:00 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:00:00 | 10.0.160.237:8081 | 1   |
+---------------------+-------------------+-----+

TQL EVAL (0, 100, '15s') test{host=~"(10.0.160.237:8080|10.0.160.237:9090)"};

+---------------------+-------------------+-----+
| ts                  | host              | val |
+---------------------+-------------------+-----+
| 1970-01-01T00:00:00 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:00:15 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:00:30 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:00:45 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:01:00 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:01:15 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:01:30 | 10.0.160.237:8080 | 1   |
+---------------------+-------------------+-----+

TQL EVAL (0, 100, '15s') test{host=~"10\\.0\\.160\\.237:808|nonexistence"};

++
++

TQL EVAL (0, 100, '15s') test{host=~"(10\\.0\\.160\\.237:8080|10\\.0\\.160\\.237:9090)"};

+---------------------+-------------------+-----+
| ts                  | host              | val |
+---------------------+-------------------+-----+
| 1970-01-01T00:00:00 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:00:15 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:00:30 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:00:45 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:01:00 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:01:15 | 10.0.160.237:8080 | 1   |
| 1970-01-01T00:01:30 | 10.0.160.237:8080 | 1   |
+---------------------+-------------------+-----+

-- Some radical regex optimization
-- SQLNESS REPLACE (metrics.*) REDACTED
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
-- SQLNESS REPLACE (Hash.*) REDACTED
-- SQLNESS REPLACE (-+) -
-- SQLNESS REPLACE (\s\s+) _
-- SQLNESS REPLACE (peers.*) REDACTED
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
TQL ANALYZE VERBOSE (0, 0, '1s') test{host=~".*"};

+-+-+-+
| stage | node | plan_|
+-+-+-+
| 0_| 0_|_CooperativeExec REDACTED
|_|_|_MergeScanExec: REDACTED
|_|_|_|
| 1_| 0_|_PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[1000], time index=[ts] REDACTED
|_|_|_PromSeriesDivideExec: tags=["host"] REDACTED
|_|_|_CooperativeExec REDACTED
|_|_|_SeriesScan: region=REDACTED, {"partition_count":{"count":1, "mem_ranges":1, "files":0, "file_ranges":0}, "distribution":"PerSeries", "projection": ["ts", "host", "val"], "filters": ["ts >= TimestampMillisecond(-300000, None)", "ts <= TimestampMillisecond(300000, None)"], "REDACTED
|_|_|_|
|_|_| Total rows: 2_|
+-+-+-+

-- SQLNESS REPLACE (metrics.*) REDACTED
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
-- SQLNESS REPLACE (Hash.*) REDACTED
-- SQLNESS REPLACE (-+) -
-- SQLNESS REPLACE (\s\s+) _
-- SQLNESS REPLACE (peers.*) REDACTED
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
TQL ANALYZE VERBOSE (0, 0, '1s') test{host=~".+"};

+-+-+-+
| stage | node | plan_|
+-+-+-+
| 0_| 0_|_CooperativeExec REDACTED
|_|_|_MergeScanExec: REDACTED
|_|_|_|
| 1_| 0_|_PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[1000], time index=[ts] REDACTED
|_|_|_PromSeriesDivideExec: tags=["host"] REDACTED
|_|_|_CooperativeExec REDACTED
|_|_|_SeriesScan: region=REDACTED, {"partition_count":{"count":1, "mem_ranges":1, "files":0, "file_ranges":0}, "distribution":"PerSeries", "projection": ["ts", "host", "val"], "filters": ["host != Utf8(\"\")", "ts >= TimestampMillisecond(-300000, None)", "ts <= TimestampMillisecond(300000, None)"], "REDACTED
|_|_|_|
|_|_| Total rows: 2_|
+-+-+-+

-- SQLNESS REPLACE (metrics.*) REDACTED
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
-- SQLNESS REPLACE (Hash.*) REDACTED
-- SQLNESS REPLACE (-+) -
-- SQLNESS REPLACE (\s\s+) _
-- SQLNESS REPLACE (peers.*) REDACTED
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
TQL ANALYZE VERBOSE (0, 0, '1s') test{host!~".*"};

+-+-+-+
| stage | node | plan_|
+-+-+-+
| 0_| 0_|_CooperativeExec REDACTED
|_|_|_MergeScanExec: REDACTED
|_|_|_|
| 1_| 0_|_PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[1000], time index=[ts] REDACTED
|_|_|_CoalesceBatchesExec: target_batch_size=8192 REDACTED
|_|_|_RepartitionExec: partitioning=REDACTED
|_|_|_PromSeriesDivideExec: tags=["host"] REDACTED
|_|_|_SortExec: expr=[host@1 ASC, ts@0 ASC], preserve_partitioning=[false] REDACTED
|_|_|_EmptyExec REDACTED
|_|_|_|
|_|_| Total rows: 0_|
+-+-+-+

-- SQLNESS REPLACE (metrics.*) REDACTED
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
-- SQLNESS REPLACE (Hash.*) REDACTED
-- SQLNESS REPLACE (-+) -
-- SQLNESS REPLACE (\s\s+) _
-- SQLNESS REPLACE (peers.*) REDACTED
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
TQL ANALYZE VERBOSE (0, 0, '1s') test{host!~".+"};

+-+-+-+
| stage | node | plan_|
+-+-+-+
| 0_| 0_|_CooperativeExec REDACTED
|_|_|_MergeScanExec: REDACTED
|_|_|_|
| 1_| 0_|_PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[1000], time index=[ts] REDACTED
|_|_|_PromSeriesDivideExec: tags=["host"] REDACTED
|_|_|_CooperativeExec REDACTED
|_|_|_SeriesScan: region=REDACTED, {"partition_count":{"count":1, "mem_ranges":1, "files":0, "file_ranges":0}, "distribution":"PerSeries", "projection": ["ts", "host", "val"], "filters": ["host = Utf8(\"\")", "ts >= TimestampMillisecond(-300000, None)", "ts <= TimestampMillisecond(300000, None)"], "REDACTED
|_|_|_|
|_|_| Total rows: 0_|
+-+-+-+

DROP TABLE test;

Affected Rows: 0

