473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

MDC vs optimizer

Hello,
DB2 V8 FP10

We are doing some performance tunning with an MDC table and we found
unexpected access plans with columns used for range and IN predicates
(Optimization class 7).

Our MDC have 2 dimensions, ColDim1 and ColDim2

Query1:

Select Col1,Col2, Col3
>From MDC_Table
Where
ColDim1 = 'YYYYMM'
and Col_Dim2 IN (1,2,3,4)

In Query1 DB2 uses DimensionIndex on ColDim1 but if we replace the IN
predicate with ORs
(ColDim1 =1 OR ColDim1=2 OR ColDim1=3 OR ColDim1=4) then the
optimizer choose the composite BLOCK Index on ColDim1 and ColDim2.

Query2

Select Col1,Col2, Col3
>From MDC_Table
Where
ColDim1 = 'YYYYMM'
and Col_DIM1 BETWEEN 3 and 5

In Query2 DB2 uses DimensionIndex on ColDim1 instead of composite
BLOCK Index on ColDim1 and ColDim2.

Anyone have an explanation ?

Thanks

May 22 '07 #1
1 1477
Ian
martely wrote:
Hello,
DB2 V8 FP10

We are doing some performance tunning with an MDC table and we found
unexpected access plans with columns used for range and IN predicates
(Optimization class 7).

Our MDC have 2 dimensions, ColDim1 and ColDim2

Query1:

Select Col1,Col2, Col3
>>From MDC_Table
Where
ColDim1 = 'YYYYMM'
and Col_Dim2 IN (1,2,3,4)

In Query1 DB2 uses DimensionIndex on ColDim1 but if we replace the IN
predicate with ORs
(ColDim1 =1 OR ColDim1=2 OR ColDim1=3 OR ColDim1=4) then the
optimizer choose the composite BLOCK Index on ColDim1 and ColDim2.

Query2

Select Col1,Col2, Col3
>>From MDC_Table
Where
ColDim1 = 'YYYYMM'
and Col_DIM1 BETWEEN 3 and 5

In Query2 DB2 uses DimensionIndex on ColDim1 instead of composite
BLOCK Index on ColDim1 and ColDim2.

Anyone have an explanation ?
Not without seeing the explain plans, because many things could cause
this. What is the column order in the composite block index?
May 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nick Mudge | last post by:
Hi, Does anybody know the performance difference between having your PHP code cached and just running your code with the zend optimizer? Is there much difference? Nick
9
by: hemal | last post by:
I came across a very strange situation at work. There is an order of magnitude difference in execution time for the following two queries (10 v/s ~130 msec): select count(*) from table_name...
2
by: gefek | last post by:
Hello, I've got a server postgresql 7.4.6 installed from RPM for linux RH 9. Lately, I've noticed, that some queries last too long... It appears to me, that the optimizer does not use index...
3
by: Philip Yale | last post by:
I'm very puzzled by the choice of NC index being made by the optimizer in this example. I don't actually think it should use an NC index at all. I have: Table: CustomerStatus_T Single data...
3
by: Peter Arrenbrecht | last post by:
Hi all We ran into a very annoying optimizer problem recently. We had added a new key and self-join relation to a large production table. That key will be filled very rarely and having just...
9
by: Andrea | last post by:
Hi, I've read the former postings but was not able to solve my problem: I have a Summary Table (or MQT as you like it) and the query optimizer does not seem to use the summary table. I run...
5
by: Kevin | last post by:
Using a base table, a MQT table was created. With optimization - when querying the base table with calcuation that are already completed in the MQT - I would assume the optimizer would use the MQT...
2
by: boa sema | last post by:
Way back when, and at least in version 7 IIRC, the query optimizer gave up when the where clause in a statement contained more than 4 search conditions. Does anyone know if such a limitation...
3
by: aj | last post by:
DB2 LUW v8.2 FP 14 RHAS 2.1 Sorry if these are newbie questions. Optimizer stuff is black magic to me. For both of these, assume stats are current and an even distribution of data....
0
by: P. Adhia | last post by:
Hi, Consider the following query select * from t1 where c1 = ? and c2 = ?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.