473,462 Members | 1,036 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Predicate evaluation across federation

I have a query that has 5 predicates, scanning a table of 400+ million
rows and I have built indexes getting help from design advisor and
other tools. The cost of that query is really low. But I federated the
server and created a nickname for that table, and when I give the same
query against the nickname, it tries to fetch the whole table (cost
1.7 billion), and do the predicate evaluation in my smaller test box.
I did build indices in my test box with 'specification only' clause,
and runstats, and other things. I also read about query pushdown, and
hoping that would help, I changed the cpu_ratio parameter in fed
server's config. Still no joy. Please help.. any links would be
appreciated.
Also, how does one quantify cost of a query..
Dec 5 '07 #1
3 1907
Arun Srinivasan wrote:
I have a query that has 5 predicates, scanning a table of 400+ million
rows and I have built indexes getting help from design advisor and
other tools. The cost of that query is really low. But I federated the
server and created a nickname for that table, and when I give the same
query against the nickname, it tries to fetch the whole table (cost
1.7 billion), and do the predicate evaluation in my smaller test box.
I did build indices in my test box with 'specification only' clause,
and runstats, and other things. I also read about query pushdown, and
hoping that would help, I changed the cpu_ratio parameter in fed
server's config. Still no joy. Please help.. any links would be
appreciated.
Also, how does one quantify cost of a query..
Maybe you could give us some more details. How did you do the runstats on
the fed server? What's your table/nickname, indexes (on both ends), the
query and the access plan for it? How did you determine that all rows are
to be fetched from the data source to the fed server?

Which version of DB2 are you using on which platform? Is your fed server
and remote data source both a DB2 system?

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Dec 7 '07 #2
Maybe you could give us some more details. How did you do the runstats on
the fed server? What's your table/nickname, indexes (on both ends), the
query and the access plan for it? How did you determine that all rows are
to be fetched from the data source to the fed server?

Which version of DB2 are you using on which platform? Is your fed server
and remote data source both a DB2 system?

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Hi
Both servers are runnning db2, but the federator is on 8.2 while the
remote source is in 9.4. I ran a sql from my test db(not the source)
and did a db2explain, it showed me that the predicate evaluation was
done in remote server. But the way our developers were doing was to
construct this sql on the fly, open a cursor inside a stored
procedure , like for example, their input data matches some rules,
they give one particular sql for constructing a cursor with. If it
uses the remote data source (only that with some predicates) , the
target tries to get entire table and do the predicate evaluation.
I have constructed indexes on this nickname (definition only) , that
didnt help me either. I am running out of options.
The way I find that predicate evaluation is done in target is the
cost of query that runs in my source (145MIL -aah..) and the sql from
the snapshot. The sql doesnt have any predicates, and this escalates
to a table level lock as soon as it starts.
Any help would be appreciated.
Thank you
Arun
Dec 10 '07 #3
Arun Srinivasan wrote:
Both servers are runnning db2, but the federator is on 8.2 while the
remote source is in 9.4. I ran a sql from my test db(not the source)
and did a db2explain, it showed me that the predicate evaluation was
done in remote server. But the way our developers were doing was to
construct this sql on the fly, open a cursor inside a stored
procedure , like for example, their input data matches some rules,
they give one particular sql for constructing a cursor with. If it
uses the remote data source (only that with some predicates) , the
target tries to get entire table and do the predicate evaluation.
I have constructed indexes on this nickname (definition only) , that
didnt help me either. I am running out of options.
The way I find that predicate evaluation is done in target is the
cost of query that runs in my source (145MIL -aah..) and the sql from
the snapshot. The sql doesnt have any predicates, and this escalates
to a table level lock as soon as it starts.
I guess I'm a bit dense here because I didn't understand the details. Could
you post:
(1) The access plans you got from your separate test and and from the code
in the stored procedure?
(2) The stored procedure code (stripped down to the bare minimum that
exhibits the problem.
(3) A CLI trace from the remote data source where you can see which SQL
statements are being processed. (That's an easy way to verify what the
federated server really sends to the data source.)
In short, while I understand your description, we are simply missing the
details to say anything about it.

p.s: I'm assuming your remote data source is running DB2 V9.5 (and not 9.4)?

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Dec 11 '07 #4

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

Similar topics

2
by: RavenCross | last post by:
we are in need of a game developer rather quickly. Candidates will be responsible in assisting in all coding from marketing, developing new games, maintaining and updating existing games in the...
14
by: spencer | last post by:
My client is going through a large project to replace existing data warehouse physical infastructure which is running DB2 8.1.6. In the past we had a much more distributed environment where we had...
3
by: BobTheDatabaseBoy | last post by:
can't find in the RedBook, or scouring this NG, a simple yes/no answer to the question: given mountains of existing COBOL programs which have read/written to multiple schemas, but in one...
8
by: der | last post by:
Hello all, I've a question about order of evaluations in expressions that have && and || operators in them. The question is: will the evalution go left-to-right, no matter what -- even if the...
4
by: Frank Wallingford | last post by:
Note: For those with instant reactions, this is NOT the common "why is i = i++ not defined?" question. Please read on. I came across an interesting question when talking with my colleagues....
3
by: Baski | last post by:
Hi, I have few questions, 1) I have DB2 8.2 ESE, with a db2 instance and a few databases. Is it posiible to create and configure a federated server. what are the things/steps required to do...
1
by: SteZgr | last post by:
I have implemented in .NET 2.0 a custom XPathNavigator for Xpath filtering on an object tree. So far it works. While analyzing the performance, I have noticed a lot of MoveToNextAttribute calls. ...
5
by: BobTheDataBaseBoy | last post by:
A client has 390/V7 and UDB/V8. It would be useful to use row_number() when selecting from 390, but that's not supported. It occurs to me (I'm not in CubeLand, and anyway we upgraded to V8 on...
0
by: vbace2 | last post by:
Using DB2 v9.1 fixpak 2 (WSE with HADR feature) on Windows 2003 Servers We are trying to set up HADR for two production databases. The two primary databases reside on two different servers. We...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.