ibm-information-center/dist/eclipse/plugins/i5OS.ic.dbmult_5.4.0.1/broadcast.htm

125 lines
7.6 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="Broadcast join with DB2 Multisystem" />
<meta name="abstract" content="In a broadcast join, all of the selected records of one file are sent or broadcast to all the nodes of the other file before the join is performed." />
<meta name="description" content="In a broadcast join, all of the selected records of one file are sent or broadcast to all the nodes of the other file before the join is performed." />
<meta name="DC.subject" content="query, broadcast join, join, broadcast, example, broadcast join query" />
<meta name="keywords" content="query, broadcast join, join, broadcast, example, broadcast join query" />
<meta name="DC.Relation" scheme="URI" content="joins.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="broadcast" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Broadcast join with DB2 Multisystem</title>
</head>
<body id="broadcast"><a name="broadcast"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Broadcast join with DB2<sup>®</sup> Multisystem</h1>
<div><p>In a broadcast join, all of the selected records of one file are
sent or broadcast to all the nodes of the other file before the join is performed.</p>
<div class="section"><p>This is the join method that is used for all nonequijoin queries.
This method is also used when the join criteria uses fields that have a data
type of date, time, timestamp, or floating-point numeric.</p>
<p>In the following
example, the distributed query optimizer decides to broadcast EMPLOYEE, because
applying the selection JOB = 'Manager' results in broadcasting a smaller set
of records. The temporary file at each node in the node group contains all
the selected records. (Records are duplicated at each node.)</p>
<p>SQL statement:</p>
<pre> SELECT DEPTNAME, FIRSTNME, LASTNAME
FROM DEPARTMENT, EMPLOYEE
WHERE DEPTNO &lt;&gt; WORKDEPT AND JOB = 'Manager'</pre>
<p>OPNQRYF
command:</p>
<pre> OPNQRYF FILE((DEPARTMENT) (EMPLOYEE))
FORMAT(JOINFMT)
QRYSLT('JOB *EQ 'Manager')
JFLD((DEPTNO WORKDEPT *NE))</pre>
<p>The
distributed query optimizer sends the following two selected records to each
node:</p>
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
<table cellpadding="4" cellspacing="0" summary="" border="0"><caption>Table 1. Records that the distributed query optimizer
sends to each node</caption><thead align="left"><tr><th align="center" valign="bottom" width="17.22222222222222%" id="d0e77">Old node</th>
<th align="left" valign="bottom" width="18.51851851851852%" id="d0e79">New node</th>
<th align="left" valign="bottom" width="19.814814814814817%" id="d0e81">FIRSTNME</th>
<th align="left" valign="bottom" width="21.85185185185185%" id="d0e83">LASTNAME</th>
<th align="center" valign="bottom" width="22.59259259259259%" id="d0e85">WORKDEPT</th>
</tr>
</thead>
<tbody><tr><td align="center" valign="top" width="17.22222222222222%" headers="d0e77 ">SYSA</td>
<td align="left" valign="top" width="18.51851851851852%" headers="d0e79 ">SYSA, SYSB, SYSC</td>
<td align="left" valign="top" width="19.814814814814817%" headers="d0e81 ">Christine</td>
<td align="left" valign="top" width="21.85185185185185%" headers="d0e83 ">Haas</td>
<td align="center" valign="top" width="22.59259259259259%" headers="d0e85 ">A00</td>
</tr>
<tr><td align="center" valign="top" width="17.22222222222222%" headers="d0e77 ">SYSC</td>
<td align="left" valign="top" width="18.51851851851852%" headers="d0e79 ">SYSA, SYSB, SYSC</td>
<td align="left" valign="top" width="19.814814814814817%" headers="d0e81 ">Michael</td>
<td align="left" valign="top" width="21.85185185185185%" headers="d0e83 ">Thompson</td>
<td align="center" valign="top" width="22.59259259259259%" headers="d0e85 ">B00</td>
</tr>
</tbody>
</table>
</td></tr></table>
<p>Records returned by this query:</p>
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
<table cellpadding="4" cellspacing="0" summary="" border="0"><caption>Table 2. Display
of the query results</caption><thead align="left"><tr><th align="left" valign="bottom" width="33.33333333333333%" id="d0e121">DEPTNAME</th>
<th align="left" valign="bottom" width="33.33333333333333%" id="d0e123">FIRSTNME</th>
<th align="left" valign="bottom" width="33.33333333333333%" id="d0e125">LASTNAME</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e121 ">Support services</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e123 ">Michael</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e125 ">Thompson</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e121 ">Planning</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e123 ">Christine</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e125 ">Haas</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e121 ">Planning</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e123 ">Michael</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e125 ">Thompson</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e121 ">Accounting</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e123 ">Christine</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e125 ">Haas</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e121 ">Programming</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e123 ">Christine</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e125 ">Haas</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e121 ">Programming</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e123 ">Michael</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e125 ">Thompson</td>
</tr>
</tbody>
</table>
</td></tr></table>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="joins.htm" title="In addition to the performance considerations for nondistributed join queries, more performance considerations exist for queries involving distributed files.">Implementation and optimization of join operations with DB2 Multisystem</a></div>
</div>
</div>
</body>
</html>