<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 的范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?(如何将 DBMS_OUTPUT.PUT_LINE 的输出重定向到文件?)
                How do I get column datatype in Oracle with PL-SQL with low privileges?(如何使用低权限的 PL-SQL 在 Oracle 中获取列数据类型?)
                Get a list of all functions and procedures in an Oracle database(获取 Oracle 数据库中所有函数和过程的列表)
                Why cannot I create triggers on objects owned by SYS?(为什么我不能在 SYS 拥有的对象上创建触发器?)
                Returning result even for elements in IN list that don#39;t exist in table(即使对于表中不存在的 IN 列表中的元素也返回结果)
                Reset Sequence in oracle 11g(oracle 11g 中的重置序列)
                  <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>