mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
b21cf962e3
myisam_max_extra_sort_file_size is depricated Ensure that myisam_data_pointer_size is honoured when creating new MyISAM files Changed default value of myisam_data_pointer_size from 4 to 6 to get rid of 'table-is-full' errors include/myisam.h: Change type of myisam_block_size and myisam_concurrent_insert to make them changeable in mysqld.cc Removed not used varaible myisam_max_extra_temp_length include/thr_lock.h: Added extra parameter to get_status myisam/mi_create.c: Ensure that myisam_data_pointer_size is honoured myisam/mi_dynrec.c: If 'append_insert_at_end' is set, only write at end of myisam record file myisam/mi_locking.c: Add extra argument to 'mi_get_status' to allow thr_lock to signal that we want to do a concurrent insert If this is used, we will append new insert rows at end of data file. Change mi_check_status() to allow concurrent_inserts even if there are holes in the file when myisam_concurent_insert=2 myisam/mi_static.c: Change behavior of myisam_concurrent_insert so that setting this to 2 allows inserts even if there is a hole in the data file. Default value is 2 for MyISAM direct usage but will be set to 1 (old default) by mysqld.cc myisam/mi_statrec.c: If 'append_insert_at_end' is set, only write at end of myisam record file myisam/mi_write.c: If 'append_insert_at_end' is set, only write at end of myisam record file myisam/myisamdef.h: Support for insert-at-end even if there is holes in data file mysql-test/r/gis-rtree.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/r/group_min_max.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/r/index_merge.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/r/index_merge_ror.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/r/merge.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/r/myisam.result: Test of concurrent_insert=2 mysql-test/r/null.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/r/preload.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/r/ps_1general.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/r/range.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/r/variables.result: concurrent_insert is now a integer, not a boolean myisam_extra_sort_file_size is deleted mysql-test/r/view.result: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/t/index_merge.test: Test result changed because default value for myisam_data_pointer_size is changed from 4 -> 6 mysql-test/t/myisam.test: Test of concurrent_insert=2 mysql-test/t/ps_1general.test: Drop test table mysql-test/t/variables.test: concurrent_insert is now a integer, not a boolean myisam_extra_sort_file_size is deleted mysql-test/t/view.test: Drop tables that may be left from previous tests mysys/thr_lock.c: Extra paramter to get_status to signal if concurrent_insert was used sql/mysqld.cc: concurrent-insert can now be set to 2 for concurrent inserts when there is holes in the data file myisam_max_extra_sort_file_size is depricated sql/set_var.cc: concurrent-insert is now an integer, not a bool myisam_max_extra_sort_file_size is deleted
196 lines
12 KiB
Text
196 lines
12 KiB
Text
drop table if exists t0,t1,t2;
|
|
select count(*) from t1;
|
|
count(*)
|
|
64801
|
|
explain select key1,key2 from t1 where key1=100 and key2=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 58 Using intersect(key1,key2); Using where; Using index
|
|
select key1,key2 from t1 where key1=100 and key2=100;
|
|
key1 key2
|
|
100 100
|
|
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 154 Using union(intersect(key1,key2),intersect(key3,key4)); Using where
|
|
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
key1 key2 key3 key4 filler1
|
|
100 100 100 100 key1-key2-key3-key4
|
|
insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, -1, -1, 'key1-key2');
|
|
insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, 100, 100, 'key4-key3');
|
|
explain select key1,key2,filler1 from t1 where key1=100 and key2=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 58 Using intersect(key1,key2); Using where
|
|
select key1,key2,filler1 from t1 where key1=100 and key2=100;
|
|
key1 key2 filler1
|
|
100 100 key1-key2-key3-key4
|
|
100 100 key1-key2
|
|
explain select key1,key2 from t1 where key1=100 and key2=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 58 Using intersect(key1,key2); Using where; Using index
|
|
select key1,key2 from t1 where key1=100 and key2=100;
|
|
key1 key2
|
|
100 100
|
|
100 100
|
|
explain select key1,key2,key3,key4 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 154 Using union(intersect(key1,key2),intersect(key3,key4)); Using where
|
|
select key1,key2,key3,key4 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
key1 key2 key3 key4
|
|
100 100 100 100
|
|
100 100 -1 -1
|
|
-1 -1 100 100
|
|
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 154 Using union(intersect(key1,key2),intersect(key3,key4)); Using where
|
|
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
key1 key2 key3 key4 filler1
|
|
100 100 100 100 key1-key2-key3-key4
|
|
100 100 -1 -1 key1-key2
|
|
-1 -1 100 100 key4-key3
|
|
explain select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3 key1,key2,key3 5,5,5 NULL 2 Using intersect(key1,key2,key3); Using where; Using index
|
|
select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100;
|
|
key1 key2 key3
|
|
100 100 100
|
|
insert into t1 (key1,key2,key3,key4,filler1) values (101,101,101,101, 'key1234-101');
|
|
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=101;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3 key1,key2,key3 5,5,5 NULL 83 Using union(intersect(key1,key2),key3); Using where
|
|
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=101;
|
|
key1 key2 key3 key4 filler1
|
|
100 100 100 100 key1-key2-key3-key4
|
|
100 100 -1 -1 key1-key2
|
|
101 101 101 101 key1234-101
|
|
select key1,key2, filler1 from t1 where key1=100 and key2=100;
|
|
key1 key2 filler1
|
|
100 100 key1-key2-key3-key4
|
|
100 100 key1-key2
|
|
update t1 set filler1='to be deleted' where key1=100 and key2=100;
|
|
update t1 set key1=200,key2=200 where key1=100 and key2=100;
|
|
delete from t1 where key1=200 and key2=200;
|
|
select key1,key2,filler1 from t1 where key2=100 and key2=200;
|
|
key1 key2 filler1
|
|
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 152 Using union(intersect(key1,key2),intersect(key3,key4)); Using where
|
|
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
key1 key2 key3 key4 filler1
|
|
-1 -1 100 100 key4-key3
|
|
delete from t1 where key3=100 and key4=100;
|
|
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 152 Using union(intersect(key1,key2),intersect(key3,key4)); Using where
|
|
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
|
|
key1 key2 key3 key4 filler1
|
|
explain select key1,key2 from t1 where key1=100 and key2=100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 57 Using intersect(key1,key2); Using where; Using index
|
|
select key1,key2 from t1 where key1=100 and key2=100;
|
|
key1 key2
|
|
insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, 200, 200,'key1-key2-key3-key4-1');
|
|
insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, 200, 200,'key1-key2-key3-key4-2');
|
|
insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, 200, 200,'key1-key2-key3-key4-3');
|
|
explain select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3,key4 key3,key1,key2,key4 5,5,5,5 NULL 136 Using union(key3,intersect(key1,key2),key4); Using where
|
|
select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
|
|
key1 key2 key3 key4 filler1
|
|
100 100 200 200 key1-key2-key3-key4-3
|
|
100 100 200 200 key1-key2-key3-key4-2
|
|
100 100 200 200 key1-key2-key3-key4-1
|
|
insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, -1, 200,'key4');
|
|
explain select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3,key4 key3,key1,key2,key4 5,5,5,5 NULL 146 Using union(key3,intersect(key1,key2),key4); Using where
|
|
select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
|
|
key1 key2 key3 key4 filler1
|
|
100 100 200 200 key1-key2-key3-key4-3
|
|
100 100 200 200 key1-key2-key3-key4-2
|
|
100 100 200 200 key1-key2-key3-key4-1
|
|
-1 -1 -1 200 key4
|
|
insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, 200, -1,'key3');
|
|
explain select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge key1,key2,key3,key4 key3,key1,key2,key4 5,5,5,5 NULL 156 Using union(key3,intersect(key1,key2),key4); Using where
|
|
select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
|
|
key1 key2 key3 key4 filler1
|
|
100 100 200 200 key1-key2-key3-key4-3
|
|
100 100 200 200 key1-key2-key3-key4-2
|
|
100 100 200 200 key1-key2-key3-key4-1
|
|
-1 -1 -1 200 key4
|
|
-1 -1 200 -1 key3
|
|
explain select * from t1 where st_a=1 and st_b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a,stb_swt1a_2b,stb_swt1b,st_b st_a,st_b 4,4 NULL 2637 Using intersect(st_a,st_b); Using where
|
|
explain select st_a,st_b from t1 where st_a=1 and st_b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a,stb_swt1a_2b,stb_swt1b,st_b st_a,st_b 4,4 NULL 2637 Using intersect(st_a,st_b); Using where; Using index
|
|
explain select st_a from t1 ignore index (st_a) where st_a=1 and st_b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 ref sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,stb_swt1a_2b,stb_swt1b,st_b st_b 4 const 15093 Using where
|
|
explain select * from t1 where st_a=1 and swt1a=1 and swt2a=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 ref sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a sta_swt21a 12 const,const,const 971
|
|
explain select * from t1 where st_b=1 and swt1b=1 and swt2b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 ref stb_swt1a_2b,stb_swt1b,st_b stb_swt1a_2b 8 const,const 3879 Using where
|
|
explain select * from t1 where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a,stb_swt1a_2b,stb_swt1b,st_b sta_swt12a,stb_swt1a_2b 12,12 NULL 44 Using intersect(sta_swt12a,stb_swt1a_2b); Using where
|
|
explain select * from t1 ignore index (sta_swt21a, stb_swt1a_2b)
|
|
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,st_a,stb_swt1b,st_b sta_swt12a,stb_swt1b 12,8 NULL 44 Using intersect(sta_swt12a,stb_swt1b); Using where
|
|
explain select * from t1 ignore index (sta_swt21a, sta_swt12a, stb_swt1a_2b)
|
|
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt1a,sta_swt2a,st_a,stb_swt1b,st_b sta_swt1a,sta_swt2a,stb_swt1b 8,8,8 NULL 43 Using intersect(sta_swt1a,sta_swt2a,stb_swt1b); Using where
|
|
explain select * from t1 ignore index (sta_swt21a, sta_swt12a, stb_swt1a_2b, stb_swt1b)
|
|
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt1a,sta_swt2a,st_a,st_b sta_swt1a,sta_swt2a,st_b 8,8,4 NULL 168 Using intersect(sta_swt1a,sta_swt2a,st_b); Using where
|
|
explain select * from t1
|
|
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a,stb_swt1a_2b,stb_swt1b,st_b sta_swt12a,stb_swt1a_2b 12,12 NULL 44 Using intersect(sta_swt12a,stb_swt1a_2b); Using where
|
|
explain select * from t1
|
|
where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a,stb_swt1a_2b,stb_swt1b,st_b sta_swt1a,stb_swt1b 8,8 NULL 174 Using intersect(sta_swt1a,stb_swt1b); Using where
|
|
explain select st_a from t1
|
|
where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a,stb_swt1a_2b,stb_swt1b,st_b sta_swt1a,stb_swt1b 8,8 NULL 174 Using intersect(sta_swt1a,stb_swt1b); Using where; Using index
|
|
explain select st_a from t1
|
|
where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a,stb_swt1a_2b,stb_swt1b,st_b sta_swt1a,stb_swt1b 8,8 NULL 174 Using intersect(sta_swt1a,stb_swt1b); Using where; Using index
|
|
drop table t0,t1;
|
|
create table t2 (
|
|
a char(10),
|
|
b char(10),
|
|
filler1 char(255),
|
|
filler2 char(255),
|
|
key(a(5)),
|
|
key(b(5))
|
|
);
|
|
select count(a) from t2 where a='BBBBBBBB';
|
|
count(a)
|
|
4
|
|
select count(a) from t2 where b='BBBBBBBB';
|
|
count(a)
|
|
4
|
|
expla_or_bin select count(a_or_b) from t2 where a_or_b='AAAAAAAA' a_or_bnd a_or_b='AAAAAAAA';
|
|
id select_type ta_or_ba_or_ble type possia_or_ble_keys key key_len ref rows Extra_or_b
|
|
1 SIMPLE t2 ref a_or_b,a_or_b a_or_b 6 const 4 Using where
|
|
select count(a) from t2 where a='AAAAAAAA' and b='AAAAAAAA';
|
|
count(a)
|
|
4
|
|
select count(a) from t2 ignore index(a,b) where a='AAAAAAAA' and b='AAAAAAAA';
|
|
count(a)
|
|
4
|
|
insert into t2 values ('ab', 'ab', 'uh', 'oh');
|
|
explain select a from t2 where a='ab';
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t2 ref a a 6 const 1 Using where
|
|
drop table t2;
|