空分区表收集分区统计信息很慢

动态裁剪模式下分析了分区的统计信息后,会读取其他分区的统计信息,然后将分区集的统计信息 计算为global级统计信息。 可以试试关闭动态裁剪功能 set@@tidb_partition_prune_mode = ‘static’ ,测试环境试试吧,这会影响SQL执行计划。

statistics: optimize the global histogram merging algorithm

  1. remove empty buckets
  2. introduce a damping factor when calculating bucket NDV
  3. limit the minimum size of global buckets
  4. adjust bucket boundaries according to NDV
  5. disable bucket NDV in global-stats