安装好后
创建集合(也就是表)
sdb
var db = new Sdb("localhost", 11810);
db.createDomain("company_domains", [ "group1", "group2", "group3" ], { AutoSplit: true } );
db.createCS("company", { Domain: "company_domains" } );
db.company.createCL("employee", { "ShardingKey": { "_id": 1}, "ShardingType": "hash", "ReplSize": -1, "Compressed": true, "CompressionType": "lzw", "AutoSplit": true, "EnsureShardingIndex": false });
创建索引,看执行计划
sdb
var db = new Sdb("localhost", 11810);
db.company.employee.createIndex("idx_ename", { ename: 1 }, false);
db.company.employee.find( { "ename": { "$et": "Georgi" } } ).explain();
阅读(1918) | 评论(0) | 转发(0) |