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
Expand all | Collapse all

Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

  • 1.  Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Mon January 19, 2026 05:59 AM

    Hi community,

    We are still testing for Migration from 14.FC4W1 and 14.FC11 to 15.0.0.2.

    During our tests we recognized, that only after activating Infrastructure Level (IL) 1, a specific script which usually takes about 240 seconds suddenly took over 2 hours.

    When setting

    TABLE_SIZE SMALL

    in onconfig, the script now runs with acceptable 247 seconds.

    During my investigation, the query plan (SET EXPLAIN ON), was exactly the same in 14, 15 IL0 and IL1. That's why i finally thought it might have to do something with SMALL/LARGE tables in IL1.

    The second statement in the script - which is the sql which really took long with IL1 - is a

    insert into t select ... from a, b ... where ... <join condition>

    while the first statement is a

    create temp table t ...

    So i suppose when TABLE_SIZE LARGE (default) was set in onconfig, the temporary table was created as LARGE table. And that the time was spent on converting the SMALL table data from the select into the temp LARGE table.

    However, can it be that this has such a huge impact? And further more: What type of temp table (SMALL/LARGE) to use if we finally have a "real" LARGE table? Or if we join a "real" LARGE table to a "real" SMALL table?

    Or are there any best practices (in the interwebs) how to deal with this situation?



    ------------------------------
    Emanuel Reisinger
    Axians ICT Austria GmbH
    ------------------------------


  • 2.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Mon January 19, 2026 07:03 AM

    Hmm - interesting.

    Inserting into a large temp. table does not convert anything. Is simply creating a new temp. table in the LARGE page format. (in my understanding so far)
    This should not make such a difference. 
    Can we please get a case?
    And can you please share the "repro"? I think we need some amount of data to see a difference.

    What also would be interesting is a SQLTRACE. This should tell in more detail where the time is spend. 



    ------------------------------
    Hedwig Fuchs
    ------------------------------



  • 3.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Mon January 19, 2026 07:09 AM

    Case is already initiated from my colleague (TS021230355), as you already have seen.



    ------------------------------
    Emanuel Reisinger
    Axians ICT Austria GmbH
    ------------------------------



  • 4.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Mon January 19, 2026 07:20 AM
    This may be fixed in the recent 15.0.1.0 release. I know that there were several performance improvements in this release. Let's see what the case returns. 

    Note also that you could have the script explicitly create the temp table as a SMALL table.

    Art

    Art S. Kagel, President and Principal Consultant
    ASK Database Management


    Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference.  Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.









  • 5.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Tue January 20, 2026 09:56 AM

    What you're observing is consistent with how Informix 15 behaves after IL1, and yes-TABLE_SIZE can have a surprisingly large impact, especially with temp tables. When TABLE_SIZE LARGE is set, temp tables are created as large tables by default, which introduces additional overhead (page structures, extents, logging behavior). Even if the query plan looks identical, the physical work involved in inserting data into a LARGE temp table can dramatically increase execution time, which explains the jump from minutes to hours.

    As a general practice, use SMALL temp tables whenever possible, even if the source or target tables are LARGE. Temp tables benefit far more from lightweight structures than from matching the size class of base tables. Only use LARGE temp tables if you truly expect them to exceed SMALL table limits. For mixed joins (LARGE + SMALL), the temp table does not need to match the largest table-what matters is expected row volume and lifespan. Many teams explicitly set TABLE_SIZE SMALL during migrations for this reason, as IL upgrades can expose these performance differences.

    Off-topic note: Clear structure and efficiency matter outside databases too. In a different field, https://www.aftermathbailbonds.com/ follows a similar principle by keeping information simple and accessible, helping people in Tampa quickly understand bail bond options during time-sensitive situations.



    ------------------------------
    Leo Parker
    ceo
    Bail Bonds Tampa
    ------------------------------



  • 6.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Tue January 20, 2026 12:56 PM

    I, frankly, would be curious to learn about any such overhead - off the top of my head, I couldn't think of much.

    The only substantial difference I'd see are wider index entries, but not why this would be making such a performance difference.

    So yes, we should get to the details of this actual case.
    For instance

    • how wide are the rows?
    • are legacy blob types (BYTE/TEXT) involved?
    • do we even have indices?
    • is this a logged temp table?

    Andreas



    ------------------------------
    Andreas Legner
    Informix Dev
    HCL Software
    ------------------------------



  • 7.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Wed January 21, 2026 09:40 AM

    Hi,

    I opened a case and the really interesting thing is, that even if we change the query to "unload to '/dev/null' select ..." (so no temp tables involved), the temp tables are utilized when $ONCONFIG:TABLE_SIZE=LARGE and things get slow (while not when TABLE_SIZE=SMALL).

    I will keep you updated with the outcome.

    BR

    Wilhelm SEYERL



    ------------------------------
    Wilhelm Seyerl
    ------------------------------



  • 8.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Thu January 22, 2026 03:15 AM

    Hi Leo, 

    About your advice:

    As a general practice, use SMALL temp tables whenever possible, even if the source or target tables are LARGE.

    It would be nice to avoid application code changes because of this Informix behavior, and force programmers to use 

    CREATE SMALL TEMP TABLE ...

    All over the place.

    Would it not be possible to add an ONCONFIG parameter to defined the default size mode for temp tables?

    TEMP_TABLE_SIZE = { SMALL | LARGE }

    That would overwrite the definition of TABLE_SIZE.

    Side note: in the ONCONFIG file created after installation, I can read following comment for the TABLE_SIZE parameter:

    # TABLE_SIZE     - The default size of newly created permanent tables.

    It should read:

    # TABLE_SIZE     - The default size of newly created permanent and temporary tables.

    Seb



    ------------------------------
    Sebastien FLAESCH
    ------------------------------



  • 9.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Thu January 22, 2026 06:00 AM

    Sebastien:

    Good suggestion. Make it an RFE and publish the link here so we can vote on it.

    Art



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



  • 10.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Thu January 22, 2026 06:37 AM

    Hello Art!

    https://ideas.ibm.com/ideas/INFX-I-697

    Seb



    ------------------------------
    Sebastien FLAESCH
    ------------------------------



  • 11.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Thu January 22, 2026 06:40 AM

    Upvoted, though I wonder what the response will be to the speculation that all temp tables are always SMALL when IBM/HCL notices.

    Art



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



  • 12.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Thu January 22, 2026 06:30 AM

    Hi,

    As i wrote yesterday i'm still checking with the experts what is actually going on. And i have to be more precise. With $ONCONFIG:TABLE_SIZE LARGE the temp DBSpaces (not temp tables as i wrote) get heavily utilized in our specific query. Allthough we changed the query to "unload to '/dev/null' select ...".

    It was just my first wild guess as switching between SMALL and LARGE in $ONCONFIG had such a huge impact. And in the first version the rows were actually inserted into a user created temp table. But as no user created temp tables are involved in the current test setup and temp DBSpaces are still heavilly utilized my first assumption seems quite wrong.

    So user created temp tables might still be SMALL regardless of $ONCONFIG:TABLE_SIZE.

    BR

    Wilhelm



    ------------------------------
    Wilhelm Seyerl
    ------------------------------



  • 13.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Fri January 23, 2026 10:04 AM

    Just chiming in here to echo Andreas' point that we believe something else is going on here (aside from large vs. small), and are working to get to the bottom of it asap. As far as I know we're still unable to reproduce the problem internally but we're anxious to do so.

    As far as we're concerned large tables, whether permanent or temporary, should perform as well as small tables. Indexes on large tables will have a slightly larger footprint, so you can expect some small difference in I/O performance since more I/O will be necessary to store the same key information, but caching should negate most of this. If large rowids are having a real performance impact we'll want to hear about it. Any significant difference between the performance of large and small tables, all else being equal, would be unexpected and considered a defect. Our internal TPC benchmarks (admittedly, fully cached) do not show a noticeable difference.

    Note that user-created temp tables (create temp table..., select into temp) already default to small. You have to explicitly use the 'large' keyword when creating them in order to override the default. This is also true of all tables in system databases (sysadmin, sysha, sysuser, sysmaster, sysutils).

    Sorry for the problem Emanuel. Once we figure out what's behind your performance problem we'll make sure this thread is updated.

    Thanks.

    -jc



    ------------------------------
    John Lengyel
    ------------------------------



  • 14.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Mon January 26, 2026 02:57 AM

    Hi jc,

    I would like to mention that I've started this post in behalf of my colleague Wilhelm Seyerl because he had troubles to get the initial post online. He also opened the case and works on this issue from our side. So I'm informed all the time.

    But of course all other readers will be pleased to be informed of the outcome.

    Thank you!



    ------------------------------
    Emanuel Reisinger
    Axians ICT Austria GmbH
    ------------------------------



  • 15.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Wed January 28, 2026 08:08 AM

    Hi,
    Just a little update. The behavior we saw with temp dbspace/chunks after either
    - activating $ONCONFIG:TABLE_SIZE=LARGE and engine restart
    - onmode -wm TABLES_SIZE=LARGE
    seems merely a symptom not the cause.

    I shortened the time ranges a bit. So counters may differ from my last posts. And the query starts now with "unload to /dev/null". So no more reason for temp dbspace/chunk activity.

    With the time ranges, when we run the SQL first time (with empty buffers after engine restart or onmode -B reset) with LARGE it needs ~ 2400 seconds (compared to 60 seconds with TABLE_SIZE SMALL) and there is activity in the temp dbspaces/chunks. But when we run the SQL a second time (with buffers filled) there is no more noticeable temp chunk activity, but it still needs 2000 seconds (~52 seconds with TABLE_SIZE SMALL).

    So there is currently no indication, that TABLE_SIZE is influencing the size (SMALL/LARGE) of temporary tables created. My wild guess set me on the wrong track.

    Support was not able to reproduce behavior with mock-up data. So i got a script from them to collect stats. These stats are currently under investigation.

    So, if someone is affected by performance drops of specific SQLs in 15.0.0.2 after activating Infrastructure Level 1 and onstat -g cfg TABLE_SIZE answers LARGE (as it is the default in onconfig.std), it might be worth to give
    - onmode -wm TABLE_SIZE=SMALL
    (changes running engine and takes effect in our case immediately)
    and eventually
    - onmode -wf TABLE_SIZE=SMALL
    (changes $ONCONFIG for future engine restarts)
    a try for the moment.

    I will keep this thread updated.



    ------------------------------
    Wilhelm Seyerl
    ------------------------------



  • 16.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Fri January 30, 2026 06:44 PM

    Update: Fix found and should be available in the next V15.0.1.x CSB.

    Wilhelm, Hedi and Holger worked together to come up with a repro for development, which was key. The problem was a V15-specific glitch in the kernel that prevented us from releasing a lock during a table drop. Ordinarily this problem isn't noticeable, because the lock is eventually released during commit or when the session exits. But the repro here is a single query that is processed under the covers by creating and dropping 2.7 million temp tables. The unreleased locks prevent us from re-using pages in the temp dbspace's partition partition, so that partition grows and grows. Meanwhile the huge and constantly growing lock table slows the processing of this query to a crawl.

    So why the TABLE_SIZE connection? The failure to release the lock during the drop only happens with large tables, and although it's true that user-created tables are always small unless explicitly created with the "LARGE" keyword, these 2.7 million temp tables are internal objects created implicitly during the query, and whether they are large or small will depend on the TABLE_SIZE setting.

    Why would we want internal temp tables to be large? After all, aren't they short-lived and usually quite small, as in this case? Well, given that permanent tables can now contain gigantic amounts of data it's possible a query or upsert will need an enormous interim result set. Since users can't control the creation of internal temp tables we take the conservative approach of following TABLE_SIZE.

    -jc



    ------------------------------
    John Lengyel
    ------------------------------



  • 17.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted Fri January 30, 2026 06:48 PM

    "...it's true that user-created tables are always small..."   --> "...it's true that user-created temp tables are always small..."



    ------------------------------
    John Lengyel
    ------------------------------



  • 18.  RE: Informix 15.0.0.2 IL1: Insert from SMALL table into temp LARGE table very slow

    Posted 20 days ago

    Great discussion here-small technical adjustments can really make a big difference in performance. That's the value of communities like this: sharing insights that help everyone improve and optimize.



    ------------------------------
    Franklee
    ------------------------------