为什么在Memsql中创建索引需要这么长时间?

时间:2016-08-30 06:17:37

标签: memsql

在20c / 40t 256gb服务器上的~500m窄行的分布式表上创建索引需要花费很多时间,而在我的生活中,我无法理解为什么。

alter table users_userlocation add index date3 (date, user_id);

<style> .item-wrap { position: relative; height: 200px; width: 200px; background-color: black; overflow: hidden; } .item-wrap p { color: #fff; text-align: center; } .item-wrap::before { content: ' '; position: absolute; left: 0; top: 0; width: 0; height: 100%; opacity: 0.5; -webkit-transition: width 0s ease, background-color 0.5s ease; -moz-transition: width 0s ease, background-color 0.5s ease; -o-transition: width 0s ease, background-color 0.5s ease; transition: width 0s ease, background-color 0.5s ease; } .item-wrap::after { content: ' '; position: absolute; right: 0; top: 0; width: 0; height: 100%; opacity: 0.5; background-color: #fff; transition: width 0.5s ease; -webkit-transition: width 0.5s ease; -moz-transition: width 0.5s ease; -ms-transition: width 0.5s ease; -o-transition: width 0.5s ease; } .item-wrap:hover::before { width: 100%; background-color: #fff; transition: width 0.5s ease; -webkit-transition: width 0.5s ease; -moz-transition: width 0.5s ease; -ms-transition: width 0.5s ease; -o-transition: width 0.5s ease; } .item-wrap:hover::after { width: 100%; background-color: transparent; transition: all 0s ease; -webkit-transition: all 0s ease; -moz-transition: all 0s ease; -ms-transition: all 0s ease; -o-transition: all 0s ease; } .item-wrap:hover .cover { bottom: 0; } .cover a { color: #fff; } .link1 { position: absolute; left: 20px; top: 50%; right: 20px; } .link2 { position: absolute; top: 50%; right: 20px; } .item-wrap .cover { position: absolute; right: 0; left: 0; bottom: -100%; width: 100%; height: 100%; transition: bottom 0.3s linear; -webkit-transition: bottom 0.3s linear; -moz-transition: bottom 0.3s linear; -ms-transition: bottom 0.3s linear; -o-transition: bottom 0.3s linear; z-index: 10; } </style> <div class="item"> <div class="item-wrap"> <p>Main content blah blah</p> <div class="cover"> <a href="#" class="link1" data-toggle="modal" data-target="#myModal">Link1</a> <a href="#" class="link2" data-toggle="modal" data-target="#myModal">Link2</a> </div><!-- /.cover --> </div><!-- /.item-wrap --> </div><!-- /.item --> <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> ... </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div>

截至本文,上述情况已经持续了6.5个小时。

1 个答案:

答案 0 :(得分:2)

在MemSQL中,索引构建是一个相当慢的操作。通常每个核心每秒转换大约10到2万行。它取决于您添加的表或索引的特征(具有较少索引的表上的瘦行将更快)。索引构建应该对运行的工作负载(一些CPU使用)产生最小的影响。如果您可以共享SHOW CREATE TABLE和CREATE INDEX语句,我可以检查您是否看到异常。