Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b45bb3ed
Commit
b45bb3ed
authored
May 06, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test cardinality with add/drop key
parent
64d329d0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
189 additions
and
0 deletions
+189
-0
mysql-test/suite/tokudb/r/card_add_index.result
mysql-test/suite/tokudb/r/card_add_index.result
+45
-0
mysql-test/suite/tokudb/r/card_drop_index.result
mysql-test/suite/tokudb/r/card_drop_index.result
+30
-0
mysql-test/suite/tokudb/r/card_drop_pk.result
mysql-test/suite/tokudb/r/card_drop_pk.result
+27
-0
mysql-test/suite/tokudb/t/card_add_index.test
mysql-test/suite/tokudb/t/card_add_index.test
+33
-0
mysql-test/suite/tokudb/t/card_drop_index.test
mysql-test/suite/tokudb/t/card_drop_index.test
+29
-0
mysql-test/suite/tokudb/t/card_drop_pk.test
mysql-test/suite/tokudb/t/card_drop_pk.test
+25
-0
No files found.
mysql-test/suite/tokudb/r/card_add_index.result
0 → 100644
View file @
b45bb3ed
drop table if exists tt;
create table tt (a int, b int, c int, primary key(a));
insert into tt values (1,0,0),(2,0,0),(3,0,1),(4,0,1);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
alter table tt add key (b);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 b 1 b A NULL NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 b 1 b A 1 NULL NULL YES BTREE
alter table tt add key (c);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 b 1 b A 1 NULL NULL YES BTREE
tt 1 c 1 c A NULL NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 b 1 b A 1 NULL NULL YES BTREE
tt 1 c 1 c A 2 NULL NULL YES BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 b 1 b A 1 NULL NULL YES BTREE
tt 1 c 1 c A 2 NULL NULL YES BTREE
drop table tt;
mysql-test/suite/tokudb/r/card_drop_index.result
0 → 100644
View file @
b45bb3ed
drop table if exists tt;
create table tt (a int, b int, c int, key(b), key(c), primary key(a));
insert into tt values (1,0,0),(2,0,0),(3,0,1),(4,0,1);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 b 1 b A NULL NULL NULL YES BTREE
tt 1 c 1 c A NULL NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 b 1 b A 1 NULL NULL YES BTREE
tt 1 c 1 c A 2 NULL NULL YES BTREE
alter table tt drop key b;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 c 1 c A 2 NULL NULL YES BTREE
alter table tt drop key c;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
drop table tt;
mysql-test/suite/tokudb/r/card_drop_pk.result
0 → 100644
View file @
b45bb3ed
drop table if exists tt;
create table tt (a int, b int, c int, key(b), key(c), primary key(a));
insert into tt values (1,0,0),(2,0,0),(3,0,1),(4,0,1);
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 b 1 b A NULL NULL NULL YES BTREE
tt 1 c 1 c A NULL NULL NULL YES BTREE
analyze table tt;
Table Op Msg_type Msg_text
test.tt analyze status OK
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 0 PRIMARY 1 a A 4 NULL NULL BTREE
tt 1 b 1 b A 1 NULL NULL YES BTREE
tt 1 c 1 c A 2 NULL NULL YES BTREE
alter table tt drop primary key;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 1 b 1 b A NULL NULL NULL YES BTREE
tt 1 c 1 c A NULL NULL NULL YES BTREE
flush tables;
show indexes from tt;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tt 1 b 1 b A NULL NULL NULL YES BTREE
tt 1 c 1 c A NULL NULL NULL YES BTREE
drop table tt;
mysql-test/suite/tokudb/t/card_add_index.test
0 → 100644
View file @
b45bb3ed
# test that add index keeps cardinality for older indexes
source
include
/
have_tokudb
.
inc
;
disable_warnings
;
drop
table
if
exists
tt
;
enable_warnings
;
create
table
tt
(
a
int
,
b
int
,
c
int
,
primary
key
(
a
));
insert
into
tt
values
(
1
,
0
,
0
),(
2
,
0
,
0
),(
3
,
0
,
1
),(
4
,
0
,
1
);
# test that analyze computes the correct cardinality for the PK
show
indexes
from
tt
;
analyze
table
tt
;
show
indexes
from
tt
;
# add a key(b)
alter
table
tt
add
key
(
b
);
show
indexes
from
tt
;
analyze
table
tt
;
show
indexes
from
tt
;
# add a key(c)
alter
table
tt
add
key
(
c
);
show
indexes
from
tt
;
analyze
table
tt
;
show
indexes
from
tt
;
# test that cardinality is persistent
flush
tables
;
show
indexes
from
tt
;
drop
table
tt
;
mysql-test/suite/tokudb/t/card_drop_index.test
0 → 100644
View file @
b45bb3ed
# test that add index keeps cardinality for older indexes
source
include
/
have_tokudb
.
inc
;
disable_warnings
;
drop
table
if
exists
tt
;
enable_warnings
;
create
table
tt
(
a
int
,
b
int
,
c
int
,
key
(
b
),
key
(
c
),
primary
key
(
a
));
insert
into
tt
values
(
1
,
0
,
0
),(
2
,
0
,
0
),(
3
,
0
,
1
),(
4
,
0
,
1
);
# compute cardinality
show
indexes
from
tt
;
analyze
table
tt
;
show
indexes
from
tt
;
# drop key b
alter
table
tt
drop
key
b
;
show
indexes
from
tt
;
# drop key c
alter
table
tt
drop
key
c
;
show
indexes
from
tt
;
# test that cardinality is persistent
flush
tables
;
show
indexes
from
tt
;
drop
table
tt
;
mysql-test/suite/tokudb/t/card_drop_pk.test
0 → 100644
View file @
b45bb3ed
# test that add index keeps cardinality for older indexes
source
include
/
have_tokudb
.
inc
;
disable_warnings
;
drop
table
if
exists
tt
;
enable_warnings
;
create
table
tt
(
a
int
,
b
int
,
c
int
,
key
(
b
),
key
(
c
),
primary
key
(
a
));
insert
into
tt
values
(
1
,
0
,
0
),(
2
,
0
,
0
),(
3
,
0
,
1
),(
4
,
0
,
1
);
# compute cardinality
show
indexes
from
tt
;
analyze
table
tt
;
show
indexes
from
tt
;
# drop key a
alter
table
tt
drop
primary
key
;
show
indexes
from
tt
;
# test that cardinality is persistent
flush
tables
;
show
indexes
from
tt
;
drop
table
tt
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment