In short: OLTP applications frequently encounter performance issues because DB2 enables table compression by default for all DGTTs / CGTTs.
Details from a real-time example:
When inserting 40K rows to a DGTT, it takes 2 seconds.
When we immediately insert another 40K rows to the same DGTT using the same INSERT statement, it takes 0.08 seconds.
This has nothing to do with caching. It is because compression is enabled by default for all DGTTs / CGTTs and this is the overhead of generating the compression dictionary.
DB2 only generates the compression dictionary if a certain amount of data is inserted (based on my tests, this was around 25K rows). The same applies to CGTTs.
What this means is that any proc which inserts > 25K rows (approx.) into a DGTT / CGTT will incur this significant overhead every time it is executed.
So procs that should take 0.08 seconds to execute will consistently take 2 seconds.
Most OLTP applications create small (and short-lived) temporary tables and therefore don't benefit from table compression. Having the ability to disable table compression will significantly improve query performance in many cases.
|Who would benefit from this IDEA?||All applications using small DGTTs / CGTTs.|
How should it work?
Preference 1: Add the COMPRESS clause to the “CREATE/DECLARE GLOBAL TEMPORARY TABLE” syntax.
DECLARE GLOBAL TEMPORARY TABLE SESSION.MY_DGTT (ACCOUNT CHAR (9) NOT NULL) ON COMMIT PRESERVE ROWS COMPRESS NO
Preference 2: Introduce an instance-level or DB-level configuration parameter or registry setting to disable table compression for all DGTTs / CGTTs.
|Priority Justification||Frequent performance issues for OLTP workloads relying on DGTTs / CGTTs.|
|Customer Name||Morgan Stanley|
NOTICE TO EU RESIDENTS: per EU Data Protection Policy, if you wish to remove your personal information from the IBM ideas portal, please login to the ideas portal using your previously registered information then change your email to "email@example.com" and first name to "anonymous" and last name to "anonymous". This will ensure that IBM will not send any emails to you about all idea submissions