Oracle 中的优化和重新编译提示?

发布于 2024-10-18 22:32:32 字数 199 浏览 0 评论 0原文

Oracle 中是否有任何提示与这些 SQL Server 提示的工作方式相同?

重新编译:每次运行查询时都会重新编译(如果执行计划因参数而异)。与 Oracle 中的cursor_sharing 相比,这是否最好?

优化:当您希望计划针对某个参数进行优化,即使第一次运行 SQL 时使用了不同的参数时?我想也许对cursor_sharing也有帮助?

Is there any hints in Oracle that works the same way as these SQL Server hints?

Recompile: That a query is recompiled every time it's run (if execution plans should vary greatly depending on parameters). Would this be best compared to cursor_sharing in Oracle?

Optimize for: When you want the plan to get optimized for a certain parameter even if a different one is used the first time the SQL is run? I guess maybe could be helped with cursor_sharing as well?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

久光 2024-10-25 22:32:32

Since you're using 11g, Oracle should use adaptive cursor sharing by default. If you have a query that uses bind variables and the histogram on the column with skewed data indicates that different bind variable values should use different query plans, Oracle will maintain multiple query plans for the same SQL statement automatically. There would be no need to specifically hint the queries to get this behavior, it's already baked in to the optimizer.

浅听莫相离 2024-10-25 22:32:32

我不知道,但在forums.oracle 这里找到了一些解决方案的讨论。 com

I didn't know, but found a discussion with some solutions here on forums.oracle.com

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文