Monthly Archives: October 2008

Escape SQL apostrophe

Many drivers have ways to escape SQL strings to make sure no malicious activity is going on.  Usually you can use a function in the driver that can take care of that.  However, if all you need is too escape … Continue reading

Posted in DB2 | Tagged , , , | View Comments

DB2 Table Structure Alterations

When an attribute on a table is dropped, or the data type changes, DB2 sets the table into REORG PENDING state.  That prevents a number of operations on the table, which can be problematic for a production database.  If there … Continue reading

Posted in DB2 | Tagged , , | View Comments

DB2 Query Optimization: Custom Stats Collection

One of the challenges in query optimization is to make sure that the query optimizer works with accurate estimates on cost of the different possible decision branches in the optimization process.   The accuracy of the estimates depends on the efficiency … Continue reading

Posted in DB2 | Tagged , , , | View Comments

DB2 Large Updates Without Logging

We have large amounts of data, and in development we have to often to bulk insert and updates by the millions. DB2 allows us to dramatically speed up these operation by allowing to not log them.  The trick is to … Continue reading

Posted in DB2 | Tagged , | View Comments