hi,
first, thanks to all trying to help
using LIKE clause with OR made explain plain go crazy with 10 to power
38 timerons from 798000 timerons withSUBSTR (abc,1,1) IN
('SS',V'V',OO',PP',EE')
so, i stayed with SUBSTR(abc,1,1) IN ('SS',V'V',OO',PP',EE')
there were three more columns along with abc used in the same where
clause from this table say XYZ
i created compund index with all four columns and ordered column in
index with decreasing cardinality and allow reverse scans
now, it used index for SUBSTR(abc,1,1) IN ('SS',V'V',OO',PP',EE')
i do not understand this behaviour. previously, i had indexes on
individual columns and db2 did use indexes for all columns from table
XYZ but abc column
not when i create compound index, db2 uses index for all.
please someone explain
also, give me some good web,book,articles references to understand
behaviour of indexes in db2
On Dec 15, 10:51 pm, "Tonkuma" <tonk...@jp.ibm.comwrote:
Quote:
Tonkuma wrote:
Quote:
I tested by using Sample table data as following.
The last query used the Index.
Has your index include only column abc?
Or, do you have many AND conditions and is another index more
effective?I'm sorry. I made mistake. You wrote DB2 do tablespace scan.