建SDB数据表
1.两张表均采用多维分区模式(水平+垂直)
2.创建的数据表中一张是snappy压缩,另一张必须是lzw压缩

创建域
# 创建工作空间
var db = new Sdb()
# 创建域domain1,
有三个组(group1,group2,group3)
db.createDomain("domain1",
["group1","group2","group3"],{AutoSplit:true})
# 查看域
db.listDomains()
创建数据库
# 创建数据库所在域为domain1
db.createCS("mytest",{Domain:"domain1"})
db.createCS("mytest2",{Domain:"domain1"})
# 查看数据库及表
db.list(4)
学生信息表(使用snappy格式存储)
# 创建表student,主键为sid,存储格式为snappy
db.mytest.createCL("student",{ShardingKey:{sid:1},CompressionType:"snappy"})
# 查看表快照
db.snapshot(8,{Name:"mytest.student"})
# 创建主表
db.mytest2.createCL("student",{IsMainCL:true, ShardingKey:{sid:1},ShardingType:"range",CompressionType:"snappy"})
# 查看表快照
db.snapshot(8,{Name:"mytest.class"})
# 创建子表
db.mytest2.createCL("stu1",{ShardingType:"hash",ShardingKey:{sid:1}})
db.mytest2.createCL("stu2",{ShardingType:"hash",ShardingKey:{sid:1}})
db.mytest2.createCL("stu3",{ShardingType:"hash",ShardingKey:{sid:1}})
# 加载子表
db.mytest2.student.attachCL("mytest2.stu1",{LowBound:{sid:1},UpBound:{sid:501}})
db.mytest2.student.attachCL("mytest2.stu2",{LowBound:{sid:501},UpBound:{sid:1001}})
db.mytest2.student.attachCL("mytest2.stu3",{LowBound:{sid:1001},UpBound:{sid:1501}})
班级成绩表(使用lzw格式存储)
#创建表class,主键为cid,存储格式为lzw
db.mytest.createCL("class",{ShardingKey:{cid:1},CompressionType:"lzw"})
# 查看表快照
db.snapshot(8,{Name:"mytest.class"})
# 创建主表
db.mytest2.createCL("class",{IsMainCL:true, ShardingKey:{cid:1},ShardingType:"range",CompressionType:"lzw"})
# 创建子表
db.mytest2.createCL("class1",{ShardingType:"hash",ShardingKey:{cid:1}})
db.mytest2.createCL("class2",{ShardingType:"hash",ShardingKey:{cid:1}})
db.mytest2.createCL("class3",{ShardingType:"hash",ShardingKey:{cid:
# 加载子表
db.mytest2.class.attachCL("mytest2.class1",{LowBound:{sid:1},UpBound:{cid:31}})
db.mytest2.class.attachCL("mytest2.class2",{LowBound:{sid:31},UpBound:{cid:71}})
db.mytest2.class.attachCL("mytest2.class3",{LowBound:{sid:71},UpBound:{cid:111}})
# 查看表快照
db.snapshot(8,{Name:"mytest2.class"})