Hi Mark,
Perhaps disabling the models will help.
Simplify Query Performance Tuning with the Db2 AI Query Optimizer - International Db2 Users Group
There are two ways to disable a model. One way is by providing the name of the model to disable,
and the second way is to use the name of the associated table. For example, here are the two ways to disable the model for the EMPLOYEE table:
ALTER MODEL SYSIBM.SQL241021170053621900 DISABLE;
ALTER MODEL ON SAMPLE.EMPLOYEE DISABLE;
Of course, in order to use ALTER MODEL, the model must already exist, so disabling the model in this way is a measure that can be useful in situations where an existing model needs to stop being used for all queries that involve the associated table.
You can see which models are enabled and disabled by running the following query on the SYSCAT.AIOPT_TABLECARDMODELS catalog view:
SELECT
VARCHAR(MODELSCHEMA, 25) AS MODELSCHEMA,
VARCHAR(MODELNAME, 25) AS MODELNAME,
VARCHAR(TABSCHEMA, 25) AS TABSCHEMA,
VARCHAR(TABNAME, 25) AS TABNAME,
ISENABLED
FROM
SYSCAT.AIOPT_TABLECARDMODELS
WHERE
TABSCHEMA = 'SAMPLE' AND
TABNAME IN ('EMPLOYEE', 'PROJECT');
The ISENABLED column is 0 when the model is disabled and 1 when the model is enabled:
To re-enable the model, the same DDL statements can be executed above by replacing the DISABLE clause with ENABLE:
ALTER MODEL SYSIBM.SQL241021170053621900 ENABLE;
ALTER MODEL ON SAMPLE.EMPLOYEE ENABLE;
Best regards, Joachim
------------------------------
Joachim Müller
------------------------------
Original Message:
Sent: Wed January 28, 2026 08:32 AM
From: Mark Gillis
Subject: Webinar: Experience the Power and Simplicity of the AI Query Optimizer in Db2 12.1.3
Hi
I asked a question yesterday about quantifying the results of the AI Optimiser. I thought that I could do some comparative examination of the access paths by switching off the AI optimiser but it looks as if I have misinterpreted the options. What I am doing is
- extracting the contents of the package cache using
db2advis -d dbname -q schema -g -p –noxml - executing db2exfmt against the extracted workload using
db2exfmt -d dbname -g TIC -w 2026-01-28% -n % -s % -# 0 -o Workload_2026-01-28_AIOPT_on.db2exfmt - looking in that output I can see many references to "Table Cardinality Model Predicates:"
- I then try and switch off the AI Optimiser using
UPDATE DATABASE CONFIGURATION FOR AWSSIT USING AUTO_AI_OPTIMIZER OFF;
UPDATE DATABASE CONFIGURATION FOR AWSSIT USING AUTO_MODEL_DISCOVER OFF; - and re-run the db2exfmt command
However, there are still references to the Table Cardinality Model Predicates so the existing models are still being evaluated.
How should I 'switch off' the use of the existing AI models in order to do this comparative check on traditional and AI cardinality evaluation?
Regards
Mark Gillis
------------------------------
Mark Gillis
Principal Consultant
Triton Consulting
------------------------------