Skip to content

Commit 1c7fae6

Browse files
committed
test: sqlness
Signed-off-by: SNC123 <[email protected]>
1 parent bea1aa6 commit 1c7fae6

File tree

3 files changed

+95
-1
lines changed

3 files changed

+95
-1
lines changed

src/mito2/src/worker/handle_rebuild_index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use store_api::storage::RegionId;
2424
use tokio::sync::mpsc;
2525

2626
use crate::access_layer::OperationType;
27-
use crate::engine::listener;
27+
// use crate::engine::listener;
2828
use crate::error::Result;
2929
use crate::manifest::action::{RegionMetaAction, RegionMetaActionList};
3030
use crate::region::{MitoRegionRef, RegionLeaderState};
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
CREATE TABLE test (
2+
ts TIMESTAMP TIME INDEX,
3+
msg TEXT,
4+
);
5+
6+
Affected Rows: 0
7+
8+
INSERT INTO test VALUES
9+
(1,"The quick brown fox jumps over the lazy dog"),
10+
(2,"The quick brown fox jumps over the lazy cat"),
11+
(3,"The quick brown fox jumps over the lazy mouse"),
12+
(4,"The quick brown fox jumps over the lazy rabbit"),
13+
(5,"The quick brown fox jumps over the lazy turtle");
14+
15+
Affected Rows: 5
16+
17+
SELECT * FROM test;
18+
19+
+-------------------------+------------------------------------------------+
20+
| ts | msg |
21+
+-------------------------+------------------------------------------------+
22+
| 1970-01-01T00:00:00.001 | The quick brown fox jumps over the lazy dog |
23+
| 1970-01-01T00:00:00.002 | The quick brown fox jumps over the lazy cat |
24+
| 1970-01-01T00:00:00.003 | The quick brown fox jumps over the lazy mouse |
25+
| 1970-01-01T00:00:00.004 | The quick brown fox jumps over the lazy rabbit |
26+
| 1970-01-01T00:00:00.005 | The quick brown fox jumps over the lazy turtle |
27+
+-------------------------+------------------------------------------------+
28+
29+
ADMIN FLUSH_TABLE('test');
30+
31+
+---------------------------+
32+
| ADMIN FLUSH_TABLE('test') |
33+
+---------------------------+
34+
| 0 |
35+
+---------------------------+
36+
37+
-- No fulltext index yet
38+
SELECT index_size FROM INFORMATION_SCHEMA.REGION_STATISTICS;
39+
40+
+------------+
41+
| index_size |
42+
+------------+
43+
| 0 |
44+
+------------+
45+
46+
ALTER TABLE test MODIFY COLUMN msg SET FULLTEXT INDEX;
47+
48+
Affected Rows: 0
49+
50+
ADMIN BUILD_INDEX('test');
51+
52+
+---------------------------+
53+
| ADMIN BUILD_INDEX('test') |
54+
+---------------------------+
55+
| 0 |
56+
+---------------------------+
57+
58+
-- SQLNESS SLEEP 1s
59+
-- Fulltext index built
60+
SELECT index_size FROM INFORMATION_SCHEMA.REGION_STATISTICS;
61+
62+
+------------+
63+
| index_size |
64+
+------------+
65+
| 318 |
66+
+------------+
67+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
CREATE TABLE test (
2+
ts TIMESTAMP TIME INDEX,
3+
msg TEXT,
4+
);
5+
6+
INSERT INTO test VALUES
7+
(1,"The quick brown fox jumps over the lazy dog"),
8+
(2,"The quick brown fox jumps over the lazy cat"),
9+
(3,"The quick brown fox jumps over the lazy mouse"),
10+
(4,"The quick brown fox jumps over the lazy rabbit"),
11+
(5,"The quick brown fox jumps over the lazy turtle");
12+
13+
SELECT * FROM test;
14+
15+
ADMIN FLUSH_TABLE('test');
16+
17+
-- No fulltext index yet
18+
SELECT index_size FROM INFORMATION_SCHEMA.REGION_STATISTICS;
19+
20+
ALTER TABLE test MODIFY COLUMN msg SET FULLTEXT INDEX;
21+
22+
ADMIN BUILD_INDEX('test');
23+
24+
-- SQLNESS SLEEP 1s
25+
26+
-- Fulltext index built
27+
SELECT index_size FROM INFORMATION_SCHEMA.REGION_STATISTICS;

0 commit comments

Comments
 (0)