1 Working with dates
Unfortunately IWA 12.00 does not support neither MDY not TO_DATE when use a column to construct the date. When a query need to generate dates from a given date (start of year to end of year) we commonly use MDY. For example:
SET ENVIRONMENT use_dwa accelerate on; SET ENVIRONMENT use_dwa fallback off; SELECT MDY(1,1, YEAR(refdate)), MDY(12, 31, YEAR(refdate)) FROM table
As dynamic (with columns) MDY is not supported, query can not be accelerated. Using DATE is the only way but this makes app non transportable as DATE depends either on DBDATE or DBLOCALE environament variables.
IWA only support a static MDY as for example:
MDY(1,1, 2000)
2 View AQT views in schema output
The AQTs in the database system catalog are special views that cannot and should not be used or manipulated with SQL statements. Normally they also cannot be seen, e.g. in the output of the dbschema utility the AQT definitions will be suppressed. Under certain circumstances however it may be desirable to see the AQT view definitions. Setting the UNIX shell environment variable AQT before starting the dbschema utility will include the AQT view definitions in the output. Set the environment variable with a command like the following (Bourne shell syntax):
AQT=1 ; export AQT
(Source: Informix Warehouse Accelerator blog)
3 Common issues
3.1 Memory overflow with large fact table?
The following query produces an error after heavy IWA activity:
SET ENVIRONMENT use_dwa 'accelerate on'; SET ENVIRONMENT use_dwa 'fallback off'; SELECT DISTINCT point_type FROM fact_int_testorder; -- SQL ERROR: -26561 Default informix sqlcode returned because no corresponding informix error -- matched the drda sqlcode and drda sqlstate error returned by ISAO server. -- SQL STATE: IX000
But when a condition is used in the fact table the query returns successfully:
SET ENVIRONMENT use_dwa 'accelerate on'; SET ENVIRONMENT use_dwa 'fallback off'; SELECT DISTINCT point_type FROM fact_int_testorder WHERE point_type IS NOT NULL; -- OK Results...
The following query, with the oposite condition also ends with the same error:
SET ENVIRONMENT use_dwa 'accelerate on'; SET ENVIRONMENT use_dwa 'fallback off'; SELECT DISTINCT point_type FROM fact_int_testorder WHERE point_type IS NULL; -- SQL ERROR: -26561 Default informix sqlcode returned because no corresponding informix error -- matched the drda sqlcode and drda sqlstate error returned by ISAO server. -- SQL STATE: IX000
It seems that the problem come with the large number of rows with "point_type IS NULL":
SET ENVIRONMENT use_dwa 'accelerate on'; SET ENVIRONMENT use_dwa 'fallback off'; SELECT count(*) FROM fact_int_testorder WHERE point_type IS NOT NULL; -- OK: 194231819 row(s) SET ENVIRONMENT use_dwa 'accelerate on'; SET ENVIRONMENT use_dwa 'fallback off'; SELECT count(*) FROM fact_int_testorder WHERE point_type IS NULL; -- OK: 619140105 row(s)
4 Common errors
4.1 Error DRDATCPIPException after table mode change
When mode for a fact table is changed to RAW, trying to load an already loaded and active mart throws this error:
(U0001) - severe: AQT10205I: An internal processing error occurred in the stored procedure. Diagnostic information: DRDATCPIPException: A network connection is gone where it is not expected to be on message type 0x0000: Send failed because connection was reset by peer.
Workarround: drop/create mart before loading again.
4.2 error: AQT1OO5Ol: using non accepted data types or data precision
When using numeric fields with precions greater than 32 you can get the following error.
(u0001) - error: AQT1OO5Ol: An internal error occurred on the 'IWAl' accelerator: An assertion '"((mPrecision > 0 || belongsToTempTable == true) && (mSQLDataType = Column::Character || mSQLDataType == Column::varChar || mSQLDataType == Column::Graphic || mSQLDataType == Column::VarGraphic)) || (mPrecision > 0 && mPrecision <= 31 && mSQLDataType == Column::Decimal) || (mPrecision == 4 && mSQLDataType == Column::Real) || ((mPrecision == 4 || mPrecision == 8) && mSQLDataType == Column::Double)"' Error in line 1 Near character position 86
4.3 Error when creating a procedure which uses a DWA standard procedure
A severe error can occurr the first time we compile a procedure which uses a standard DWA procedure (ifx_createMart, ...). Let's conside the following situation:
create database test;
Now we try to create a procedure using one of the standard procedures to work with IWA:
CREATE PROCEDURE "informix".ifx_createmart_udf_iwa_wrapper( p_accell char(20), p_martdef clob ) EXECUTE PROCEDURE ifx_createMart( p_accell, p_martdef ); END PROCEDURE;
959: The current transaction has been rolled back due to an internal error.
172: ISAM error: Unexpected internal error
Note the error details appended to online.log:
19:33:52 Assert Failed: No Exception Handler 19:33:52 IBM Informix Dynamic Server Version 12.10.FC7W1WE 19:33:52 Who: Session(546, informix@dbsrv3, 23218, 0x573f2e48) Thread(638, sqlexec, 573b76a0, 1) File: mtex.c Line: 508 19:33:52 Results: Exception Caught. Type: MT_EX_OS, Context: mem 19:33:52 Action: Please notify IBM Informix Technical Support. 19:33:52 See Also: /home/informix/tmp/af.66666ff 19:34:12 Thread ID 638 will now be suspended.
At this point, we need to execute a statement using the procedure ifx_createMart to trigger the loading of the DWA module by the Informix server:
EXECUTE PROCEDURE ifx_createMart('x', 'y');
674: Routine (ifx_createmart) can not be resolved.
Note the details appended to online.log:
19:38:17 Loading Module <$INFORMIXDIR/lib/libdwa.udr> 19:38:17 The C Language Module </home/informix/lib/libdwa.udr> loaded
Now the DWA module is loaded in Informix and the procedure creation won't fail anymore:
CREATE PROCEDURE "informix".ifx_createmart_udf_iwa_wrapper( p_accell char(20), p_martdef clob ) EXECUTE PROCEDURE ifx_createMart( p_accell, p_martdef ); END PROCEDURE;
Routine created.