Result_cache full

Hello,
I have seen that we can manually flush the RESULT_CACHE with DBMS_RESULT_CACHE.FLUSH;
If the RESULT_CACHE is full and we don't flush it, what will it happen if we try to cache the result of a new query ?

If I understand correctly, it means that Oracle automaticly flush the result_cache for the new requests ?

Similar Messages

  • What's wrong with the following result_cache hint?

    Dear all,
    I try to use result_cache hint in the following sql aggregate function statement, but the explain plan doesn't show any difference between non-result_cached and with result_cached:
    SQL> set autot on explain stat
    SQL> select account_mgr_id,count(*) from customers group by account_mgr_id;
    ACCOUNT_MGR_ID      COUNT(*)
            147            76
            149            74
            148            58
            145           111
    Execution Plan
    Plan hash value: 1577413243
    | Id  | Operation        | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |            |     4 |    16 |     6     (17)| 00:00:01 |
    |   1 |  HASH GROUP BY        |            |     4 |    16 |     6     (17)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| CUSTOMERS |   319 |  1276 |     5      (0)| 00:00:01 |
    Statistics
           0  recursive calls
           0  db block gets
          16  consistent gets
           0  physical reads
           0  redo size
         689  bytes sent via SQL*Net to client
         524  bytes received via SQL*Net from client
           2  SQL*Net roundtrips to/from client
           0  sorts (memory)
           0  sorts (disk)
           4  rows processed
    SQL> select /*+ result_cache */ account_mgr_id,count(*) from customers group by account_mgr_id;
    ACCOUNT_MGR_ID      COUNT(*)
            147            76
            149            74
            148            58
            145           111
    Execution Plan
    Plan hash value: 1577413243
    | Id  | Operation         | Name                | Rows  | Bytes | Cost (%CPU)| Time      |
    |   0 | SELECT STATEMENT    |                     |     4 |    16 |     6  (17)| 00:00:01 |
    |   1 |  RESULT CACHE         | 3s3bugtq0p5bm71mhmqvvw0x7y |      |      |           |       |
    |   2 |   HASH GROUP BY     |                     |     4 |    16 |     6  (17)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| CUSTOMERS            |   319 |  1276 |     5   (0)| 00:00:01 |
    Result Cache Information (identified by operation id):
       1 - column-count=2; dependencies=(OE.CUSTOMERS); name="select /*+ result_cache */ account_mgr_id,
    count(*) from customers group by account_mgr_id"
    Statistics
           1  recursive calls
           0  db block gets
          16  consistent gets
           0  physical reads
           0  redo size
         689  bytes sent via SQL*Net to client
         524  bytes received via SQL*Net from client
           2  SQL*Net roundtrips to/from client
           0  sorts (memory)
           0  sorts (disk)
           4  rows processedAnything wrong with the hint?
    Best regards,
    Val

    Two executions required to benefit from result cache (two executions of the statement with the result cache hint).
    First to populate, Second to benefit.
    Can offer good benefits particularly with poor code - e.g. functions in SQL, row-by-row function calls, etc.
    Optimal solution may be to refactor to more efficient approach.
    But result cache can deliver significant short term tactical gain.
    Not a no-brainer though.
    There were scalability issues with a single latch protecting the result cache - I believe this has changed in 11gR2.
    There are also issues with concurrent executions were the result needs to be recalculated and takes x time to regenerate that result.
    See http://uhesse.wordpress.com/2009/11/27/result-cache-another-brilliant-11g-new-feature/#comment-216
    SQL> drop table t1;
    Table dropped.
    SQL>
    SQL> create table t1
      2  as
      3  select rownum col1
      4  from   dual
      5  connect by rownum <= 100000;
    Table created.
    SQL> set autotrace traceonly explain statistics
    SQL> select col1
      2  from   t1
      3  where  col1 >= 99997;
    Execution Plan
    Plan hash value: 3617692013
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    10 |   130 |    58   (9)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| T1   |    10 |   130 |    58   (9)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("COL1">=99997)
    Note
       - dynamic sampling used for this statement (level=4)
    Statistics
             10  recursive calls
              0  db block gets
            220  consistent gets
            153  physical reads
              0  redo size
            379  bytes sent via SQL*Net to client
            334  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              4  rows processed
    SQL> select col1
      2  from   t1
      3  where  col1 >= 99997;
    Execution Plan
    Plan hash value: 3617692013
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    10 |   130 |    58   (9)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| T1   |    10 |   130 |    58   (9)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("COL1">=99997)
    Note
       - dynamic sampling used for this statement (level=4)
    Statistics
              0  recursive calls
              0  db block gets
            158  consistent gets
              0  physical reads
              0  redo size
            379  bytes sent via SQL*Net to client
            334  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              4  rows processed
    SQL>
    SQL>
    SQL> select /*+ result_cache */ col1
      2  from   t1
      3  where  col1 >= 99997;
    Execution Plan
    Plan hash value: 3617692013
    | Id  | Operation          | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |                            |    10 |   130 |    58   (9)| 00:00:01 |
    |   1 |  RESULT CACHE      | 4p777jcbdgjm25xy3502ypdb5r |       |       |            |          |
    |*  2 |   TABLE ACCESS FULL| T1                         |    10 |   130 |    58   (9)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter("COL1">=99997)
    Result Cache Information (identified by operation id):
       1 - column-count=1; dependencies=(RIMS.T1); name="select /*+ result_cache */ col1
    from   t1
    where  col1 >= 99997"
    Note
       - dynamic sampling used for this statement (level=4)
    Statistics
              4  recursive calls
              0  db block gets
            216  consistent gets
              0  physical reads
              0  redo size
            379  bytes sent via SQL*Net to client
            334  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              4  rows processed
    SQL>
    SQL>
    SQL> select /*+ result_cache */ col1
      2  from   t1
      3  where  col1 >= 99997;
    Execution Plan
    Plan hash value: 3617692013
    | Id  | Operation          | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |                            |    10 |   130 |    58   (9)| 00:00:01 |
    |   1 |  RESULT CACHE      | 4p777jcbdgjm25xy3502ypdb5r |       |       |            |          |
    |*  2 |   TABLE ACCESS FULL| T1                         |    10 |   130 |    58   (9)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter("COL1">=99997)
    Result Cache Information (identified by operation id):
       1 - column-count=1; dependencies=(RIMS.T1); name="select /*+ result_cache */ col1
    from   t1
    where  col1 >= 99997"
    Note
       - dynamic sampling used for this statement (level=4)
    Statistics
              0  recursive calls
              0  db block gets
              0  consistent gets
              0  physical reads
              0  redo size
            379  bytes sent via SQL*Net to client
            334  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              4  rows processed
    SQL>

  • Is result_cache working in Oracle 11.1.0.6.0?

    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    TNS for Solaris: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    SQL> SELECT dbms_result_cache.status() FROM dual;
    DBMS_RESULT_CACHE.STATUS()
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------ENABLED
    12:31:08 SQL> set autotrace on
    select count(*) from objs;
    12:31:27 SQL>
    COUNT(*)
    69918
    Elapsed: 00:00:01.72
    Execution Plan
    Plan hash value: 386529197
    | Id | Operation | Name | Rows | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 289 (1)| 00:00:04 |
    | 1 | SORT AGGREGATE | | 1 | | |
    | 2 | TABLE ACCESS FULL| OBJS | 80773 | 289 (1)| 00:00:04 |
    Note
    - dynamic sampling used for this statement
    Statistics
    282 recursive calls
    0 db block gets
    1140 consistent gets
    1038 physical reads
    0 redo size
    524 bytes sent via SQL*Net to client
    524 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    5 sorts (memory)
    0 sorts (disk)
    1 rows processed
    12:31:49 SQL> select /*+ result_cache */ count(*) from objs;
    COUNT(*)
    69918
    Elapsed: 00:00:00.03
    Execution Plan
    Plan hash value: 386529197
    | Id | Operation | Name | Rows | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 289 (1)| 00:00:04 |
    | 1 | RESULT CACHE | cnsc9rw3p17364cbg4975pad6y | | | |
    | 2 | SORT AGGREGATE | | 1 | | |
    | 3 | TABLE ACCESS FULL| OBJS | 80773 | 289 (1)| 00:00:04 |
    Result Cache Information (identified by operation id):
    1 - column-count=1; dependencies=(CTSGKOD.OBJS); attributes=(single-row); name="select /*+ result_cache */ count(*) from objs"
    Note
    - dynamic sampling used for this statement
    Statistics
    4 recursive calls
    0 db block gets
    1110 consistent gets
    0 physical reads
    0 redo size
    524 bytes sent via SQL*Net to client
    524 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    12:32:06 SQL>
    i see result_cache in execution plan, but why do i see 1110 consistent gets? I expected 0 in consisent gets and physical reads and the query is not executed ...
    Thank You

    Aman,
    lets say i run these statements
    1) exec dbms_result_cache.flush
    2) alter system flush shared_pool;
    3)alter system flush buffer_cache;
    Then i run the query without hint of result_cache
    4) Select count(*) from objs; --> This query is not using result cache, it is running for first time, so physical reads & consistent gets
    5) select count(*) from objs; --> again same query, this time only consistent gets
    6) select /*+ result_cache */ count(*) from objs; -- Lets introduce result_cache now
    Will the above query gets data from buffer cache or will it use result_cache and gets result from memory instead of running query? Or will this 6th statement run same as (5) and prepares ground for usage of result_cache and
    any other queries later can benefit from result_cache?
    Thanks again Aman

  • Reg: result_cache in parallel -

    Hi Experts,
    I have few concern(s) regarding the Result Cache (introduced in 11gR2) and the /*+ RESULT_CACHE */ hint.
    Refering to -
    Doc 12.1 - Tuning the Result Cache
    Murali Vallath - Using Oracle Database 11g Release 2 Result Cache in an Oracle RAC Environment
    Adrian Billington -- query result cache in oracle 11g
    Concerns -
    (1) Suppose I have a master ETL job which has 5 sub-jobs. These sub-jobs are executed in parallel i.e. started all at once from ETL.
    Each of these sub-job executes an extraction query and pulls data from database.
    In each of these sub-job queries, there's a subquery which is common. I am thinking to provide /*+ RESULT_CACHE */ to this common subquery.
    But my actual concern - since all the extraction queries (i.e. sub-jobs) are started in parallel, will the Result Cache thing come into picture?
    (2) For how long the data is retained in the cache?
    A wild guess - till the point we execute the DBMS_RESULT_CACHE.FLUSH procedure ?
    (3) Any caveats?
    (Trying to fix few costly time-consuming queries, and suddenly this option came to my mind. Took the opportunity to look at this cool feature, at the same time understanding the caveats, if any)
    Please advise me on this.
    -- Ranit
    (on Oracle 11.2.0.3.0)

    Hi.
    2.1) 50Mb can store approximately 50Mb of data. The amount of stuff you can sore depends a number of factors, including:
    - How many queries or function calls are being cached.
    - With respect to the query cache, how wide are the rows. We are talking size of data in the columns.
    - How many rows are being returned.
    So you might have a few larger result sets, or many small ones.
    2.2) Well, it can't. The RESULT_CACHE_MAX_RESULT parameter determines the maximum size of a result set that will be considered for caching. By default it is set to 5, which means 5% of the size. So let's say you have a result cache of 100Mb. By default, a result set in excess of 5Mb will not be considered for caching. This stops you wiping out useful information in the cache by trying to cache one big result set.
    The reality is, if you start to use this feature you will have to monitor the cache performance and be selective about what you cache and what you don't. The default sizing parameters are not going to be suitable for everyone. You need to alter them based on your monitoring. Nobody in a forum will be able to tell you figures to set. If it were that easy, Oracle would do it for you.
    Regarding your "alternative solution", I don't really want to comment on that specifically because I don't know enough about the system. Typically, it would not be something I would do, but maybe it is the right thing for you to do in your case. Impossible for me to know. Things to consider in preference to your alternative solution.
    - Scalar subquery caching: If the subqueries are scalar subqueries (pulling back a single column/object in a single row), it will already be taking advantage of scalar subquery caching, so your alternative solutions may actually give worse performance. There is no sharing between SQL statements or sessions.
    ORACLE-BASE - Efficient Function Calls From SQL
    - Use a WITH clause to replace the subqueries and use the materialize hint. This way, the subquery is automatically materialized into temp segments, so multiple references to it within a single statement query the result from the temp segments, rather than the full subquery. There is no sharing between SQL statements or sessions.
    ORACLE-BASE - WITH Clause : Subquery Factoring
    The reality is, there is not going to be a "best" solution that works for all cases. What you need to do is try several approaches and pick the one that works best for your circumstances. The next time you run into a similar issue, you can't assume what you did last time is the right solution this time...
    Regardless of which option you pick, you need to read the docs and feel comfortable with the tech before you launch down the path. No matter how good a feature is, if you use it badly you will make that feature look bad. 
    Cheers
    Tim...

  • Can not properly view cover flow in full screen in external display

    My mac is the new Mac book pro 15.4 inch screen and I connect my mac pro to external display e.g. Samsung LCD monitor 24 inches.
    The bug is that I can not PROPERLY view full screen (in external display) for some application e.g. iTunes, and Front Row.
    - When I use iTunes, I can not properly view Cover Flow view in full screen (in the external display screen) except the case of mirror display.
    - For Front Row, I can not view full screen in external display but only my mac display.
    However, for other DVD or VDO players, I can view movie on external display in full screen and I still be able to do other works on my mac screen.
    Please let me know how to solve it.

    found the likely issue!  are you participating in youtube's html5 trial?  go here and it will tell you if you are:
    http://www.youtube.com/html5
    exit the trial and it should fix the issue.  it worked for me!

  • Hi Guys,  I am using the full width video widget on a site. The widget was working perfectly however I have just added additional content to the site and re-uploaded and now the video is not working! Please help I have tried everything and am freaking out

    Hi Guys,
    I am using the full width video widget on a site. The widget was working perfectly however I have just added additional content to the site and re-uploaded and now the video is not working! Please help I have tried everything and am freaking out as this web-site has been payed for by my client.
    Alex

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • Mail wont open says home directory is full. HELP?

    I dont know what happend but i restarted my powerbook today and when i got back to the desktop and tried launching mail it gives me the following message.
    MAIL CANNOT UPDATE YOUR MAILBOXES BECAUSE YOUR HOME DIRECTORY IS FULL.
    You must free up space in your home folder before using mail. Delete unneeded documents or move documents to another volume.
    what happend to cause this and what can i do to fix it.
    Thanks

    If your hard drive has at least 5GB of free space available, quit Mail first and using the Finder go to Home > Library > Mail > Envelope Index. Move the Envelope Index file to the Desktop.
    Afterwards, copy the Mail folder and place the copy on the Desktop for backup purposes.
    Launch Mail and you will be prompted to import all mailboxes available in the Mail folder at Home > Library > Mail.
    Select OK and allow the import process to complete and a new Envelope Index file will be created automatically by Mail within the Mail folder.
    After confirming all mailboxes were successfully imported and are available, you can delete the copy of the Mail folder and the old Envelope Index file from the Desktop.
    This should resolve the problem.

  • XML Publisher report output in RTF format does not display full page

    Hi,
    We have one XML Publisher report, the output of report in RTF format is not getting displayed in Full Page in normal way (MS Word -->View menu --> Print layout) but we can see full page display when we do MS Word -->View menu --> Outline.
    Appreciate your valuable inputs on this.
    Is this a template issue or any profiles needs to be set.
    Thanks
    Vijay

    Do you have any header and footer on your template?
    If you have any header and footer then try to adjust it as of to display full page.
    Thanks
    Yasar

  • How can I change the display of Inbox in my iPad's mail app- so that it takes up the full screen?

    How can I change the display of Inbox in my iPad's mail app- so that it takes up the whole screen, as opposed to just about one third; the other two thirds display the full text of the selected email?

    You can't change the display in the Mail app, if you are holding the iPad in landscape orientation then the left-hand third will be for navigation, and the right-hand two-thirds will be an email. If you hold the iPad in portrait orientation then the navigation section becomes a drop-down section.

  • Who do I complain to regarding an Apple iPhone upgrade that has taken my my full screen contact picture and turned it into a tiny circle that is hard to see at a glance!!!

    I'm trying to find an outlet for the frustration I feel regarding the "upgrade" that replaced my full screen picture for my contact numbers to a tiny, little dot in the right hand corner.  Are they going to give us an option to go back or did someone  just need to justify their job by making  changes??

    Apple.com/feedback

  • My icloud storage is almost full, yet it doesn't seem like it should be?

    Help. My icloud storage is almost full. Because of that I can't back up my iphone. My friends and I can't figure out why it is so full. It is in the photo area, but nothing seems crazy big. I only have about 315 photos and 20 videos on my phone. Not even long videos - all are 5 minutes or less. Anyone have advise on what to look for?

    settings>icloud>storage and backup>manage backup and turn off Addtional apps and camera roll

  • How can i print an Excel file when in the full screen mode (no print options on toolbar or right clk

    using Vista, sometimes after creating and saving an excel file, the document is not visible when the file is reopened.
    selecting full screen mode makes the document visible, but the toolbars disappear and the print option does not show up on a right click.  How can i print the document and see the document in some other mode than full screen?

    In order to print, you can click the CTRL+P keys to launch the print dialog,
    Regarding the missing toolbar, try clicking the ALT key to shouw the software menu, then look around under the view option for any available toolbar settings,
    If you cannot find it, i would recommend you to try the Microsoft support forums, as they have some more knowledge with their software features
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • How can I print just a part of the page and not the full page with Adobe Reader v 10.1.2?

    how can I print just a part of the page and not the full page with Adobe Reader v 10.1.2? I need to print a engineering print with lot of information but information is too small in letter size and I don't have a plotter.

    Two ways to print a portion of a page: zooming or using the Snapshot Tool.
    ZOOMING:
    Zoom into the area you want to print.
    Click the Print icon.
    Under "Pages to Print", make sure "Current view" is selected under "More options" (you may need to click "More options" to open it).
    If you aren't satisfied with the preview, try clicking "Fit" under the Size button.
    SNAPSHOT
    Choose Edit > Take A Snapshot.
    Drag a rectangle around the area you want to print. 
    Click the Print icon.
    Under "Pages to Print", make sure that "Selected Graphic" is selected under "More options".
    To enlarge the snapshot to fit the sheet of paper, choose "Fit" under the Size button.
    Hope this helps!

  • The status bar is pushed up at about 3/4 of the screen, so I can view onlu firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full vi

    The status bar is pushed up at about 3/4 of the screen, so I can view only Firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full view
    == This happened ==
    Every time Firefox opened

    Your code is absolutely unreadable - even if someone was willing to
    help, it's simply impossible. I do give you a few tips, though: If you
    understand your code (i.e. if it really is YOUR code), you should be
    able to realize that your minimum and maximum never get set (thus they
    are both 0) and your exam 3 is set with the wrong value. SEE where
    those should get set and figure out why they're not. Chances are you
    are doing something to them that makes one 'if' fail or you just
    erroneously assign a wrong variable!

  • Double-clicking on Sender name to view full contact card

    Just upgraded to Outlook 2013 with Lync 2013, and so far I hate it.  In Outlook 2007, when I opened an email I could double-click on the sender's name and pull up its full contact card with all of the information that I had entered before, including
    their picture or company logo.  Now in the 2013 version, I get some light-weight pop-up showing some of the sender's info and either no picture or the picture that they included in Lync.  Is there any way of restoring the full contact card?  Also,
    is there any way to get the Reading Pane to show by default the picture that I assigned to that contact?

    Hi,
    When I click on the sender's name in an email, it opens the Outlook Properties dialog instead of the full contact editing form.
    If you want to open the full Contact Form in Outlook 2013, you can click on the View Source link of the Contact Card, and click the source
    Outlook (Contacts, your email address):
    For more information, please refer:
    http://www.msoutlook.info/question/727
    Regards,
    Steve Fan
    TechNet Community Support

Maybe you are looking for

  • Comunication série

    Bonjour, J'ai fait un programme permettant de lire et d'ecrire sur un port com , Je recoit les données du port com a travers un capteur one wire , ce qui veut dire que je recoit et envoi des infos sur le meme fils, ce qui me pose probleme c'est que q

  • Is there a mechanism in Java similar to Properties in C#?

    A friend of mine is working on a project in C#, and periodically I've been examining his source code, and commenting on how similar the syntax and programming style seems to be to Java. Recently my friend asked me a question about 'Properties', which

  • Lightroom and other applications not showing in Adobe Application Manager

    I have just installed the Adobe Application Manager several applications aren't list, for example lightroom. I have read that it might be due to my system spec, however I doubt that. My system specs are as follows: OS: Windows 8 Pro CPU: Core i7-362Q

  • Using the command key wont move file

    when i click and hold the command key and try to move any folder to another location, it copies file. what am i doing wrong? thanks

  • Logical stand by getting the error

    any one know where i can find this object, this is causing the logical standby to work properly. it seems to me internal objects. this informaiton i got from event oracle 10g 11-MAY-10 ORA-00955: name is already used by an existing object CREATE TABL