How does a deterministic function caching mechanism works?

Hi all

I read an article on caching by Tom Kyte. http://www.Oracle.com/technetwork/issue-archive/2011/11-Sep/o51asktom-453438.html

In accordance with article the two mechanisms are based on the hash functions. The scalar subquery caching is explained in details. However, there are some questions about the deterministic functions.

Can someone please explain, if there are 32 different values for the column 'owner' in the table of the scene. So, how is it deterministic function cannot be executed 32 times as well as the function result cache?

SQL > create or replace function f (x in varchar2)

Return number

2 DETERMINISTIC

3 as

4 start

5 dbms_application_info.set_client_info

(userenv ('client_info') + 1);

6 return length (x);

7 end;

8.

The function is created.

SQL > start

2: cpu: = dbms_utility.get_cpu_time;

3 dbms_application_info.set_client_info (0);

4 end;

5.

PL/SQL procedure successfully completed.

SQL > select master, f (owner) of scene;

...

72841 selected lines.

SQL > select

2 dbms_utility.get_cpu_time-: cpu cpu_hsecs,.

3 userenv ('client_info')

4 double;

CPU_HSECS USERENV ('CLIENT_INFO')

---------   -----------------------

69                      8316

SQL > create or replace function f (x in varchar2)

Return number

2 RESULT_CACHE

3 as

4 start

5 dbms_application_info.set_client_info

(userenv ('client_info') + 1);

6 return length (x);

7 end;

8.

The function is created.

SQL > start

2: cpu: = dbms_utility.get_cpu_time;

3 dbms_application_info.set_client_info (0);

4 end;

5.

PL/SQL procedure successfully completed.

SQL > select master, f (owner) of scene;

...

72841 selected lines.

SQL > select

2 dbms_utility.get_cpu_time-: cpu cpu_hsecs,.

3 userenv ('client_info')

4 double;

CPU_HSECS USERENV ('CLIENT_INFO')

---------   -----------------------

73                        32

Thanks in advance!

The deteministic function is deterministic for the duration of a single database call.

SQL * the 'extraction' is such an appeal, and the arraysize failure means issue you a new call every 15 rows.

Tests:

ARRAYSIZE 1 000 1 set) and you should see the County substantially

(2) set arraysize 33, select master, f (owner), count (*) from the group stage by owner, f (owner); and you should see the number drop to 32 (even if perhaps 33 due to a minor detail of how the extractions begin)

Interesting documents here: Oracle SQL | A function deterministic vs scalar subquery caching. Part 1 (and follow the links)

Concerning

Jonathan Lewis

Tags: Database

