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 > db2 selectivity

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-23-11, 19:22
usc usc is offline
Registered User
 
Join Date: Apr 2007
Posts: 21
db2 selectivity

what is the right value for setting the registry variable db2_selectivity?

db2_selectivity=YES
or
db2_selectivity=ALL

db2 manuals/ibm dw indicate db2_selectivity=YES

Thx!
Reply With Quote
  #2 (permalink)  
Old 08-23-11, 19:40
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
From 9.7 manuals
Quote:
DB2_SELECTIVITY
Operating system: All
Default=NO, Values: YES or NO
This registry variable controls where the SELECTIVITY clause can be used in search conditions in SQL statements.
When this registry variable is set to YES, the SELECTIVITY clause can be specified for the following predicates:
A basic predicate in which at least one expression contains host variables
A LIKE predicate in which the MATCH expression, predicate expression, or escape expression contains host variables
As per this info, there is no ALL in the values list. where did you get your info?

Also, the default is NO. Use only as a last resort.

HTH
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 08-24-11, 15:00
usc usc is offline
Registered User
 
Join Date: Apr 2007
Posts: 21
we are on db2 9.5

selectivity works when db2_selectivity=ALL instead of db2_selectivity=YES

some reference link's which indicates db2_selectivity=ALL alone enables selectivity

very very slow query with parameters - DB2 Database

Browsing whole table? - DB2 Database
Reply With Quote
  #4 (permalink)  
Old 08-24-11, 15:39
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I think you can trust Serge Rielau.

I just tested - both ALL and YES work. There may be some subtle differences though of which I'm not aware.
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