473,666 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Colocated join question

I have some questions about co-located joins and db partitions. I've heard
various things from various people and was looking for confirmation.

Assume the following tables and partitioning keys:

DEMOG
----------
WHKEY BIGINT NOT NULL -- index and partitioning key

FINDNG
-----------
PAT_NUM INTEGER NOT NULL -- index and partitioning key

Would a join on these tables (DEMOG.WHKEY = FINDNG.PAT_NUM)
be considered co-located by the optimizer?

One person indicated the fields had to have the same name / datatype.
Is that the case, or do the data types just have to be compatible?
Are BIGINT and INTEGER considered compatible datatypes?

Is there a RedBook or Tech guide that gives a good summary
of colocated joins and partitioning?

--
Douglas Crowson Rochester, MN 55905
Information Services (507) 284-0311
Mayo Foundation cr******@mayo.e du

Nov 12 '05 #1
2 3071
The DB2 documentation is a good place to start ... here are some excerpts that may help
you ...

"In an environment where the database is physically divided among two or more database
partitions, there must be a way to keep the related pieces of the divided tables as close
together as possible. The ability to do this is called table collocation .
Tables are collocated when they are stored in the same database partition group, and when
their partitioning keys are compatible. Placing both tables in the same database partition
group ensures a common partitioning map. The tables may be in different table spaces, but
the table spaces must be associated with the same database partition group. The data types
of the corresponding columns in each partitioning key must be partition-compatible . "

"The base data types of corresponding columns of partitioning keys are compared and can be
declared partition compatible . Partition compatible data types have the property that two
variables, one of each type, with the same value, are mapped to the same partition number
by the same partitioning algorithm.

Partition compatibility has the following characteristics :

a.. A base data type is compatible with another of the same base data type.
b.. Internal formats are used for DATE, TIME, and TIMESTAMP data types. They are not
compatible with each other, and none are compatible with CHAR.
c.. Partition compatibility is not affected by columns with NOT NULL or FOR BIT DATA
definitions.
d.. NULL values of compatible data types are treated identically; those of
non-compatible data types may not be.
e.. Base data types of a user-defined type are used to analyze partition compatibility.
f.. Decimals of the same value in the partitioning key are treated identically, even if
their scale and precision differ.
g.. Trailing blanks in character strings (CHAR, VARCHAR, GRAPHIC, or VARGRAPHIC) are
ignored by the hashing algorithm.
h.. BIGINT, SMALLINT, and INTEGER are compatible data types.
i.. REAL and FLOAT are compatible data types.
j.. CHAR and VARCHAR of different lengths are compatible data types.
k.. GRAPHIC and VARGRAPHIC are compatible data types.
l.. Partition compatibility does not apply to LONG VARCHAR, LONG VARGRAPHIC, CLOB,
DBCLOB, and BLOB data types, because they are not supported as partitioning keys. "

--

Bob
Engagement Specialist - DB2 Information Management Software - IBM Software Group
IBM Toronto Lab
[My comments are solely my own and are not meant to represent an official IBM position -
ask my cat!]
"Doug Crowson" <cr******@mayo. edu> wrote in message news:cl******** **@tribune.mayo .edu...
I have some questions about co-located joins and db partitions. I've heard
various things from various people and was looking for confirmation.

Assume the following tables and partitioning keys:

DEMOG
----------
WHKEY BIGINT NOT NULL -- index and partitioning key

FINDNG
-----------
PAT_NUM INTEGER NOT NULL -- index and partitioning key

Would a join on these tables (DEMOG.WHKEY = FINDNG.PAT_NUM)
be considered co-located by the optimizer?

One person indicated the fields had to have the same name / datatype.
Is that the case, or do the data types just have to be compatible?
Are BIGINT and INTEGER considered compatible datatypes?

Is there a RedBook or Tech guide that gives a good summary
of colocated joins and partitioning?

--
Douglas Crowson Rochester, MN 55905
Information Services (507) 284-0311
Mayo Foundation cr******@mayo.e du

Nov 12 '05 #2
Thanks. That's just the information I was looking for. I finally found it in
the Admin Planning Guide.

Doug
In article <2t************ *@uni-berlin.de>, "Bob [IBM]" <Bo******@canad a.com> writes:
The DB2 documentation is a good place to start ... here are some excerpts that may help
you ...

"In an environment where the database is physically divided among two or more database
partitions, there must be a way to keep the related pieces of the divided tables as close
together as possible. The ability to do this is called table collocation .
Tables are collocated when they are stored in the same database partition group, and when
their partitioning keys are compatible. Placing both tables in the same database partition
group ensures a common partitioning map. The tables may be in different table spaces, but
the table spaces must be associated with the same database partition group. The data types
of the corresponding columns in each partitioning key must be partition-compatible . "

"The base data types of corresponding columns of partitioning keys are compared and can be
declared partition compatible . Partition compatible data types have the property that two
variables, one of each type, with the same value, are mapped to the same partition number
by the same partitioning algorithm.

Partition compatibility has the following characteristics :

a.. A base data type is compatible with another of the same base data type.
b.. Internal formats are used for DATE, TIME, and TIMESTAMP data types. They are not
compatible with each other, and none are compatible with CHAR.
c.. Partition compatibility is not affected by columns with NOT NULL or FOR BIT DATA
definitions.
d.. NULL values of compatible data types are treated identically; those of
non-compatible data types may not be.
e.. Base data types of a user-defined type are used to analyze partition compatibility.
f.. Decimals of the same value in the partitioning key are treated identically, even if
their scale and precision differ.
g.. Trailing blanks in character strings (CHAR, VARCHAR, GRAPHIC, or VARGRAPHIC) are
ignored by the hashing algorithm.
h.. BIGINT, SMALLINT, and INTEGER are compatible data types.
i.. REAL and FLOAT are compatible data types.
j.. CHAR and VARCHAR of different lengths are compatible data types.
k.. GRAPHIC and VARGRAPHIC are compatible data types.
l.. Partition compatibility does not apply to LONG VARCHAR, LONG VARGRAPHIC, CLOB,
DBCLOB, and BLOB data types, because they are not supported as partitioning keys. "

--

Bob
Engagement Specialist - DB2 Information Management Software - IBM Software Group
IBM Toronto Lab
[My comments are solely my own and are not meant to represent an official IBM position -
ask my cat!]
"Doug Crowson" <cr******@mayo. edu> wrote in message news:cl******** **@tribune.mayo .edu...
I have some questions about co-located joins and db partitions. I've heard
various things from various people and was looking for confirmation.

Assume the following tables and partitioning keys:

DEMOG
----------
WHKEY BIGINT NOT NULL -- index and partitioning key

FINDNG
-----------
PAT_NUM INTEGER NOT NULL -- index and partitioning key

Would a join on these tables (DEMOG.WHKEY = FINDNG.PAT_NUM)
be considered co-located by the optimizer?

One person indicated the fields had to have the same name / datatype.
Is that the case, or do the data types just have to be compatible?
Are BIGINT and INTEGER considered compatible datatypes?

Is there a RedBook or Tech guide that gives a good summary
of colocated joins and partitioning?

--
Douglas Crowson Rochester, MN 55905
Information Services (507) 284-0311
Mayo Foundation cr******@mayo.e du



--
Douglas Crowson Rochester, MN 55905
Information Services (507) 284-0311
Mayo Foundation cr******@mayo.e du

Nov 12 '05 #3

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

Similar topics

0
3062
by: B. Fongo | last post by:
I learned MySQL last year without putting it into action; that is why I face trouble in formulating my queries. Were it a test, then you would have passed it, because your queries did help me solve my problem. I'll turn to MySQL doc after getting through this pressing project. Thanks a lot Roger! Babale -----Urspr=FCngliche Nachricht-----
1
3441
by: Paul Bramscher | last post by:
Here's one for pathological SQL programmers. I've got a table of things called elements. They're components, sort of like amino acids, which come together to form complex web pages -- as nodes in trees which form parent-child relationships, sort of like newsgroups. For example, the parent_id field points to another element. Indent_level is there for denormalization purposes, to avoid costly recursive issues in querying. The...
4
14563
by: eXavier | last post by:
Hello, I have query joining several tables, the last table is joined with LEFT JOIN. The last table has more then million rows and execution plan shows table scan on it. I have indexed columns on which the join is made. If I replace LEFT JOIN with INNER JOIN, index is used and execution takes few seconds but with LEFT JOIN there is a table scan , so the execution takes several minutes. Does using outer joins turn off indexes? Missed I
8
4165
by: xixi | last post by:
when i create a join view like this create view JV104FZ.APJTINM1 (APAM32, APNO20, APQY05, PONO01, PONO05, PONO19, POCD01, POCD13, systimestamp, loginname, id ) as select JV104FZ.APPTINM.APAM32, JV104FZ.APPTINM.APNO20, JV104FZ.APPTINM.APQY05, JV104FZ.APPTINM.PONO01, JV104FZ.APPTINM.PONO05, JV104FZ.APPTINM.PONO19, COALESCE(JV104FZ.POPTOL.POCD01, ' '), COALESCE(JV104FZ.POPTOL.POCD13, ' '), JV104FZ.POPTOL.systimestamp,...
3
23088
by: Ian Boyd | last post by:
i know nothing about DB2, but i'm sure this must be possible. i'm trying to get a client to create a view (which it turns out is called a "Logical" in DB2). The query needs a LEFT OUTER JOIN, but he doesn't know how to do that, or even if he can, and i don't have to time to learn DB2 from scratch right now. The following SQL Query is a trimmed sample of the full View (i.e. Logical) definition - and i would create it on an SQL based...
3
5814
by: rlgoer1 | last post by:
Please bear with me. I'm still learning my netiquette with this group. I am using Access 2000 and after 3 reinstalls and 5 repairs, I am still getting the following error message: MSJETOLEDB40.DLL failed to register. HRESULT - 2147024865 I found the problem file in the c:\windows\system directory. Now I know there is a button in access 2000 somewhere to care of little problems like
7
2525
by: germanshorthairpointer | last post by:
Hello, I'm trying to do a join based on the following tables: Person(person_id,person_name) Grade(grade_id,grade_person_id,grade_score) The data looks like this: Person:
27
2838
by: Paulo da Silva | last post by:
Hi! I was told in this NG that string is obsolet. I should use str methods. So, how do I join a list of strings delimited by a given char, let's say ','? Old way:
12
13181
by: Chamnap | last post by:
Hello, everyone I have one question about the standard join and inner join, which one is faster and more reliable? Can you recommend me to use? Please, explain me... Thanks Chamnap
0
8445
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
8871
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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...
1
8551
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
6198
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
4198
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
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
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
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.