use Jython for some proof of concept in JDBC

We have a slow SQL in DB2 running over 10 seconds. One of index clustering ratio is too low and can’t be easily improved without affecting other indexes. One workaround we found is to increase DB2 ‘s query optimazation level from 2 to 3 for this SQL only.

I used Jython for a quick proof of concept. It only takes like 5 minutes of my time.

stmt.execute("set current query optimization 2")
rs = stmt.executeQuery(slowSQL)
stmt.execute("set current query optimization 3")

This slowSQL now run under subseconds now. amazing.

Advertisements
This entry was posted in jython. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s