473,839 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filter Factors when using Parameter markers?

Hi,
(DB2 LUW v8.2)

When using parameter markers how does the optimizer evaluate filter
factors?
- and is it able to make use of distribution stats. for parm.
markers?
The reason I ask, is we have heavily skewed data in places and we need
to understand the limitations/estimations the optimizer will use if
and when parameter markers are used.

Many thanks.

PaulR.
Sep 2 '08 #1
2 3571
On Sep 2, 5:35*pm, PaulR <paul_red...@uk .ibm.comwrote:
Hi,
(DB2 LUW v8.2)

When using parameter markers how does the optimizer evaluate filter
factors?
* *- and is it able to make use of distribution stats. for parm.
markers?

The reason I ask, is we have heavily skewed data in places and we need
to understand the limitations/estimations *the optimizer will use if
and when parameter markers are used.

Many thanks.

PaulR.
I don't know how optimizer evaluates filter factors for parameter
markers.
But, you can specify SELECTIVITY clause by specifying environment
variable "DB2_SELECTIVIT Y = Yes"(on DB2 V8 or V9.1. I couldn't find
DB2 environment variables for DB2 V9.5 for LUW).

Sep 2 '08 #2
Ian
PaulR wrote:
Hi,
(DB2 LUW v8.2)

When using parameter markers how does the optimizer evaluate filter
factors?
DB2 is able to determine a filter factor based on the cardinality the
column. i.e., filter factor = 1/colcard.

For example,

select * from t1 where c1 = ?

If c1 has 5 unique values, the filter factor = 0.2. But if c1 has
100 unique values, filter factor = 0.01.

- and is it able to make use of distribution stats. for parm.
markers?

The reason I ask, is we have heavily skewed data in places and we need
to understand the limitations/estimations the optimizer will use if
and when parameter markers are used.
Column distribution is not used with parameter markers.

In DB2 9, the REOPT functionality can allow dynamic SQL with parameter
markers (and static SQL) to take advantage of distribution stats.
Sep 4 '08 #3

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

Similar topics

2
4358
by: Thomas Philips | last post by:
To experiment with filtering, I define a function f(x,k) as follows >>> def f(x,k=2): return x%k==0 I can check that it works by typing >>> f(10,3) False Now, I try to filter a range using >>> filter(f(k=3),range(20))
3
3171
by: Nile | last post by:
I am having a problem with my application that uses ODBC. I am doing the following: * prepare a statement * Bind * execute The problem is that my application needs to accept only insert queries with parameter markers since it later writes to the database depending on the values in the SQL query.
5
1697
by: bughunter | last post by:
For example - very large table with a lot indexes and updates work very slow. I'd like found unused or rarely used indexes. How? Yes, for static I found all sql in packages and, after analyse, drop/recreate some indexes. But for dynamic I have no idea. Only drop all and monitor RR :-) Inhumanely, IMHO Andy
3
3610
by: Venkata C | last post by:
Hi! We are running DB2 V8 on z/OS in compatibility mode. There is one specific query (embedded as static SQL in a COBOL program) that causes the bind job to abend when we use the DEGREE(ANY) option. The bind works fine with DEGREE(1). The bind job binds the DBRM into a plan. The query uses parameter markers. If we replace the parameter markers with literals in the query, the bind goes through without problems. Also, if we change the...
3
6618
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where the text value is on a different table. The me.filter is then a text instead of the id-number from the lookup table. This causes the report to prompt for the parameter. How do I get by this problem? Do I need to create a temporary table? I rather...
5
3784
by: Amaryllis | last post by:
I'm trying to call a CL which is located on our AS400 from a Windows application. I've tried to code it in different ways, but I seem to get the same error every time. Does anyone have any clue as to what this means? I am not trying to alter a table. This particular CL merely generates the next voucher number in a sequence. "SQL0204: HRCU030P in HRZNCUSOBJ type *N not found. Cause . . . . . : HRCU030P in HRZNCUSOBJ type *N was...
23
2595
by: Dave G | last post by:
Since upgrading one of my clients from A97/W2000 to A2003/XP they have suffered no end of data corruption problems, mainly involving one of the main tables. The corruption can result in one record's fields turning into chinese characters. On running the compact/repair I can see that the corruption may be deeper than I expected because sometimes indexes are missing and need to be replaced. I used to think that overuse of 'ctrl-alt-delete'...
3
5088
by: rcarwise | last post by:
Iam having trouble getting started on this program and wanted to know if I could get help on writing a method and loops to get started. this is the program that I have to do: Write a program that reads an integer number n > 1, and writes the input number’s prime factors. The following are a few input/output examples: Input Output 12 2,2,3
7
7218
by: =?ISO-8859-2?Q?Gregor_Kova=E8?= | last post by:
Hi! Is it possible to use parameter markers like this: 1.) SELECT * FROM TABLE1 WHERE FIELD1 LIKE '%?%' If I now set parameter 1 to '' (empty string) I don't get any rows back, but if I run: 2.) SELECT * FROM TABLE1 WHERE FIELD1 LIKE '%%' I get back data I expect.
0
9855
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10586
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10293
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9426
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7828
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
5866
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4484
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
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3134
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.