If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SQL performance tunning

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-17-04, 02:19
shyam_covansys shyam_covansys is offline
Registered User
 
Join Date: Aug 2004
Posts: 1
SQL performance tunning

Hi,
I want to fine tune my query to reduce the time of execution. In SQL select statement there is

WHERE CHECK_NO_INTERNAL > :H

We modified by using

WHERE CHECK_NO_INTERNAL BETWEEN :H AND :H. It reduces the time. Is there any other way to optimize this query execution.

Thanks in advance
Shyam
Reply With Quote
  #2 (permalink)  
Old 08-17-04, 10:23
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
You can try to run more detailed runstats (with distribution) on the table. Without knowing the distribution of values on the table, DB2 assumes that > or < will return more rows than a "between". This can affect whether DB2 chooses to use an index. You can also try to alter the table to set it VOLATILE, which usually encourages DB2 to use an index that might not ordinarily be used.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 08-17-04 at 11:05.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On