RSS

DB2 Tuning Tips

23 Nov

1) Take out any / all-Scalar functions coded on columns in predicates. For example, this is the most common:

SELECT EMPNO, LASTNAME

FROM EMPLOYEE

WHERE YEAR(HIREDATE) = 2005

Should be coded as:

SELECT EMPNO, LASTNAME

FROM EMPLOYEE

WHERE HIREDATE BETWEEN ‘2005-01-01’ and ‘2005-12-31’

DB2 Tuning Tips

Advertisements
 
Leave a comment

Posted by on November 23, 2009 in database

 

Tags: ,

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

 
%d bloggers like this: