473,685 Members | 3,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Optimization level in db2?

Dear All
Db2 version: 8.1
OS: Windows

I have 2 questions:
1) What is the optimizer which db2 uses, rule based or cost based? If any
one can clear out the difference between the two it will be a great help.

2) I have an Oracle database which I have ported to db2. Now suppose after
2 months oracle database has fresh data and I need to ensure that the data
in db2 database is in sync with this. How can I do this?

Any help will be greatly appreciated

Warm regards,

Praveen Pandey
Nov 12 '05 #1
5 2683

"Praveen_db 2" <er***********@ hotmail.com> wrote in message
news:ef******** *************** *******@localho st.talkaboutdat abases.com...
Dear All
Db2 version: 8.1
OS: Windows

I have 2 questions:
1) What is the optimizer which db2 uses, rule based or cost based? If any
one can clear out the difference between the two it will be a great help.

DB2 uses a cost based optimizer. That means that DB2 uses statistical data
about the tables, indexes, columns, tablespaces, etc that are captured when
runstats command is run, and information about the configuration (including
disk characteristics speed defined for the tablespace), number of CPU's CPU
speed, size of bufferpools (memory), etc, and then calculates a "relative"
cost estimate of various access path alternatives, and chooses the lowest
cost access path.

Actually, DB2 has a parameter called optimization level that determines how
long DB2 will spend trying calculate all of the various options. The value
ranges from 1-9, and 5 is the default (some levels are not currently
defined, such as 6 or 8). Optimization level 5 is usually good for most SQL
statements, but some very complex decision support queries can benefit from
optimization level of 7.

There are variations on the "rule based" method, but basically it attempts
to figure out the access path based on certain heuristics, and sometimes
explicit hints or instructions by the programmer to use a particular access
path.

I doubt that any database is 100% cost based nor 100 rule based, just like
there are no pure relational databases. But it is safe to say that DB2 is
probably relies more on cost based optimization than other database
products.
Nov 12 '05 #2
Thanx a lot Mark.
Can any one tell me about the second question. I guess this can be done by
using some third party tools.

Praveen

Nov 12 '05 #3
Thanx a lot Mark.
Can any one tell me about the second question. I guess this can be done by
using some third party tools.

Praveen

Nov 12 '05 #4
Praveen_db2 wrote:
Thanx a lot Mark.
Can any one tell me about the second question. I guess this can be done by
using some third party tools.

Praveen


This might be bold, and perhaps even heathen. But you could try creating
an external C stored procedure which interfaces with Oracle to sync the
databases.
I'm not very familiair with the Oracle DB, but if it has an export file
format the is compatible with any of the DB2s' import files you could
try that way to sync. Both ways are a bit uncommon, but I would explore
those (but I do many things others wouldn't).

-R-
Nov 12 '05 #5
You can set up DB2 replication with Oracle as a source and DB2 as a target.

Larry Edelstein

Praveen_db2 wrote:
Thanx a lot Mark.
Can any one tell me about the second question. I guess this can be done by
using some third party tools.

Praveen

Nov 12 '05 #6

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

Similar topics

3
1693
by: Bryan Parkoff | last post by:
.....I try to reduce un-necessary temporal variables so it can be optimized for best performance. I try to assign only one register storage so two variables can access to only one register storage before they are stored into memory location (variable storage). .....Please take a look at two functions below. Byte variable and Carry variable are global variables outside of functions. .....Do you notice that there are two duplicated lines...
9
2394
by: Rune | last post by:
Is it best to use double quotes and let PHP expand variables inside strings, or is it faster to do the string manipulation yourself manually? Which is quicker? 1) $insert = 'To Be'; $sentence = "$insert or not $insert. That is the question."; or
5
4410
by: AC Slater | last post by:
Whats the simplest way to change a single stored procedures query optimization level? In UDB8 that is. /F
24
8607
by: Kunal | last post by:
Hello, I need help in removing if ..else conditions inside for loops. I have used the following method but I am not sure whether it has actually helped. Below is an example to illustrate what I have used. Original code : c= 0 ; for (i=0; i<999; i++)
206
8315
by: WaterWalk | last post by:
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a footprint which says: "Indeed, one often hears arguments against building exibility into an engineered sys- tem. For example, in the philosophy of the computer language Python it is claimed: \There should be one|and preferably only one|obvious...
4
9343
by: specialdosa | last post by:
We use DB2-LUW-8.2. I am doing some research on performance issues and I read about the "OPTIMIZATION LEVELS' and their impacts on Joins. How do I get the Optimization level implemented here? Can I query some system tables? Can someone help me pls ?
7
2444
by: db2admin | last post by:
hello, where can i see what optimization level a certain sql has used ? is there any snapshot, event monitor, query patroller information which can be used to see that ? regards, db2admin
2
4250
by: db2admin | last post by:
hi, I have query which runs great when optimization level is changed to 3 but does not run fine with default optimization level of 5. since this is a query in java code, i do not know how can i change optimization level of this one sql. also, developers are not comfortable with this. i am thinking of writing stored procedure in which i can execute sql with lower optimization level and return resultset to java code.
20
2340
by: Ravikiran | last post by:
Hi Friends, I wanted know about whatt is ment by zero optimization and sign optimization and its differences.... Thank you...
0
8504
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8758
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5789
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4521
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2196
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.