gpt4 book ai didi

sql - 在加载大量数据之前删除索引然后重新创建索引是否更有效?

转载 作者:行者123 更新时间:2023-12-05 01:11:53 24 4
gpt4 key购买 nike

我从书中读到这些句子Use The Index

Nevertheless, the performance without indexes is so good that it can make sense to temporarily drop all indexes while loading large amounts of data—provided the indexes are not needed by any other SQL statements in the meantime. This can unleash a dramatic speed-up which is visible in the chart and is, in fact, a common practimce in data warehouses.



我可以理解在数据插入后创建索引 空表是更有效的方式。然而,虽然向索引表插入数据较慢,但我认为重新创建索引也非常昂贵。

所以我的问题是,当插入前表中已经存在大量行时,它是否也会更快?如果是,新行的比例是多少合适?如何定义“大”?

最佳答案

这取决于。唯一确定的方法是使用您的(测试)数据和您的(测试)环境进行尝试。

关于sql - 在加载大量数据之前删除索引然后重新创建索引是否更有效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22831208/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com