【问题标题】:Difference on explain plan and gather_plan_statistics解释计划和收集计划统计的区别
【发布时间】:2018-06-25 12:59:39
【问题描述】:

谁能告诉我什么时候应该使用gather_plan_statistics 提示或什么时候应该使用解释计划。 collect_plan_statistics 提示的实际目的是什么。

【问题讨论】:

    标签: sql oracle sql-execution-plan


    【解决方案1】:

    是的,它看起来很混乱,但很简单:

    • 解释计划查看查询并创建理论执行计划。
    • Gather_plan_statistics 指示优化器在实际执行过程中记笔记,以便能够将理论与现实进行比较。

    详情请见this question

    【讨论】:

      【解决方案2】:

      更好的选择是生成 SQL 监视器报告。 SQL 会被自动监控,因此无需使用提示重新运行。 SQL Monitor 报告提供的信息比 gether_plan_statistics 多得多。 最后,在执行并行查询时,gather_plan_statistics 中的统计信息不可靠。

      【讨论】:

        猜你喜欢
        • 2012-05-21
        • 2012-12-26
        • 2023-03-10
        • 2021-09-27
        • 1970-01-01
        • 1970-01-01
        • 2018-05-06
        • 2012-11-12
        • 2012-12-16
        相关资源
        最近更新 更多