Issue of result cache

I create and populate the following table in my schema:
 create table plch_table (id number, time_sleep number);

begin
  insert into plch_table values (1, 20);
  commit;
end;
/ 
Then I create this function (it compiles successfully, since my schema has EXECUTE authority on DBMS_LOCK):
 create or replace function plch_func
  return number
  result_cache
is
  l_time_sleep number;
begin
  select time_sleep
    into l_time_sleep
    from plch_table
   where id = 1;
   
  dbms_lock.sleep(l_time_sleep);
 
  return l_time_sleep;
end;
/ 
I then start up a second session, connected to the same schema, and execute this block:
 declare
  res number := plch_func;
begin
  null;
end;
/ 
Within five seconds of executing the above block, I go back to the first session and I run this block:
 declare
  t1 number;
  t2 number;
begin
  t1 := dbms_utility.get_time;
  dbms_output.put_line(plch_func);
  t2 := dbms_utility.get_time;

  dbms_output.put_line('Execute in '||round((t2-t1)/100)||' seconds');
end;
/ 

what will be displayed after this block executes?

And the result is:

20
Execute in 30 seconds
However, I do not understand why? I mean what happens behind all this? Why the 30 result? Could someone tell me why?

Honestly, before the issue of PL/SQL challenge of yesterday, I had no idea how it worked either. It is much a deep internals question - you would probably pick up a post from presentation or very specialized blog get more details (or that you would have to do the research yourself). And even then, it is relatively unlikely that they would go in a lot more detail than the PL/SQL Challenge response has been. Julain Dyke result Cache Internals (PPT) is probably one of the more detailed presentations on the internals of the result cache.

All of the valid statuses for a result cache object are documented in the entry reference of Oracle database to the view v$ result_cache_objects. Delays second two 10 are controlled by the session level settings and database of the resultcache_timeout undocumented parameter (which, based on this blog by Vladimir Begun has been fixed at 60 seconds in 11.1.0.6 and changed to 11.1.0.7 to 10 seconds.)

Justin

Tags: Database

Similar Questions

  • Query result cache

    Today I test the query result cache, but the result is not as I expected. Please give a few advices.thank you in advance.

    SQL > create table (qrc_tab)

    Number 2);

    Table created.

    SQL > insert into qrc_tab values (1);

    1 line of creation.

    SQL > insert into qrc_tab values (2);

    1 line of creation.

    SQL > insert into qrc_tab values (3);

    1 line of creation.

    SQL > insert into qrc_tab 4;

    1 line of creation.

    SQL > insert into qrc_tab values (5);

    1 line of creation.

    SQL > create or replace function slow_function (p_id in qrc_tab.id%TYPE)

    2 back qrc_tab.id%TYPE DETERMINISTIC AS

    3 BEGIN

    4 DBMS_LOCK.sleep (1);

    5 return p_id;

    6 end;

    7.

    The function is created.

    SQL > set timing on

    SQL > select slow_function (id) in the qrc_tab;

    SLOW_FUNCTION (ID)

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

    1

    2

    3

    4

    5

    Elapsed time: 00:00:05.01

    SQL > select / * + result_cache * / slow_function (id) of qrc_tab;

    SLOW_FUNCTION (ID)

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

    1

    2

    3

    4

    5

    Elapsed time: 00:00:05.00

    SQL > select / * + result_cache * / slow_function (id) of qrc_tab;

    SLOW_FUNCTION (ID)

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

    1

    2

    3

    4

    5

    Elapsed time: 00:00:05.00

    SQL > select / * + result_cache * / slow_function (id) of qrc_tab;

    SLOW_FUNCTION (ID)

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

    1

    2

    3

    4

    5

    Elapsed time: 00:00:05.00

    I wonder why time is not fast? Help, please

    create or replace function slow_function (p_id in qrc_tab.id%TYPE)

    return qrc_tab.id%TYPE result_cache DETERMINISTIC AS

    Start

    DBMS_LOCK. Sleep (1);

    return p_id;

    end;

    /

    --

    John Watson

    Oracle Certified Master s/n

  • Using the ODP client result cache still shows it as running on AWR, is the work of cache?

    Hello

    I use the Oracle 12 manged customer ODP.net connected to a database of GR 11, 2. I recently went on the cache of results with great effectiveness.

    So, I thought I would try the result to the client cache. I have the setting turned on and restarted my db, but my questions always appear in the graphs of Enterprise manager and the AWR report. I would have thought if the query has been cached on the client, that it does not show.

    How will I know if it works or not?

    Thanks in advance.

    Adrian.

    Re-reading the original question, I missed the fact that you use managed ODP.NET. The client result cache does not support managed ODP.NET. Only unmanaged ODP.NET is because it uses the capacity, within the OIC, that uses the unmanaged code.

    I apologize for the misunderstanding.

  • Oracle result Cache problem

    Hello

    In our database, we have the following settings for caching the result:

    result_cache_max_result integer 5

    result_cache_max_size great whole 256256 K

    result_cache_mode chain MANUAL

    result_cache_remote_expiration integer 0

    But we use indicators no results hidden in questions, or tables that are enabled for result caching.

    So from my understanding, caching the result should not happen.

    But we met a performance problem, and when I checked the AWR report I found this:

    latchfree.PNG

    And also I found this activity latch:

    rclatch.PNG

    However, just set result_cache_max_size = 0 fixed to all our questions. Wait no more. Performance as expected.

    But how is that possible? I thought with result_cache_mode = manual and not using indicators of result cache or table modes,.

    There should be no result at all caching? Any max_size choose?

    Can someone help me understand what is happening here?

    Thank you and greet.

    Daniel

    tylerv wrote:

    The original poster was not to the point and they actually understand the docs.

    Sorry - I'm not okay. As I went to the docs are very EXPLICIT about how to disable the cache of result. If you turn it off, then it is enabled.

    The fact that they have tried to do is that when result_cache_mode is set to the default value of the MANUAL, because they showed, it is, while according to the docs 12 c only the results of queries that use the RESULT_CACHE indicator must be stored in the cache of result

    Maybe that's where you and OP have misunderstanding. on the RESULT_CACHE_MODE parameter and the parameter values. This seems to be a common misunderstanding.perhaps, because people are not read ALL the relevant articles of the RFSO and only looking at the section for this parameter.

    There is NOTHING in the doc of 12 c for this parameter that shows ANY correlation to determine whether the cache is enabled or not.

    Refer to the section "Setting the Mode of the result Cache"

    https://docs.Oracle.com/database/121/TGDBA/tune_result_cache.htm#CDEJCGJD

    As shown in table 15-3 there are ONLY two settings: MANUAL and FORCE. No adjustment said ANYTHING on toggle or if the cache is ENABLED or DISABLED.

    ... and they were not aware of all the queries that they had used this trick on.  When you're ready to values by default and don't use don't not result_cache indicator (as much), it's odd to find the cache of your result are so full.

    OK - the USER does not use the indicator result-cache to cache the results of the queries USERS. But if the cache is enabled (size not equal to zero) that according to the quote from the doc above has NO effect on the use of Oracle to cache for queries or non-deterministic function calls.

    I think a lot of people may be jumping on the server I mentioned first that article explicitly states that you must set the size to zero to disable hide and seek only to the section on setting the parameters.

    And that the "setting mode" section is confusing as it includes a paragraph that uses the expression "If you choose to activate the result cache.

    That subsection and the r-phrase likely cause people to think that the setting and the off/on State of the cache are one and the same.

    When the result cache is enabled, the database also highlights cache queries that call non-deterministic functions of PL/SQL. When caching SELECT statements that call functions, result cache dependencies of data for PL/SQL functions and titles of database objects. However, if the function uses the data that are not followed (such as sequences, SYSDATE , SYS_CONTEXT and package variables), uses the cache of result on queries that call this function can produce stale results. In this regard, the behavior of the cache of result is identical to the caching of PL/SQL functions. So always consider the accuracy of the data, as well as performance, if you choose to activate the result cache.

    But if all associated sections are interpreted in their context, it should clear up the misunderstanding.

    If you have a support contract, you can submit a request to have the documentation changed to update mode setting (table 15-3) article to explicitly declare the parameter mode does NOT determine if the cache is enabled or not.

    .

  • Update statement can be used depending on the result cache?

    Hi all

    I stumbled on an interesting question. UPDATE statement is used in the following function, even if the feature is created RESULT_CACHE. It seems illogical. I was wondering, is it possible?

    If so, why RESULT_CACHE is used?  Because it means "do not execute the function, look for the result of the hash table and return the results to the user ' if the UPDATE statement, so doesn't mean it should run for each call and use with RESULT_CACHE and UPDATE/DELETE/MERGE is illogical or wrong?

    Thanks for your help.

    FUNCTION to CREATE or REPLACE plch_get_data (FULL id_in)

    RETURN VARCHAR2

    RESULT_CACHE

    IS

    BEGIN

    Dbms_output.put_line ('run');

    UPDATE plch_data

    SET nm = UPPER (nm)

    WHERE id = id_in;

    COMMIT;

    RETURN "SUPERIOR."

    END;

    /

    Yes, it's the challenge of PL/SQL quiz - and the point of the quiz is only automatic relies on parsing by Oracle only supports arrays of account that is QUESTIONED.

    The tables that are affected by DML not a query as an update do not figure in automatic invalidation of a cache.

    I was hoping that the explanations given in the questionnaire itself would not lead to a thread - rather it would provide a pleasant and clear answer. So feel free to let me know if you think otherwise.

    As to why Oracle would let you include DML not a query inside a function of caching of result, well... I can easily accept that you shouldn't do this - in general. But I don't see that we should make it impossible. It would probably be a good candidate for an another PLW (PL/SQL warning), as in:

    "Non-requetes DML in a result caching function will not affect caching and can result in unexpected results."

  • Result Cache not used

    Hello

    I'm on Oracle Database 11 g Release 11.2.0.3.0 and Application Express 4.2.2.00.11

    How to use trick cache result?

    How do you get the same result shown in Figuree 3 (apex.oracle.com Application Express 4.2.6.00.03) ?

    I try to use the result cache but explain plan does not appear to be used (Figure 1)

    Then I tried ' alter table STUDENT result_cache (FORCE mode);  In figure 2, you could see that column in the table of students result_cache was changed to 'force' but explain the plan shows yet cache result being used.

    Figure 1
    result_cache1.jpg

    Figure 2

    result_cache2.jpg

    Figure 3 (from apex.oracle.com workspace)

    result_cache_correct.jpg

    Hello

    Thank you all for your answers.

    According to Oracle Help Center (11 g release 2) this is a feature reserved for Enterprise Edition. And Apex.oracle.com from today using Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production.

    While I'm using Oracle Database 11 g Release 11.2.0.3.0 - 64 bit Production it is why in the screenshots above I could not duplicate the result in apex.oracle.com

    https://docs.Oracle.com/CD/E11882_01/license.112/e47877/editions.htm#DBLIC116

  • Consider the function result Cache

    Hello

    Have a question about the function result to cache.

    Follow this link: http://www.oracle.com/technetwork/articles/sql/11g-caching-pooling-088320.html

    I use the following version of oracle: Oracle Database 11g Express Edition Release 11.2.0.2.0

    I'm doing using the feature of function result cache.

    Please find the source code used, below:

    create or replace function fnresultcahceg (empid employees.employee_id%type)

    employees.salary%type result_cache relies_on (employees) is back

    l_salary employees.salary%type;

    Start

    Select the wage in l_salary of employees where employee_id = empid;

    DBMS_LOCK. Sleep (1);

    Return l_salary;

    end fnresultcahceg;

    Try to run the function created above with the following:

    SQL > select fnresultcahceg (200) double;

    FNRESULTCAHCEG (200)

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

    4400

    Elapsed time: 00:00:01.15

    SQL > select fnresultcahceg (201) twice;

    FNRESULTCAHCEG (201)

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

    13000

    Elapsed time: 00:00:01.01

    SQL > select fnresultcahceg (200) double;

    FNRESULTCAHCEG (200)

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

    4400

    Elapsed time: 00:00:01.00

    SQL > select fnresultcahceg (201) twice;

    FNRESULTCAHCEG (201)

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

    13000

    Elapsed time: 00:00:01.01

    SQL > select fnresultcahceg (201) twice;

    FNRESULTCAHCEG (201)

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

    13000

    Elapsed time: 00:00:01.00

    SQL > exec dbms_output.put_line (fnresultcahceg (200));

    4400

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.04

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.03

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.01

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.00

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.00

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.01

    SQL > spool off;

    We could see no improvement in time elapsed execution.

    Have a doubt on the am I missed something / do wrong to the result of the setting of the cache settings.

    Have you tried with the following result cache settings

    ALTER SYSTEM SET result_cache_max_size = 2M RANGE = MΘMOIRE

    ALTER SYSTEM SET result_cache_remote_expiration = 2;

    ALTER SYSTEM SET result_cache_mode = {MANUAL |} STRENGTH} - two similar agronomic results

    The wait was to reduce the execution time after its first execution if the data remains the same.

    Please guide me in this regard.

    Thanks in advance,

    Sandeep.S

    > I use the next version of oracle: Oracle Database 11g Express Edition Release 11.2.0.2.0.

    PL/SQL function result Cache is only available in Oracle Database Enterprise Edition (EE).

    Concerning

  • Using the Client result Cache

    Hi all

    I have a question about the use of the result of the client cache but first of all, here is the information on my database:

    SQL> SELECT * FROM v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0    Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    

    I installed the Oracle Client Tools on my clientmachine. There a tnsnames.ora like this:

    ORCL =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = FEA11-119SRV)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = orcl.local)
        )
      )
    
    

    The result of the Client Cache is configured in the sqlnet.ora.

    ADR_BASE = /u01/app/oracle
    OCI_RESULT_CACHE_MAX_SIZE= 2048000
    OCI_RESULT_CACHE_MAX_RSET_SIZE = 1024000
    NAMES.DIRECTORY_PATH = (EZCONNECT, TNSNAMES, HOSTNAME)
    
    

    The Databaseserver is configured like this:

    
    SQL> col name format a30
    SQL> col value format a30
    SQL> SELECT name, value
      2  FROM   v$system_parameter
      3  WHERE  name LIKE '%result_cache%';
    
    NAME                   VALUE
    ------------------------------ ------------------------------
    result_cache_mode           MANUAL
    result_cache_max_size           0
    result_cache_max_result        5
    result_cache_remote_expiration 0
    client_result_cache_size       1073741824
    client_result_cache_lag        3000
    
    

    After you set up a client's server, I try the SQL query on the clientmachine followign:

    sqlplus oracle/password@orcl
    
    set autotrace traceonly explain
    
    SELECT /*+ result_cache */ *
    FROM testtable;
    

    You cannot enable the customer with SQL result cache * more, no matter what you do with parameters. If you install the CD examples, you will find examples of code in cdemoqc.c and cdemoqc2.c that shows how with the OCI calls.

    You probably want to use the result of the server cache, there is a full demo of this here,

    Using the SQL Oracle 11g result Cache

    --

    John Watson

    Oracle Certified Master s/n

  • Result Cache indicator

    Hi all
    What are the restrictions of use result indicator cache on queries? How to use Union or join or subqueries? What doc should I read about it?

    Also, I run the following queries on the HR diagram example:
    select first_name,(select /*+ RESULT_CACHE */ last_name from employees where employee_id=100) from employees;
    select first_name from (select /*+ RESULT_CACHE */ first_name from employees);
    Using
    select name, value from v$result_cache_statistics where id=7;
    I can check if the first subquery, where it is evaluated in each row, using no indicator result hides while the second use on. How do I?

    Best regards
    Val

    Select first_name, (select / * + RESULT_CACHE * / last_name of employees where employee_id = 100) of employees;

    (Of course, this is an artificial example, but one) result_cache indicator does not work in a scalar subquery, unless you move out in a CTE first (WITH clause) and b) without result caching, you will benefit from [url http://www.oratechinfo.co.uk/scalar_subqueries.html] scalar subquery caching anyway.

    You might also be interested in some of the debates on this topic:
    Problem with caching the result

  • Result Cache in oracle 11g release 2.0.2.0

    All,

    A few months ago I tried function result Cache 11 g version 2.0.1.0. The oracle of time mentioned that they have 3 ways to use this feature by setting the parameter result_cache_mode AUTOMATIC, MANUAL or FORCE. With AUTO (result_cache_mode = AUTO) mode you can identify the queries that can benefit from the cache of the result. I would like to know what views or function I see where he captures this information.
    In 11.2.0.1.0 documentation he was making reference to certain points of view (totally forgot the names of views) and said: those that will be available in 11.2.0.2.0.

    Did anyone know about this?

    Thanks in advance.

    user2486753 wrote:
    Although doc oracle didn't tell on AUTO it is still accepts this value and caches the result of the SQL query if you add / * + cache result * / allusion to the SQL.
    I know that they mentioned in 112010 somewhere that will help users find what SQL is good candidates for caching by running the app for a while. I couldn't just fine there.

    If we add AUTO and always passing the tip, this is the same behavior as MANUAL. I'm not sure I've seen the value of anywhere and neither its there in the docs too.

    HTH
    Aman...

  • TimesTen and Oracle 11 g result cache

    Oracle 11g introduces the concept of cache the result whereby the result set of frequently executed queries are stored in the cache and used later when other users ask the same query. This is different from the caching of the data blocks and exceuting the query over and over again.

    Tom Kyte calls this materialized view just-in-time, in which case the results are dynamically evaluated without DBA intervention

    http://www.Oracle.com/technology/oramag/Oracle/07-Sep/o57asktom.html

    My point is that, given utilities like result_cache and possibility to use Solid State Disks in Oracle to accelerate physics I/O etc. is necessary for a product like TimesTen? It seems to me he could asdd just another layer of complexity?

    Oracle cache there result a useful tool, but it is significantly different from TimesTen. My understanding of the Oracle result cache is caching the results for rarely changing data such as search (currencies/identification code) tables, data reference that do not change often (list of counterparties) etc. It would be pointless to cache the result set when the data changes frequently.

    There is also another argument for the cache of SQL result that if you hit high on your CPU usage and that you have enough memory, then you can cache some defined thus results save on your cycles CPU.

    In view of the arguments on the wired RDBMS and drives (SSD), we can talk all day, but with SSDS does not eliminate the consideration for physical i/o optimizer. A table scan is a table scan if the data resides on disk SCSI or SSD. SSD will be faster, but we are still running physical IOs.

    What about TimesTen, the positioning of the product is different. TimesTen is closer to average than Oracle. It is designed to work closely at the application layer, while Oracle aims much more wide. There is no way one can replace TimesTen with any RDBMS wired for volumes of moderate and real-time response. Demand for the result cache has been around for a while. In areas like trading program and data on the market when the underlying data changes quickly, TimesTen will come handy, because time real/provisional data and calculations must be made almost in real time, with fewer complications of the execution engine. I don't see how we can deploy the result cache in this scenario. Due to underlying data change, Oracle is obliged to calculate queries almost everytime and the cache of result will be just wasted.

    Hope this helps,

    Mich

  • Back to search results Cache problem

    Hello

    A customer has just attracted my attention on a problem that seems to touch a lot of my and other sites of BC:

    JEALOUS. Contemporary Gallery, prints and Studio.

    http://wiredforwine.com/

    eCatalyst eCommerce website demo

    If you are looking for something (or product site search), click an item, and then use the back button of browser, you get the cache errors.

    What is happening at least in Chrome, Firefox and IE. I get these errors:

    [Chrome Mac]

    Confirm form submission

    ERR_CACHE_MISS

    Hide details

    This Web page requires data that you entered earlier in order to work correctly. You can send these data again, but in doing so, you will repeat any action this page made previously.

    Reload this Web page

    Press the button reload the data required to load the page again.

    [Firefox Mac]

    Document expired

    This document is no longer available.

    The requested document is not available in the cache of Firefox.

    Safety precaution, Firefox don't re-request not to automatically sensitive documents.

    Click try again to re - apply for the document from the website.

    [IE Windows]

    Page Web has expired

    The most likely cause:

    The local copy of this Web page is obsolete and the Web site requires that you download again.

    Something to try:

    Click the Refresh button in the toolbar to reload the page. After refreshing, you need to navigate to the Web page again, or re-enter information.

    The other encountered this problem? Is it because of how BC uses the browser's cache? is there a solution?

    Thank you

    Paul

    This is probably caused by the shoppingcartsummary module.

    Whenever you have it, this page will not be cached for obvious reasons, and working up the browser wants to redo the JOB and warns you

    Turn it off in the... search results page and use the liquid instead.

  • Sqlplus 10G result cache

    Hello
    We try to write an application to analyze the performance of our database.

    The problem now is that the sqlplus or the database is cached results.
    We use a 10g and 11g database

    Does anyone know how to do not cache the results

    Thank you * T

    N °

    The execution of a statement has three phases:

    parse
    run
    Fetch

    If a statement is presented for the first time, it will be analyzed and it will be in the shared pool.
    Oracle will determine a plan
    Subsequently, the statement is executed. If the data in the table are not in the cache buffers, Oracle will perform physical reads to get it into the buffer cache.

    Suppose for a moment, the same statement is executed once again
    Oracle will find the statement in the shared pool, so the statement that is not re-analyzed and no plan will be determined.
    Oracle will re - run the statement.
    If the data in the table are still in the buffer cache, Oracle just obtain data from the buffer cache.

    The buffer cache is currently limited in size, and your statement is not executed for awhile. Other statements are executed.
    Assume that your data will age to the buffer cache, but your statement is not age out of the shared pool.

    Then you must re - run the statement. It is not re-analysis, as it is still in the shared pool. Execution, Oracle will perform physical i/o again, in order to recover the data in the buffer cache.

    Now you re - run the statement, but this time your bind variables have different values. Oracle will only reassess the statement and determine a new explain plan (this is called a "child cursor")

    The situation you seem to want to force you will almost never have.
    In addition, usually the SQL you are running should not be 'random', so some time after you start the database, Oracle will not need to analyze all the time and will be able to obtain data from the buffer cache.

    Once that empty you the shared pool (all versions) or disable the buffer cache, Oracle will have to redo all integer.
    But it is a situation normally you won't and shouldn't need to have.

    ------------
    Sybrand Bakker
    Senior Oracle DBA

  • Query results cached in DBlink (of 8.1.7.4.1-> 9.2.0.8)

    I met a strange problem today...


    I have 2 versions of oracle version 8.1.7.4.1 running on Win2k and a 9.2.0.7 running on a win2k3 server... Both versions are standard edition 32 bit OS

    version 9i has been improved from 9.2.0.6 to 9.2.0.8 and begun the issued after that.

    1 link to DB on a database of 8 with a link to Oracle 9

    Query:
    sql> select family_name from hrm_employee@db92 where <columnname>='1234' and <columnname>='MARAN'
    
    This result is one row
    
    but when i try again with a different values to the column it still throws me the same result set which is supposed to return no rows
    
    sql> select family_name from hrm_employee@db92 where <columnname>='1234' and <columnname>='MARAN DUMMYVALUE'
    Returns the same line... that was returned by the previous query. but it works perfectly when I connect from an another 9.2.07 against the 9.2.0.8 db

    I raised to support oracle but it looks like a bug?

    If someone met before...

    Published by: Maran Viswarayar January 12, 2010 11:35

    Published by: Maran Viswarayar January 12, 2010 11:42

    Yes, I remember some weird side effect when the value of this parameter is not CORRECT on Oracle<>

    Nicolas.

  • The query results cached?

    Hi guys,.

    I have this page that calls the same query (on a database link!) four times! First when an initial LOV is generated (and the page loads), again for an another LOV based on the original and finally for the generated report based on the 2 selections. It's insanely slow (30-40 seconds on each load ~) and also: when you try to sort a report interactive by clicking on the column name, and then queries the database again (I assumed that this part has been cached but apparently not). I so need to caching the results of an initial request and then just limit the results locally. How can I do this? Guides? Examples?

    Thanks for help.

    Mike

    I tried this example based on a view:

    CREATE MATERIALIZED VIEW MV_TEST2
         REFRESH COMPLETE
         START WITH SYSDATE
         NEXT  SYSDATE + 1/48
         WITH ROWID
         AS SELECT * FROM test1;
    

    DISCOUNT COMPLETE - The complete refresh recreates together materialized view.
    START WITH SYSDATE - run now
    NEXT SYSDATE + 1/48 - run again in half an hour
    WITH ROWID - I think that this option is important if you are using a partial refresh of the view.
    AS SELECT * FROM test1; -test1 is a point of view:

    CREATE OR REPLACE VIEW TEST1 AS
    SELECT st_id, st_name
        FROM aaw_solution_tree;
    

    Index of the column are still possible? I do not know:
    Indexing:! in regards to the MV about 10 gr 2 Jonathan Lewis wrote. ... you are allowed to create indexes on tables that sit under materialized views - just don't make them unique indexes

    How much freedom is there to set the refresh rate?
    What kind of discount do you need?

    Another useful link: [http://asktom.oracle.com/pls/ask/search?p_string=materialized+view | http://asktom.oracle.com/pls/ask/search?p_string=materialized+view]

    It will be useful.

    Tobias

Maybe you are looking for