1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

ndb - wl#2624 re-commit due to bk problem

This commit is contained in:
pekka@mysql.com
2005-09-15 02:33:28 +02:00
parent 44a6b536d2
commit 81d8cc1e84
27 changed files with 1336 additions and 70 deletions

View File

@ -354,5 +354,79 @@ create table t1 (a int, c varchar(10),
primary key using hash (a), index(c)) engine=ndb;
insert into t1 (a, c) values (1,'aaa'),(3,'bbb');
select count(*) from t1 where c<'bbb';
drop table t1;
# -- index statistics --
set autocommit=1;
show session variables like 'ndb_index_stat_%';
set ndb_index_stat_enable = off;
show session variables like 'ndb_index_stat_%';
create table t1 (a int, b int, c varchar(10) not null,
primary key using hash (a), index(b,c)) engine=ndb;
insert into t1 values
(1,10,'aaa'),(2,10,'bbb'),(3,10,'ccc'),
(4,20,'aaa'),(5,20,'bbb'),(6,20,'ccc'),
(7,30,'aaa'),(8,30,'bbb'),(9,30,'ccc');
select count(*) from t1 where b < 10;
select count(*) from t1 where b >= 10 and c >= 'bbb';
select count(*) from t1 where b > 10;
select count(*) from t1 where b <= 20 and c < 'ccc';
select count(*) from t1 where b = 20 and c = 'ccc';
select count(*) from t1 where b > 20;
select count(*) from t1 where b = 30 and c > 'aaa';
select count(*) from t1 where b <= 20;
select count(*) from t1 where b >= 20 and c > 'aaa';
drop table t1;
set ndb_index_stat_enable = on;
set ndb_index_stat_cache_entries = 0;
show session variables like 'ndb_index_stat_%';
create table t1 (a int, b int, c varchar(10) not null,
primary key using hash (a), index(b,c)) engine=ndb;
insert into t1 values
(1,10,'aaa'),(2,10,'bbb'),(3,10,'ccc'),
(4,20,'aaa'),(5,20,'bbb'),(6,20,'ccc'),
(7,30,'aaa'),(8,30,'bbb'),(9,30,'ccc');
select count(*) from t1 where b < 10;
select count(*) from t1 where b >= 10 and c >= 'bbb';
select count(*) from t1 where b > 10;
select count(*) from t1 where b <= 20 and c < 'ccc';
select count(*) from t1 where b = 20 and c = 'ccc';
select count(*) from t1 where b > 20;
select count(*) from t1 where b = 30 and c > 'aaa';
select count(*) from t1 where b <= 20;
select count(*) from t1 where b >= 20 and c > 'aaa';
drop table t1;
set ndb_index_stat_enable = on;
set ndb_index_stat_cache_entries = 4;
set ndb_index_stat_update_freq = 2;
show session variables like 'ndb_index_stat_%';
create table t1 (a int, b int, c varchar(10) not null,
primary key using hash (a), index(b,c)) engine=ndb;
insert into t1 values
(1,10,'aaa'),(2,10,'bbb'),(3,10,'ccc'),
(4,20,'aaa'),(5,20,'bbb'),(6,20,'ccc'),
(7,30,'aaa'),(8,30,'bbb'),(9,30,'ccc');
select count(*) from t1 where b < 10;
select count(*) from t1 where b >= 10 and c >= 'bbb';
select count(*) from t1 where b > 10;
select count(*) from t1 where b <= 20 and c < 'ccc';
select count(*) from t1 where b = 20 and c = 'ccc';
select count(*) from t1 where b > 20;
select count(*) from t1 where b = 30 and c > 'aaa';
select count(*) from t1 where b <= 20;
select count(*) from t1 where b >= 20 and c > 'aaa';
drop table t1;
set ndb_index_stat_enable = @@global.ndb_index_stat_enable;
set ndb_index_stat_cache_entries = @@global.ndb_index_stat_cache_entries;
set ndb_index_stat_update_freq = @@global.ndb_index_stat_update_freq;
show session variables like 'ndb_index_stat_%';
# End of 4.1 tests