Similar Questions

  • How does the library function call Labview? Can I emulate using C++?

    Hi all. I recently finished writing a dll CUDA for LabView, and now I'm in the steps of optimization of code, memory management, etc. BUT since my code depends on the entries of Labview (lots of data under types of specific data as table manages and Clusters labview) I can't use the CUDA Profiler or the Profiler VC ++ on the DLL. What I intend to do runs labview and then out of all data entry for the DLL in a binary file and then add an additional function in my code that will read in the binary file, allocate and assign variables to their respective positions, and then call the specific DLL function in Labview. In the end, this miniature function will act as the library function call to my specific group of data entries.

    In any case, I started to make this purchase all my data entry of cluster and it comes out in a binary file. And then I started the initialization of the handles of labview, allocating memory and begins to write the binary data in the memory and it works for integers (ints), floats, etc., but I'm confused on how it works with table handles!

    Some examples of code:

    Sets the Handle for table 1 d for INT
    typedef struct {}
    int length;
    int val [1];
    to access the value in a row-online val [Online]
    } Array1dInt, * Array1dIntHandle;

    int main()
    {
    Array1dIntHandle x = new Array1dInt *;
    (* x) = new Array1dInt;

    ifstream file ('TESTDATAIN.dat', ios: in | ios::binary);

    If (file.is_open ())
    {
    file ((char *) &(*x)-> length, sizeof;)
    file ((char *) &(*x)-> val [0], sizeof (int) *(*x)-> length);

    LabviewSpecificFunction (x);
    leader. Close();
    } else
    {
    < "file="" did="" not="" open!"=""><>
    }
    return 0;
    }

    __declspec(dllexport) LabviewSpecificFunction (Array1dIntHandle x)
    {
    ...
    }

    However, my program crashes when the table is nominally big, and it is expected, because if we look at the Array1dHandle, it has allocated only enough memory to 1 item of value! YET, somehow, in its magical and mysterious labview is capable of making val [1] be val [HOWEVERMANYYOUWANT], even if C++ 101 says that val [1] is a constant pointer, and even if I dynamically allocated memory another somwhere, I would never be able to put these data in this round!

    Can you explain, or maybe even write example on how I can fool my program into thinking that the binary code comes from labview, so I can then run my program independent of allowing me to profile the functions inside labview?

    I hope that this question is clear and my sample code is also clear, but I'm happy to answer any questions that relate to this.

    Thank you all!

    I think that I thought about it.

    Array1dIntHandle x = new Array1dInt *;
    int tempsize;
    file ((char *) & tempsize, sizeof;)
    (* x) = (Array1dInt *) malloc (sizeof (int) + sizeof (int) * tempsize);
    (* x)-> length = tempsize;
    file ((char *) &(*x)-> val [0], sizeof (int) *(*x)-> length);

    Well enough, you will need to make the handle, and then make a new Array1dInt * for him, then read in the length of the array in a temporary variable. Then use this information to then malloc memoery quantity you need for the table and pass this place on the handle. Now the handle will point to the size of the memory and you will be able to access the memory in the format, you've done the handle. Badabing badaboom

  • How does the Parental controls web filter work?

    If I find a domain that contains contents unwanted and would like to block.

    I would like to know about how the web control Parental filter working under this situation.

    Does anyone have any suggestions?
    Thanks in advance for your suggestions

    Hello

    Thank you for the update on the issue.

    I suggest you to return the article mentioned below and see if it helps you to block certain websites.

    Limit the content that children can view on the web

    Keep us.

    Kind regards

  • How does the sum function in the element tag?

    Hello!

    I am new to XML Publisher and I need help to understand how my definition of data.

    In my xml file, I have this piece of code
    <group name="G_ACCOUNT" source="Q_REGISTER">
         <element name="COST_ACCOUNT" value="COST_ACCOUNT"/>
         <element name="ACC_DESC" value="ACC_DESC"/>
         <element name="YEAR" value="YEAR"/>
         <group name="G_COST" source="Q_REGISTER">
              <element name="COST_CENTER" value="COST_CENTER"/>
              <group name="G_TAG_NUMBER" source="Q_REGISTER">
                   <element name="TAG_NUMBER" value="TAG_NUMBER"/>
                   <element name="ASSET_NUMBER" value="ASSET_NUMBER"/>
                   <element name="DESCRIPTION" value="DESCRIPTION"/>
                   <element name="ASSET_ID" value="ASSET_ID"/>
                   <element name="ASSET_NUMBER" value="ASSET_NUMBER"/>
                   <element name="COST" value="COST" dataType="number"/>
                   <element name="YTD_DEPRN" value="YTD_DEPRN" dataType="number"/>
                   <element name="DEPRN_RESERVE" value="DEPRN_RESERVE" dataType="number"/>
                   <element name="DEPRN_RESERVE_BY" value="DEPRN_RESERVE_BY" dataType="number"/>
                   <element name="NET_VALUE" value="NET_VALUE" dataType="number"/>
                   <element name="DPIS" value="DPIS"/>
              </group>
              <element name="SUM_ACCOUNT_COST" function="sum" dataType="number" value="G_TAG_NUMBER.COST"/>
              <element name="SUM_ACCOUNT_YTD_DEPRN" function="sum" dataType="number" value="G_TAG_NUMBER.YTD_DEPRN"/>
              <element name="SUM_ACCOUNT_DEPRN_RESERVE" function="sum" dataType="number" value="G_TAG_NUMBER.DEPRN_RESERVE"/>
              <element name="SUM_ACCOUNT_DEPRN_RESERVE_BY" function="sum" dataType="number" value="G_TAG_NUMBER.DEPRN_RESERVE_BY"/>
              <element name="SUM_ACCOUNT_NET_VALUE" function="sum" dataType="number" value="G_TAG_NUMBER.NET_VALUE"/>
         </group>
    </group>
    and now, I have problem with element with functions sum, because it returns like for example. 21356,15. all other components (COST, YTD_DEPRN, DEPRN_RESERVE, DEPRN_RESERVE_BY, NET_VALUE) return values such as 21356.15.

    Can you tell me why sum function does not return to the same value?

    Kind regards
    drama9346

    As I expected wrong since this isn't a RAW number his tent for formatting. You can change this value and format or just go for the sum of RTF, or the SUM of your SQL query.

    Sum in RTF: for SUM_ACCOUNT_COST

    I have given how you use grouping in this case, based on what you might change the code slightly.

    Published by: amri on 9 April 2013 14:28

  • How does this site/forum/community anything work?

    I am alone to by not having no no idea what to do when I get here? I would like to ask a question about Edge animate but as usual Adobe or some other bunch of geeks has "improved" the forum so that it no longer works. Can someone tell me how to search the Forum? I don't want a discussion, I want to find an answer. And can someone tell me why Adobe or Jive (whatever they are) is to change things all the time? Why can't leave you things alone?

    Here's how I search.

    1. go in the tab ' panorama '

    2. then type your query in the field ask Jive.

    3. you don't need to hit submit it auto Jive submits the results once he sees that you stop typing.

    4. from the results below the top 5 is a link to see more results

    Once I found a result, I have the habit of e bookmark it (upper right area of the page) so that I won't get again.

    Certainly not a perfect system, but there are dedicated behind the scenes of the forum people trying to iron out some of the usability issues.

  • How does the resale of an image works?

    I am currently working in an app so as part of one of the features we want to add images (stickers). Is it possible to resale them?

    I really doubt that you would be able to just take the pictures and sell them as they are. With the extended license you can usually put them on one product and sell the product. But I don't think that there is a way to actually sell the images. Personally if I were the photographer I will never accept that kind of license with a very great price.

    A simple rule when using images of the reserve, is that it is usually good to use "your project" but not "as the product itself'.

  • How does the sort of dynamic dashboards works?

    I need to know how to sort the dashboards that appear on the logo on the tab panels.

    Thx for your help ;)

    Hello

    Check this box...

    http://oraclebizint.WordPress.com/2008/04/02/Oracle-BI-EE-101332-changing-sort-order-of-dashboards/

    I'm not sure we can set dynamic dashboards...

  • The two latest release of Thunderbird have a mistake in the graphics engine. How does a downgrade to the latest stable version? How does the repair function?

    It happens all the time that the image is not displayed correctly or flattened up with a mouse on the structure is corrected.
    This is the case not only in the main window, but also in all other windows. It will be built not the content of the window, or display incorrectly.
    Only since the major release happens on the 38.xx version.

    Try turning off hardware acceleration:

    Tools | Options | Advanced | General

  • Alienware 17 mSATA Cache how does this work? Is - this passive or what I need to do something? Please explain!

    My laptop AW17 has two 1 TB RAID 0 drive and a drive of 80 GB mSATA. How does caching work. The operating system notice how many times I use specific programs and store them on disk mSATA? Am I supposed to install apps that I intend to use more often the mSATA disk. Hard drives are 5400 RPM drives. It would be preferable to use only SSDS instead (of course cost)? If I used SSD would still need or want even the reader mSATA? Is there an advantage to a larger capacity mSATA drive or is it a case of diminishing returns after a certain size?

    The TSRI the fact on its own drivers.

  • My 500 keyboard Microsoft Wireless Comfort has "extra" keys at the top. How does it work? Should I do something?

    My 500 keyboard Microsoft Wireless Comfort has "extra" keys at the top. How does it work? I have to do something

    Hello

    The keys that you have mentioned are known as multimedia keys that will help you to achieve functions like playing the song, stop playback of a song, open the web browser etc. to one touch access.

    You can refer to the manual for the keyboard for additional References.

    Thank you, and in what concerns:
    Naman R - Microsoft technical support engineer.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Hi, does anyone know how to get my sony vaio bluetooth works please, I tried to update etc, but he won't find not all bluetooth devices.

    Hi, does anyone know how to get my sony vaio bluetooth works please, I tried to update etc, but he won't find not all bluetooth devices.

    Hello

    Check with the support of Sony as their problems, driver updates, other reasons could known BlueTooth
    is not functional or taken in charge.

    Sony - Contacts
    http://eSupport.Sony.com/us/Perl/contact-land.pl

    Sony - drivers
    http://eSupport.Sony.com/Perl/select-System.pl

    Sony - Support
    http://eSupport.Sony.com/

    =====================================

    If bluetooth is supported on your model that these could help.

    Hardware devices not detected or does not work - a Mr Fixit
    http://support.Microsoft.com/GP/hardware_device_problems

    The problems with Bluetooth devices
    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-Bluetooth-enabled-devices

    Set up a Bluetooth compatible device
    http://Windows.Microsoft.com/en-us/Windows-Vista/set-up-a-Bluetooth-enabled-device

    The problems with Bluetooth devices
    http://207.46.197.98/Windows/en-in/help/11a74104-645D-40D4-b933-bde5d15537bb1033.mspx

    How to set up a Bluetooth connection
    http://www.vista4beginners.com/how-to-setup-a-Bluetooth-connection

    The Bluetooth item in Control Panel on a Windows Vista SP2 computer does not
    as expected when you click on the element - for Windows 7 this check manually
    http://support.Microsoft.com/kb/960531/en-us

    If you need drivers try the support site for the manufacturer of your system and/or the site of the manufacturer of the real device.

    BluetoothView is a small utility that runs in the background and monitor the activity of Bluetooth technology
    devices around you. For each detected Bluetooth device, it displays the following information:
    The device name, address Bluetooth, Major Device Type, minor device Type, first detection time,
    Last detection time and more. BluetoothView can also warn when a new Bluetooth device
    is detected, by displaying a balloon in your bar tasks or playing a little beep. -FREE
    http://www.NirSoft.NET/utils/bluetooth_viewer.html

    BluetoothCL is a small console application that transforms all differential of bluetooth devices detected in
    the standard output. For each Bluetooth device, the following information is displayed: MAC
    Address, name, Major Device Type, minor device Type and possibly the name of the company of
    the device (if the external file of MAC addresses - oui.txt is provided) - FREE
    http://www.NirSoft.NET/utils/bluetoothcl.html

    ---------------------------------------------------------------------

    Add a Bluetooth device to your computer
    http://Windows.Microsoft.com/en-us/Windows7/add-a-Bluetooth-enabled-device-to-your-computer

    Add a Bluetooth device or other wireless or network device: frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows7/add-a-Bluetooth-or-other-wireless-or-network-device-frequently-asked-questions

    ---------------------------------------------------------------------

    More information of possible interest to some:

    What is a Bluetooth personal area network (PAN) network?
    http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-a-Bluetooth-personal-area-network-Pan

    Connect to a Bluetooth personal area network (PAN) network
    http://Windows.Microsoft.com/en-us/Windows-Vista/connect-to-a-Bluetooth-personal-area-network-Pan

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • How does BusinessCatalyst really work?

    So I tried to achieve this and can't find answers in plain English... How does a catalyst for business?... from a functional point of view.

    (1) I have with godaddy and jumpline's hosting service, I have plenty of space and not all Web sites my client through the space I have with both of these plans, they offer the format of business catalyst? Just buy this platform with them or have it added?

    (2) I have CC, business catalyst "delivered with" it... How it work? If I give me space on someone elses server somewhere or do I just the possibility to download the BC software on a server, I have... in which case it could be transferred to godaddy or jumpline?

    (3) the new features of MUSE is possible with catalyst business right?

    Hello

    Business Catalyst is a web hosting platform that allows to host Web designers, assemble and sell websites to clients. You use Muse to create and update a Web site. You use Business Catalyst to host it. A Muse subscription offers you a free hosting to Business Catalyst for a single site. A Creative cloud membership offers you a free hosting for five sites.

    Regarding your subscription creative cloud, with BC. You must install and use Muse/Dreamweaver to publish your free sites. For more details, please see the article below

    http://helpx.Adobe.com/business-catalyst/using/business-catalyst-Muse-users.html

    The new feature of Muse, as in the browser edition is only compatible with Business Catalyst, but the other feature like Parallex scrolling works on all the others as well, hosting like Godaddy.

    If you still have questions, please let us know and we will try to resolve it.

    Thank you.

  • Is it possible to perform a search on Android content of a current Web page? If so, how could put upward and how does it work?

    Nice day!
    Dear Sirs / ladies,.
    You have a manual how to search the contents of the current Web page:
    https://support.Mozilla.org/en-us/KB/search-contents-current-page-text-or-links

    Unfortunately, I wasn't able to find the same option for Android.
    Is this possible?
    How does it work?

    sincerely
    Summerman

    See the attached screenshot for searching in the location of the page in our menu.

    This is a somewhat new. You must make sure, that you are on the latest version of Firefox for Android, version 37. You can check by typing about: firefox in the address bar. The version will be in the upper left corner of the page.

  • Time capsule will save my laptop complete? Which means that if it crashes, breaks, etc. I'll be able to restore all my memory/data on a new laptop? Exactly how does it work? Thank you.

    Time capsule will save my laptop complete? Which means that if it crashes, breaks, etc. I'll be able to restore all my memory/data on a new laptop? Exactly how does it work? Thank you.

    Yes. Time Capsule uses the Time Machine on your Mac software. Here is information on both and the restoration:

    http://www.Apple.com/airport-time-capsule/

    Use Time Machine to back up or restore your Mac - Apple Support

  • What is efax and how does it work?

    Hello!

    eFax® is a service provided by eFax®, not Hewlett-Packard, which allows you to send and receive faxes using the Internet instead of a phone line. eFax® is easy to use, but it is different from a typical telephone fax. You do not need a phone line to use it, so you don't have to worry about busy signals and you can place your printer where you want to, not where the phone plugs are! The fax number you are provided will not generally be a local number and maybe even in a different country. You will receive 20 entrants and 20 pages of outgoing fax per month for free with this service. Your account page will reset at midnight Pacific, the first of each month time. You can also subscribe to eFax® more to get additional pages by month by visiting: http://www.eFax.com/products/internet-fax.

    How does it work?

    Hi Im_cheesecake,

    Great information, if you don't mind I just want to piggy back off of your post, to eliminate any likelihood of confusion.

    The 20 free incoming & 20 free outgoing faxes are with HP printer which include the impression of the eFax service application.  From now on, we have three series printers that include the application pre-installed print eFax: HP Photosmart 7510 Series, series of 110 HP Envy and HP Photosmart eStation C510a.

    

    eFax also has a free plan that allows you to receive a limited number of faxes, but cannot send faxes. If you exceed the allowed number of received faxes, eFax invite you to upgrade to a paying account. Here are the main Details of the free plan:

    • A (i.e., non-local) eFax number distance
    • Regional/prefix code is selected by eFax and is not editable (except if you upgrade to a paid account)
    • 20 pages of incoming faxes per month (reception only)
    • You are prompted to upgrade to a paid account if you exceed 20 inbound pages, or if you need to send capacity.

