This commit is contained in:
凌涛 2023-12-19 15:01:21 +08:00
parent 761554e86d
commit 83d4b72961
2 changed files with 38 additions and 68 deletions

View File

@ -1,57 +1,10 @@
========================================
| SKIP 3 GRANUS |
| Required String: Hello |
| Alternative String: Hello ClickHouse |
| Alternative String: Hello World |
========================================
Expression ((Projection + Before ORDER BY))
ReadFromMergeTree (test_tokenbf_match.test_tokenbf)
Indexes:
PrimaryKey
Condition: true
Parts: 1/1
Granules: 5/5 Granules: 5/5
Skip
Name: str_idx
Description: tokenbf_v1 GRANULARITY 1
Parts: 1/1
Granules: 2/5 Granules: 2/5
========================================
| SKIP 3 GRANUS |
| No Required String |
| Alternative String: ClickHouse |
| Alternative String: World |
========================================
Expression ((Projection + Before ORDER BY))
ReadFromMergeTree (test_tokenbf_match.test_tokenbf)
Indexes:
PrimaryKey
Condition: true
Parts: 1/1
Granules: 5/5 Granules: 5/5
Skip
Name: str_idx
Description: tokenbf_v1 GRANULARITY 1
Parts: 1/1
Granules: 2/5 Granules: 2/5
========================================
| SKIP 4 GRANUS |
| Required String: OLAP |
| No Alternative String |
========================================
Expression ((Projection + Before ORDER BY))
ReadFromMergeTree (test_tokenbf_match.test_tokenbf)
Indexes:
PrimaryKey
Condition: true
Parts: 1/1
Granules: 5/5 Granules: 5/5
Skip
Name: str_idx
Description: tokenbf_v1 GRANULARITY 1
Parts: 1/1
Granules: 1/5 Granules: 1/5

View File

@ -16,36 +16,53 @@ SETTINGS index_granularity = 1;
INSERT INTO test_tokenbf_match.test_tokenbf VALUES (1, 'Hello ClickHouse'), (2, 'Hello World'), (3, 'Hello Github'), (4, 'Hello Cloud'), (5, 'OLAP Database'); INSERT INTO test_tokenbf_match.test_tokenbf VALUES (1, 'Hello ClickHouse'), (2, 'Hello World'), (3, 'Hello Github'), (4, 'Hello Cloud'), (5, 'OLAP Database');
SELECT '========================================'; --SKIP 3 GRANUS
SELECT '| SKIP 3 GRANUS |'; --Required String: Hello
SELECT '| Required String: Hello |'; --Alternative String: Hello ClickHouse
SELECT '| Alternative String: Hello ClickHouse |'; --Alternative String: Hello World
SELECT '| Alternative String: Hello World |'; SELECT
SELECT '========================================'; *
FROM
(
EXPLAIN indexes=1
SELECT * FROM test_tokenbf_match.test_tokenbf WHERE match(str, 'Hello (ClickHouse|World)')
)
WHERE
explain like '%Granules%';
EXPLAIN indexes=1 SELECT * FROM test_tokenbf_match.test_tokenbf WHERE match(str, 'Hello (ClickHouse|World)');
SELECT ''; SELECT '';
SELECT ''; SELECT '';
SELECT '========================================';
SELECT '| SKIP 3 GRANUS |';
SELECT '| No Required String |';
SELECT '| Alternative String: ClickHouse |';
SELECT '| Alternative String: World |';
SELECT '========================================';
EXPLAIN indexes = 1 SELECT * FROM test_tokenbf_match.test_tokenbf where match(str, '(.*?)* (ClickHouse|World)'); --SKIP 3 GRANUS
--No Required String
--Alternative String: ClickHouse
--Alternative String: World
SELECT
*
FROM
(
EXPLAIN indexes = 1
SELECT * FROM test_tokenbf_match.test_tokenbf where match(str, '(.*?)* (ClickHouse|World)')
)
WHERE
explain like '%Granules%';
SELECT ''; SELECT '';
SELECT ''; SELECT '';
SELECT '========================================'; --SKIP 4 GRANUS
SELECT '| SKIP 4 GRANUS |'; --Required String: OLAP
SELECT '| Required String: OLAP |'; --No Alternative String
SELECT '| No Alternative String |'; SELECT
SELECT '========================================'; *
FROM
EXPLAIN indexes = 1 SELECT * FROM test_tokenbf_match.test_tokenbf where match(str, 'OLAP (.*?)*'); (
EXPLAIN indexes = 1
SELECT * FROM test_tokenbf_match.test_tokenbf where match(str, 'OLAP (.*?)*')
)
WHERE
explain like '%Granules%';
DROP DATABASE IF EXISTS test_tokenbf_match; DROP DATABASE IF EXISTS test_tokenbf_match;