Hi Guru's.
I need some pointers from the experts so I can put in my own hard work and swat up on the right subjects, i'm still new. Lot of detail here to ensure I don't miss anything.
We are running IBM Content Manager 8.3 (but please don't let this put you off

) which uses DB2 8.1-FP17 also known as 8.2-FP10 system. I am planning to upgrade back to supportable ICM 8.4 and DB2 9.x ASAP. The issue appears to be in the DB2 layer.
Problem
We have stored 400k lines in the ICMNLSDB, no serious problems. Each line represents a document.
The ICM interface hides much of the DB2 level stuff from me as an Admin but because performance was slowly degrading I had to start looking at the DB2 layer (IBM sold it as a blackbox

)
I added two indexes via ICM to the two main attributes (columns), this reduced search times from 1.2 second to 600ms. I then reviewed and ran the standard DB2 optimisation steps which are frequently referred to on the forums and documentation. Perhaps this was a bit fool-hardy but the result for the indexed attributes where reduced from 600ms to 12ms.
Awesome.
- RUNSTAT using a script for all tables where type=T
- REORGCHK
- REORG highlighted tables (db2 REORG TABLE [Table Name] ALLOW NO ACCESS) and (db2 REORG INDEXES ALL FOR TABLE [Table Name] ALLOW NO ACCESS)
- RUNSTAT again
- REBIND
But after the optimisation searches using non-indexed fields were much worse then before.
I can only assume that the Reorg unbalaned some natural order that made table scans somewhat easier? I don't really understand this part and stupidly assumed non-indexed columns searches would remain the same. For example:
Search index field,
DocID = NULL- 518msec
Search on non-indexed field,
Date = 26/05/2010- 523msec.
This is not terrible but what I truly don't understand is if I do a combo search on two fields DB2 runs its search for 40minutes where as previously it took no more then a few seconds. Example:
Search on
DocID = NULL and
Date = 01/06/2010 = query time upto +40minutes before I finally kill the query in DB2 Activity Monitor.
Furthermore; I did observe at one point that the Database size was rapidly expanding, I assume this was due to temp table growth in an attempt to manage the query.
Question 1 Is the user of
NULL a problem for DB2?
Question 2 Would something in the Reorg affect the natural order of data in the tables? I assume this must be the case but need confirmation. Further assumption is the it uses the RUNSTATs to would out the best order?
Question 3 I have the option to index all attributes (columns) but this seems a bit design lazy. Is it lazy if the users come back with a requirement to search on any attribute?