Our company has (finally) begun an upgrade from Informix 12 to Informix 14, the version that we are trying to certify for our ERP software. We managed to migrate the 12.10FC14 instance to 14.10FC11 on an AIX 7.3 O/S platform.
All went well and we have the instance up and running. But one thing we discovered was that on Informix 14, some of our queries are much slower than they were on the previous server. For example, we have an order entry program that does a lookup on the orders table, and just initiating the query takes 2 seconds on the old system, and 12 seconds or more on the new server.
I have run UPDATE STATISTICS to make sure that the database/tables are up to date. I ran an oncheck -ci to confirm we have no corruption reported in the affected tables. Nothing I do seems to improve the performance.
The one difference that I noted was when I activated the SET EXPLAIN ON to try and determine where the slowness lies. On the new server, it indicates that a sequential scan was done instead of using the system generated primary key (1675-44183). See below.
NEW SERVER (Model 9105-41B, Memory: 56832MB)
QUERY: (OPTIMIZATION TIMESTAMP: 02-14-2025 11:53:04)
------
select /*+INDEX(ortorh_rec orh_key) */ * from ortorh_rec where ORH_REF_BRH =
'HOU' and ORH_ORD_NO >= 0 ORDER BY ORH_REF_BRH, ORH_ORD_NO
DIRECTIVES FOLLOWED:
DIRECTIVES NOT FOLLOWED:
INDEX ( ortorh_rec orh_key ) Invalid Index Name Specified.
Estimated Cost: 573368
Estimated # of Rows Returned: 145519
Temporary Files Required For: Order By
1) informix.ortorh_rec: SEQUENTIAL SCAN
Filters: (informix.ortorh_rec.orh_ref_brh = 'HOU' AND informix.ortorh_rec.orh_ord_no >= 0 )
Query statistics:
-----------------
Table map :
----------------------------
Internal name Table name
----------------------------
t1 ortorh_rec
type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t1 145519 145519 791848 00:01.24 290590
type rows_sort est_rows rows_cons time est_cost
------------------------------------------------------------
sort 4 145519 145519 00:04.14 282778
OLD SERVER (Model 9009-22G, Memory: 61440MB)
QUERY: (OPTIMIZATION TIMESTAMP: 02-14-2025 12:21:26)
------
select /*+INDEX(ortorh_rec orh_key) */ * from ortorh_rec
where ORH_REF_BRH = 'HOU' AND ORH_ORD_NO >= 0
ORDER BY ORH_REF_BRH, ORH_ORD_NO
DIRECTIVES FOLLOWED:
DIRECTIVES NOT FOLLOWED:
INDEX ( ortorh_rec orh_key ) Invalid Index Name Specified.
Estimated Cost: 974511
Estimated # of Rows Returned: 147179
1) informix.ortorh_rec: INDEX PATH
(1) Index Name: informix. 1675_44183
Index Keys: orh_ref_brh orh_ord_no (Serial, fragments: ALL)
Lower Index Filter: (informix.ortorh_rec.orh_ref_brh = 'HOU' AND informix.ortorh_rec.orh_ord_no >= 0 )
Query statistics:
-----------------
Table map :
----------------------------
Internal name Table name
----------------------------
t1 ortorh_rec
type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t1 4 147179 4 00:00.00 974511
I guess what I am trying to understand is why it uses the primary key on IDS 12.10 but ignores it on 14.10 ? The same key exists on both servers.
I suspect I will need to drop the primary key, and then recreate it using the expected name (orh_key). Just not sure why it would react differently when this instance was an exact copy (created using ontape redirected restore to build the instance on a new server).
------------------------------
Steve Nixon
------------------------------