技术开发 频道

高效利用DB2优化器更新执行计划

  2.LOAD工具

  Load这个工具是DB2里面一个非常强大的数据迁移工具。一般用作大批量的数据插入。因为Load操作不记日志,所以效率非常好。笔者曾经在RS6000平台上面实现50-60m/s的速度Load数据。在这里我想讨论的是在DB2数据库里面如何用load来影响你的catalog视图的统计信息。

  在Load的时候使用statistics选项可以在装入的过程中生成统计数据,这些统计数据可以供优化器确定最有效的执行sql语句的方式。

  比如:

  对表和索引产生最详细的统计数据:

load from mobile_number.del of del replace into mobile statistics yes with distribution and detailed indexes all

  对表和索引都产生简略的统计:

load from mobile_number.del of del replace into mobile statistics yes and indexes all

  需要值得注意的时候在DB2 8.2新版本里面,可以这样做:

load from mobile_number.del of del replace into mobile statistics use profile
0
相关文章