More detailed test

This commit is contained in:
Alexander Gololobov 2023-04-13 15:54:03 +02:00
parent 7a381e9232
commit 6854dd064f
2 changed files with 29 additions and 12 deletions

View File

@ -1,5 +1,19 @@
40000
all_1_1_0
all_2_2_0
all_3_3_0
all_4_4_0
-- { echoOn }
SELECT count(), _part FROM 02581_trips GROUP BY _part ORDER BY _part;
10000 all_1_1_0
10000 all_2_2_0
10000 all_3_3_0
10000 all_4_4_0
-- Run mutation with a 'IN big subquery'
ALTER TABLE 02581_trips UPDATE description='1' WHERE id IN (SELECT (number*10+1)::UInt32 FROM numbers(10000000)) SETTINGS mutations_sync=2;
SELECT count(), _part FROM 02581_trips WHERE description = '' GROUP BY _part ORDER BY _part;
9000 all_1_1_0_5
9000 all_2_2_0_5
9000 all_3_3_0_5
9000 all_4_4_0_5
ALTER TABLE 02581_trips UPDATE description='2' WHERE id IN (SELECT (number*10+2)::UInt32 FROM numbers(10000)) SETTINGS mutations_sync=2;
SELECT count(), _part FROM 02581_trips WHERE description = '' GROUP BY _part ORDER BY _part;
8000 all_1_1_0_6
8000 all_2_2_0_6
8000 all_3_3_0_6
8000 all_4_4_0_6

View File

@ -4,15 +4,18 @@ CREATE TABLE 02581_trips(id UInt32, description String) ENGINE=MergeTree ORDER B
-- Make multiple parts
INSERT INTO 02581_trips SELECT number, '' FROM numbers(10000);
INSERT INTO 02581_trips SELECT number+10000000, '' FROM numbers(10000);
INSERT INTO 02581_trips SELECT number+20000000, '' FROM numbers(10000);
INSERT INTO 02581_trips SELECT number+30000000, '' FROM numbers(10000);
INSERT INTO 02581_trips SELECT number+10000, '' FROM numbers(10000);
INSERT INTO 02581_trips SELECT number+20000, '' FROM numbers(10000);
INSERT INTO 02581_trips SELECT number+30000, '' FROM numbers(10000);
SELECT count() from 02581_trips;
SELECT name FROM system.parts WHERE database=currentDatabase() AND table = '02581_trips' AND active ORDER BY name;
-- { echoOn }
SELECT count(), _part FROM 02581_trips GROUP BY _part ORDER BY _part;
-- Run mutation with a 'IN big subquery'
ALTER TABLE 02581_trips UPDATE description='' WHERE id IN (SELECT (number+5)::UInt32 FROM numbers(10000000)) SETTINGS mutations_sync=2;
ALTER TABLE 02581_trips UPDATE description='1' WHERE id IN (SELECT (number*10+1)::UInt32 FROM numbers(10000000)) SETTINGS mutations_sync=2;
SELECT count(), _part FROM 02581_trips WHERE description = '' GROUP BY _part ORDER BY _part;
ALTER TABLE 02581_trips UPDATE description='2' WHERE id IN (SELECT (number*10+2)::UInt32 FROM numbers(10000)) SETTINGS mutations_sync=2;
SELECT count(), _part FROM 02581_trips WHERE description = '' GROUP BY _part ORDER BY _part;
-- { echoOff }
DROP TABLE 02581_trips;