Commit e5678c3f authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-13904: rocksdb.add_index_inplace_sstfilewriter timed out

Downscale rocksdb.add_index_inplace_sstfilewriter to be 10x smaller
parent 34188ac4
drop table if exists t1; drop table if exists t1;
CREATE TABLE t1(pk CHAR(5) PRIMARY KEY, a char(30), b char(30)) COLLATE 'latin1_bin'; CREATE TABLE t1(pk CHAR(5) PRIMARY KEY, a char(30), b char(30)) COLLATE 'latin1_bin';
set rocksdb_bulk_load=1; set rocksdb_bulk_load=1;
set rocksdb_bulk_load_size=100000; set rocksdb_bulk_load_size=10000;
LOAD DATA INFILE <input_file> INTO TABLE t1; LOAD DATA INFILE <input_file> INTO TABLE t1;
set rocksdb_bulk_load=0; set rocksdb_bulk_load=0;
select count(pk) from t1; select count(pk) from t1;
count(pk) count(pk)
3000000 300000
select count(a) from t1; select count(a) from t1;
count(a) count(a)
3000000 300000
select count(b) from t1; select count(b) from t1;
count(b) count(b)
3000000 300000
ALTER TABLE t1 ADD INDEX kb(b), ALGORITHM=INPLACE; ALTER TABLE t1 ADD INDEX kb(b), ALGORITHM=INPLACE;
ALTER TABLE t1 ADD INDEX kb_copy(b), ALGORITHM=COPY; ALTER TABLE t1 ADD INDEX kb_copy(b), ALGORITHM=COPY;
SELECT COUNT(*) as c FROM SELECT COUNT(*) as c FROM
...@@ -25,22 +25,22 @@ c ...@@ -25,22 +25,22 @@ c
1 1
select count(*) from t1 FORCE INDEX(kb); select count(*) from t1 FORCE INDEX(kb);
count(*) count(*)
3000000 300000
select count(*) from t1 FORCE INDEX(kb_copy); select count(*) from t1 FORCE INDEX(kb_copy);
count(*) count(*)
3000000 300000
select count(*) from t1 FORCE INDEX(PRIMARY); select count(*) from t1 FORCE INDEX(PRIMARY);
count(*) count(*)
3000000 300000
ALTER TABLE t1 DROP INDEX kb, ALGORITHM=INPLACE; ALTER TABLE t1 DROP INDEX kb, ALGORITHM=INPLACE;
ALTER TABLE t1 DROP INDEX kb_copy, ALGORITHM=INPLACE; ALTER TABLE t1 DROP INDEX kb_copy, ALGORITHM=INPLACE;
ALTER TABLE t1 ADD INDEX kb(b), ADD INDEX kab(a,b), ALGORITHM=INPLACE; ALTER TABLE t1 ADD INDEX kb(b), ADD INDEX kab(a,b), ALGORITHM=INPLACE;
SELECT COUNT(*) FROM t1 FORCE INDEX(kab); SELECT COUNT(*) FROM t1 FORCE INDEX(kab);
COUNT(*) COUNT(*)
3000000 300000
SELECT COUNT(*) FROM t1 FORCE INDEX(kb); SELECT COUNT(*) FROM t1 FORCE INDEX(kb);
COUNT(*) COUNT(*)
3000000 300000
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -19,7 +19,7 @@ CREATE TABLE t1(pk CHAR(5) PRIMARY KEY, a char(30), b char(30)) COLLATE 'latin1_ ...@@ -19,7 +19,7 @@ CREATE TABLE t1(pk CHAR(5) PRIMARY KEY, a char(30), b char(30)) COLLATE 'latin1_
perl; perl;
my $fn = $ENV{'ROCKSDB_INFILE'}; my $fn = $ENV{'ROCKSDB_INFILE'};
open(my $fh, '>>', $fn) || die "perl open($fn): $!"; open(my $fh, '>>', $fn) || die "perl open($fn): $!";
my $max = 3000000; my $max = 300000;
my @chars = ("A".."Z", "a".."z", "0".."9"); my @chars = ("A".."Z", "a".."z", "0".."9");
my @lowerchars = ("a".."z"); my @lowerchars = ("a".."z");
my @powers_of_26 = (26 * 26 * 26 * 26, 26 * 26 * 26, 26 * 26, 26, 1); my @powers_of_26 = (26 * 26 * 26 * 26, 26 * 26 * 26, 26 * 26, 26, 1);
...@@ -48,7 +48,7 @@ EOF ...@@ -48,7 +48,7 @@ EOF
--file_exists $file --file_exists $file
set rocksdb_bulk_load=1; set rocksdb_bulk_load=1;
set rocksdb_bulk_load_size=100000; set rocksdb_bulk_load_size=10000;
--disable_query_log --disable_query_log
--echo LOAD DATA INFILE <input_file> INTO TABLE t1; --echo LOAD DATA INFILE <input_file> INTO TABLE t1;
eval LOAD DATA INFILE '$file' INTO TABLE t1; eval LOAD DATA INFILE '$file' INTO TABLE t1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment