Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Executing a query just once without it using any cache

    Posted Thu January 15, 2026 12:42 AM

    Hi everyone,

    I'm using Informix 14.10.FC8 and I'd like to execute a query just once without it using any cached plan or statement cache - basically, I want it to be fully re‑parsed and re‑optimized for testing purposes.

    Is there any supported way (per‑session or per‑statement) to run a query without using the cache, or to force a one‑time reoptimization without disabling caching globally?

    Thanks in advance!



    ------------------------------
    Sh To
    ------------------------------


  • 2.  RE: Executing a query just once without it using any cache

    Posted Thu January 15, 2026 05:54 AM

    You can disable the statement caching during any session, assuming that it is even active (most sites do not enable statement caching), with the SET STATEMENT CACHE OFF statement:

    SET STATEMENT CACHE statement
    Use the SET STATEMENT CACHE statement to turn on caching or turn off
    caching for the current session. This statement is an extension to the ANSI/ISO
    standard for SQL.
    Syntax
    ►► SET STATEMENT CACHE
     ON
     ►◄
    OFF

    You cannot disable data caching, however. but that will not effect the optimization of the statement, only its execution time after the first attempt.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 3.  RE: Executing a query just once without it using any cache

    Posted Thu January 15, 2026 06:02 AM

    Thanks

    In fact, we need the execution time to be like the first attempt.



    ------------------------------
    Samuel To
    ------------------------------



  • 4.  RE: Executing a query just once without it using any cache

    Posted Thu January 15, 2026 06:27 AM

    The only thing you could do then, is:

    a) Run it twice and use that second data cached timing for further testing, or

    b) Use the "onmode -B reset" to flush and initialize the cache, but that will affect all sessions.

    There is no way to set a session to not use the cache.



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 5.  RE: Executing a query just once without it using any cache

    Posted Thu January 15, 2026 07:02 AM

    Thanks



    ------------------------------
    Samuel To
    ------------------------------