<bdo id='ty0ys'></bdo><ul id='ty0ys'></ul>

    <tfoot id='ty0ys'></tfoot>
    <i id='ty0ys'><tr id='ty0ys'><dt id='ty0ys'><q id='ty0ys'><span id='ty0ys'><b id='ty0ys'><form id='ty0ys'><ins id='ty0ys'></ins><ul id='ty0ys'></ul><sub id='ty0ys'></sub></form><legend id='ty0ys'></legend><bdo id='ty0ys'><pre id='ty0ys'><center id='ty0ys'></center></pre></bdo></b><th id='ty0ys'></th></span></q></dt></tr></i><div id='ty0ys'><tfoot id='ty0ys'></tfoot><dl id='ty0ys'><fieldset id='ty0ys'></fieldset></dl></div>
    1. <small id='ty0ys'></small><noframes id='ty0ys'>

      <legend id='ty0ys'><style id='ty0ys'><dir id='ty0ys'><q id='ty0ys'></q></dir></style></legend>

      是否有类似于 DETERMINISTIC 的 PL/SQL pragma,但仅针对单个 SQL SELECT 的范围?

      Is there a PL/SQL pragma similar to DETERMINISTIC, but for the scope of one single SQL SELECT?(是否有类似于 DETERMINISTIC 的 PL/SQL pragma,但仅针对单个 SQL SELECT 的范围?)
          <tbody id='8X45g'></tbody>

          <small id='8X45g'></small><noframes id='8X45g'>

          <tfoot id='8X45g'></tfoot>
            • <i id='8X45g'><tr id='8X45g'><dt id='8X45g'><q id='8X45g'><span id='8X45g'><b id='8X45g'><form id='8X45g'><ins id='8X45g'></ins><ul id='8X45g'></ul><sub id='8X45g'></sub></form><legend id='8X45g'></legend><bdo id='8X45g'><pre id='8X45g'><center id='8X45g'></center></pre></bdo></b><th id='8X45g'></th></span></q></dt></tr></i><div id='8X45g'><tfoot id='8X45g'></tfoot><dl id='8X45g'><fieldset id='8X45g'></fieldset></dl></div>
                <bdo id='8X45g'></bdo><ul id='8X45g'></ul>

              • <legend id='8X45g'><style id='8X45g'><dir id='8X45g'><q id='8X45g'></q></dir></style></legend>
                本文介绍了是否有类似于 DETERMINISTIC 的 PL/SQL pragma,但仅针对单个 SQL SELECT 的范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在 SQL SELECT 语句中,我想执行一个对该 SELECT 语句的范围具有确定性的函数(或者事务也可以):

                In a SQL SELECT statement, I'd like to execute a function that is deterministic for the scope of that SELECT statement (or transaction would be ok, too):

                select t.x, t.y, my_function(t.x) from t
                

                t.x 的许多值是相同的,因此 Oracle 可以省略一次又一次地调用相同的函数,以加快速度.但是,如果我将该函数标记为 DETERMINISTIC,则结果可能会在多次执行此查询之间缓存.之所以不能使用DETERMINISTIC,是因为my_function使用了一个不时变化的配置参数.

                Many values of t.x are the same so Oracle could omit calling the same function again and again, to speed things up. But if I label the function as DETERMINISTIC, the results may be cached between several executions of this query. The reason why I can't use DETERMINISTIC is because my_function uses a configuration parameter that is changed from time to time.

                我可以使用其他关键字吗?是否有任何我应该注意的问题(内存问题、并发性等)?或者可能有任何其他技巧,例如每个 t.x 值仅调用一次函数的分析函数(对性能没有重大影响)?

                Is there any other keyword I could use? Are there any catches that I should be aware of (memory issues, concurrency, etc)? Or maybe any other tricks, such as analytic functions to call the function only once per t.x value (without major performance impact)?

                推荐答案

                如果你这样做:

                select t.x, t.y, (select my_function(t.x) from dual)
                from t
                

                然后Oracle可以使用子查询缓存来实现减少函数调用.

                then Oracle can use subquery caching to achieve reduced function calls.

                这篇关于是否有类似于 DETERMINISTIC 的 PL/SQL pragma,但仅针对单个 SQL SELECT 的范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                Creating a flattened table/view of a hierarchically-defined set of data(创建分层定义的数据集的扁平表/视图)
                MySQL: how to do row-level security (like Oracle#39;s Virtual Private Database)?(MySQL:如何做到行级安全(如 Oracle 的 Virtual Private Database)?)
                What is the best way to enforce a #39;subset#39; relationship with integrity constraints(强制执行具有完整性约束的“子集关系的最佳方法是什么)
                Split String by delimiter position using oracle SQL(使用 oracle SQL 按分隔符位置拆分字符串)
                How to unfold the results of an Oracle query based on the value of a column(如何根据列的值展开Oracle查询的结果)
                  <tbody id='fBWiE'></tbody>
                  <bdo id='fBWiE'></bdo><ul id='fBWiE'></ul>
                  <i id='fBWiE'><tr id='fBWiE'><dt id='fBWiE'><q id='fBWiE'><span id='fBWiE'><b id='fBWiE'><form id='fBWiE'><ins id='fBWiE'></ins><ul id='fBWiE'></ul><sub id='fBWiE'></sub></form><legend id='fBWiE'></legend><bdo id='fBWiE'><pre id='fBWiE'><center id='fBWiE'></center></pre></bdo></b><th id='fBWiE'></th></span></q></dt></tr></i><div id='fBWiE'><tfoot id='fBWiE'></tfoot><dl id='fBWiE'><fieldset id='fBWiE'></fieldset></dl></div>

                  1. <small id='fBWiE'></small><noframes id='fBWiE'>

                    1. <tfoot id='fBWiE'></tfoot>
                        • <legend id='fBWiE'><style id='fBWiE'><dir id='fBWiE'><q id='fBWiE'></q></dir></style></legend>