Maybe you are looking for

  • Update Windows xp KB961503__security xp KB956572

    Windows update will not download or install these 2 updates. Why and what can I do?

  • How to install the Windows Service Pack to run TurboTax 2013

    My computer? crashed? and I had to reboot. Now cannot install Turbotax 2013, re: "unable to install. need Windows XP Service Pack installed. Tried, tried. Failed to install. Nothing works. I found on my C: / drive a Microsoft.net folder which contain

  • A message to reinstall: MapI32.dll (Windows Search.exe) how to re - install.

    Original title: Reinstall: MapI32.dll (Windows Search.exe) After the installation of the update of Windows 8 for Windows XP, I get an error dialog box that indicates that I have to reinstall MapI32.dll (Windows Search.exe). How do I reinstall and why

  • Need help on the first (Sansa) MP3

    I just bought a new 8 GB Sansa Fuze today at Radio Shack ($69).  I downloaded the Media Player 11 MS, but have not yet charged the "rocket". I put in the CD teeny but it seemed that it was just to download music, I didn't want to.  Could someone tell

  • Unable to connect to a Time Capsule - router Apple´s

    I bought a Time Capsule (Apple´s built-in wifi router and hard drive). My Vista laptop can connect to the network, but it can't get internet access or disk access network hard. I have a mix of different devices connected to the router without a probl