Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
e8893240
Commit
e8893240
authored
13 years ago
by
Aleksey Demakov
Browse files
Options
Downloads
Patches
Plain Diff
Add test for tree-index-optimization
parent
9fce1d63
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/box_big/tarantool.cfg
+59
-0
59 additions, 0 deletions
test/box_big/tarantool.cfg
test/box_big/tree_variants.result
+79
-0
79 additions, 0 deletions
test/box_big/tree_variants.result
test/box_big/tree_variants.test
+31
-0
31 additions, 0 deletions
test/box_big/tree_variants.test
with
169 additions
and
0 deletions
test/box_big/tarantool.cfg
+
59
−
0
View file @
e8893240
...
...
@@ -65,3 +65,62 @@ space[5].index[1].key_field[0].fieldno = 1
space
[5]
.index
[1]
.key_field
[0]
.type
=
"STR"
space
[5]
.index
[1]
.key_field
[1]
.fieldno
=
2
space
[5]
.index
[1]
.key_field
[1]
.type
=
"STR"
#
# Tree index variants
#
# Tuple fields:
#
# 0: NUM, 1: NUM64, 2: NUM64, 3: STR, 4: STR, 5: STR, 6: STR, 7: *, 8: NUM
#
space
[6]
.enabled
=
1
space
[6]
.index
[0]
.type
=
"TREE"
space
[6]
.index
[0]
.unique
=
1
space
[6]
.index
[0]
.key_field
[0]
.fieldno
=
0
space
[6]
.index
[0]
.key_field
[0]
.type
=
"NUM"
space
[6]
.index
[1]
.type
=
"TREE"
space
[6]
.index
[1]
.unique
=
1
space
[6]
.index
[1]
.key_field
[0]
.fieldno
=
1
space
[6]
.index
[1]
.key_field
[0]
.type
=
"NUM64"
space
[6]
.index
[2]
.type
=
"TREE"
space
[6]
.index
[2]
.unique
=
0
space
[6]
.index
[2]
.key_field
[0]
.fieldno
=
2
space
[6]
.index
[2]
.key_field
[0]
.type
=
"NUM64"
space
[6]
.index
[3]
.type
=
"TREE"
space
[6]
.index
[3]
.unique
=
0
space
[6]
.index
[3]
.key_field
[0]
.fieldno
=
3
space
[6]
.index
[3]
.key_field
[0]
.type
=
"STR"
space
[6]
.index
[3]
.key_field
[1]
.fieldno
=
4
space
[6]
.index
[3]
.key_field
[1]
.type
=
"STR"
space
[6]
.index
[4]
.type
=
"TREE"
space
[6]
.index
[4]
.unique
=
0
space
[6]
.index
[4]
.key_field
[0]
.fieldno
=
6
space
[6]
.index
[4]
.key_field
[0]
.type
=
"STR"
space
[6]
.index
[4]
.key_field
[1]
.fieldno
=
5
space
[6]
.index
[4]
.key_field
[1]
.type
=
"STR"
space
[6]
.index
[5]
.type
=
"TREE"
space
[6]
.index
[5]
.unique
=
0
space
[6]
.index
[5]
.key_field
[0]
.fieldno
=
8
space
[6]
.index
[5]
.key_field
[0]
.type
=
"NUM"
space
[6]
.index
[6]
.type
=
"TREE"
space
[6]
.index
[6]
.unique
=
1
space
[6]
.index
[6]
.key_field
[0]
.fieldno
=
6
space
[6]
.index
[6]
.key_field
[0]
.type
=
"STR"
space
[6]
.index
[6]
.key_field
[1]
.fieldno
=
5
space
[6]
.index
[6]
.key_field
[1]
.type
=
"STR"
space
[6]
.index
[6]
.key_field
[2]
.fieldno
=
3
space
[6]
.index
[6]
.key_field
[2]
.type
=
"STR"
space
[6]
.index
[6]
.key_field
[3]
.fieldno
=
4
space
[6]
.index
[6]
.key_field
[3]
.type
=
"STR"
space
[6]
.index
[6]
.key_field
[4]
.fieldno
=
8
space
[6]
.index
[6]
.key_field
[4]
.type
=
"NUM"
This diff is collapsed.
Click to expand it.
test/box_big/tree_variants.result
0 → 100644
+
79
−
0
View file @
e8893240
insert into t6 values (0, '00000000', '00000100', 'Joe', 'Sixpack', 'Drinks', 'Amstel', 'bar', 2000 )
Insert OK, 1 row affected
insert into t6 values (1, '00000001', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Heineken', 'bar', 2001 )
Insert OK, 1 row affected
insert into t6 values (2, '00000002', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Carlsberg', 'bar', 2002 )
Insert OK, 1 row affected
insert into t6 values (3, '00000003', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Corona Extra', 'bar', 2003 )
Insert OK, 1 row affected
insert into t6 values (4, '00000004', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Stella Artois', 'bar', 2004 )
Insert OK, 1 row affected
insert into t6 values (5, '00000005', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Miller Genuine Draft', 'bar', 2005 )
Insert OK, 1 row affected
insert into t6 values (6, '00000006', '00000400', 'John', 'Smoker', 'Hits', 'A Pipe', 'foo', 2006 )
Insert OK, 1 row affected
insert into t6 values (7, '00000007', '00000400', 'John', 'Smoker', 'Hits', 'A Bong', 'foo', 2007 )
Insert OK, 1 row affected
insert into t6 values (8, '00000008', '00000400', 'John', 'Smoker', 'Rolls', 'A Joint', 'foo', 2008 )
Insert OK, 1 row affected
insert into t6 values (9, '00000009', '00000400', 'John', 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009 )
Insert OK, 1 row affected
select * from t6 where k0 = 1
Found 1 tuple:
[1, '00000001', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Heineken', 'bar', 2001]
select * from t6 where k1 = '00000002'
Found 1 tuple:
[2, '00000002', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Carlsberg', 'bar', 2002]
select * from t6 where k2 = '00000300'
Found 3 tuples:
[3, '00000003', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Corona Extra', 'bar', 2003]
[4, '00000004', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Stella Artois', 'bar', 2004]
[5, '00000005', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Miller Genuine Draft', 'bar', 2005]
lua box.space[6]:select(3, 'Joe', 'Sixpack')
---
- 0: {'00000000', '00000100', 'Joe', 'Sixpack', 'Drinks', 'Amstel', 'bar', 2000}
- 1: {'00000001', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Heineken', 'bar', 2001}
- 2: {'00000002', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Carlsberg', 'bar', 2002}
- 3: {'00000003', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Corona Extra', 'bar', 2003}
- 4: {'00000004', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Stella Artois', 'bar', 2004}
- 5: {'00000005', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Miller Genuine Draft', 'bar', 2005}
...
lua box.space[6]:select(3, 'John')
---
- 6: {'00000006', '00000400', 1852337994, 'Smoker', 1937008968, 'A Pipe', 'foo', 2006}
- 7: {'00000007', '00000400', 1852337994, 'Smoker', 1937008968, 'A Bong', 'foo', 2007}
- 8: {'00000008', '00000400', 1852337994, 'Smoker', 'Rolls', 'A Joint', 'foo', 2008}
- 9: {'00000009', '00000400', 1852337994, 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009}
...
lua box.space[6]:select(4, 'A Pipe')
---
- 6: {'00000006', '00000400', 1852337994, 'Smoker', 1937008968, 'A Pipe', 'foo', 2006}
...
lua box.space[6]:select(4, 'Miller Genuine Draft', 'Drinks')
---
- 5: {'00000005', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Miller Genuine Draft', 'bar', 2005}
...
select * from t6 where k5 = 2007
Found 1 tuple:
[7, '00000007', '00000400', 1852337994, 'Smoker', 1937008968, 'A Bong', 'foo', 2007]
lua box.space[6]:select(6, 'Miller Genuine Draft', 'Drinks')
---
- 5: {'00000005', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Miller Genuine Draft', 'bar', 2005}
...
delete from t6 where k0 = 6
Delete OK, 1 row affected
delete from t6 where k0 = 7
Delete OK, 1 row affected
delete from t6 where k0 = 8
Delete OK, 1 row affected
delete from t6 where k0 = 9
Delete OK, 1 row affected
lua for k,v in box.space[6]:pairs() do print(v) end
---
0: {'00000000', '00000100', 'Joe', 'Sixpack', 'Drinks', 'Amstel', 'bar', 2000}
1: {'00000001', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Heineken', 'bar', 2001}
2: {'00000002', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Carlsberg', 'bar', 2002}
3: {'00000003', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Corona Extra', 'bar', 2003}
4: {'00000004', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Stella Artois', 'bar', 2004}
5: {'00000005', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Miller Genuine Draft', 'bar', 2005}
...
This diff is collapsed.
Click to expand it.
test/box_big/tree_variants.test
0 → 100644
+
31
−
0
View file @
e8893240
# encoding: tarantool
#
exec
sql
"insert into t6 values (0, '00000000', '00000100', 'Joe', 'Sixpack', 'Drinks', 'Amstel', 'bar', 2000 )"
exec
sql
"insert into t6 values (1, '00000001', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Heineken', 'bar', 2001 )"
exec
sql
"insert into t6 values (2, '00000002', '00000200', 'Joe', 'Sixpack', 'Drinks', 'Carlsberg', 'bar', 2002 )"
exec
sql
"insert into t6 values (3, '00000003', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Corona Extra', 'bar', 2003 )"
exec
sql
"insert into t6 values (4, '00000004', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Stella Artois', 'bar', 2004 )"
exec
sql
"insert into t6 values (5, '00000005', '00000300', 'Joe', 'Sixpack', 'Drinks', 'Miller Genuine Draft', 'bar', 2005 )"
exec
sql
"insert into t6 values (6, '00000006', '00000400', 'John', 'Smoker', 'Hits', 'A Pipe', 'foo', 2006 )"
exec
sql
"insert into t6 values (7, '00000007', '00000400', 'John', 'Smoker', 'Hits', 'A Bong', 'foo', 2007 )"
exec
sql
"insert into t6 values (8, '00000008', '00000400', 'John', 'Smoker', 'Rolls', 'A Joint', 'foo', 2008 )"
exec
sql
"insert into t6 values (9, '00000009', '00000400', 'John', 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009 )"
exec
sql
"select * from t6 where k0 = 1"
exec
sql
"select * from t6 where k1 = '00000002'"
exec
sql
"select * from t6 where k2 = '00000300'"
exec
admin
"lua box.space[6]:select(3, 'Joe', 'Sixpack')"
exec
admin
"lua box.space[6]:select(3, 'John')"
exec
admin
"lua box.space[6]:select(4, 'A Pipe')"
exec
admin
"lua box.space[6]:select(4, 'Miller Genuine Draft', 'Drinks')"
exec
sql
"select * from t6 where k5 = 2007"
exec
admin
"lua box.space[6]:select(6, 'Miller Genuine Draft', 'Drinks')"
exec
sql
"delete from t6 where k0 = 6"
exec
sql
"delete from t6 where k0 = 7"
exec
sql
"delete from t6 where k0 = 8"
exec
sql
"delete from t6 where k0 = 9"
exec
admin
"lua for k,v in box.space[6]:pairs() do print(v) end"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment